25 QUrl, |
25 QUrl, |
26 pyqtSignal, |
26 pyqtSignal, |
27 pyqtSlot, |
27 pyqtSlot, |
28 ) |
28 ) |
29 |
29 |
30 from eric7 import Preferences, Utilities |
30 from eric7 import Globals, Preferences |
31 from eric7.EricGui import EricPixmapCache |
31 from eric7.EricGui import EricPixmapCache |
|
32 from eric7.SystemUtilities import OSUtilities |
32 from eric7.UI.NotificationWidget import NotificationTypes |
33 from eric7.UI.NotificationWidget import NotificationTypes |
33 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
34 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
34 |
35 |
35 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient |
36 from .SafeBrowsingAPIClient import SafeBrowsingAPIClient |
36 from .SafeBrowsingCache import SafeBrowsingCache |
37 from .SafeBrowsingCache import SafeBrowsingCache |
65 self.__apiClient = SafeBrowsingAPIClient(self.__apiKey, parent=self) |
66 self.__apiClient = SafeBrowsingAPIClient(self.__apiKey, parent=self) |
66 else: |
67 else: |
67 self.__apiClient = None |
68 self.__apiClient = None |
68 |
69 |
69 gsbCachePath = os.path.join( |
70 gsbCachePath = os.path.join( |
70 Utilities.getConfigDir(), "web_browser", "safe_browsing" |
71 Globals.getConfigDir(), "web_browser", "safe_browsing" |
71 ) |
72 ) |
72 self.__cache = SafeBrowsingCache(gsbCachePath, self) |
73 self.__cache = SafeBrowsingCache(gsbCachePath, self) |
73 |
74 |
74 self.__gsbDialog = None |
75 self.__gsbDialog = None |
75 self.__setPlatforms() |
76 self.__setPlatforms() |
108 """ |
109 """ |
109 Private method to set the platforms to be checked against. |
110 Private method to set the platforms to be checked against. |
110 """ |
111 """ |
111 self.__platforms = None |
112 self.__platforms = None |
112 if Preferences.getWebBrowser("SafeBrowsingFilterPlatform"): |
113 if Preferences.getWebBrowser("SafeBrowsingFilterPlatform"): |
113 if Utilities.isWindowsPlatform(): |
114 if OSUtilities.isWindowsPlatform(): |
114 platform = "windows" |
115 platform = "windows" |
115 elif Utilities.isMacPlatform(): |
116 elif OSUtilities.isMacPlatform(): |
116 platform = "macos" |
117 platform = "macos" |
117 else: |
118 else: |
118 # treat all other platforms like linux |
119 # treat all other platforms like linux |
119 platform = "linux" |
120 platform = "linux" |
120 self.__platforms = SafeBrowsingAPIClient.getPlatformTypes(platform) |
121 self.__platforms = SafeBrowsingAPIClient.getPlatformTypes(platform) |