| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 // Returns true if |url| should get extension api bindings and be permitted | 420 // Returns true if |url| should get extension api bindings and be permitted |
| 421 // to make api calls. Note that this is independent of what extension | 421 // to make api calls. Note that this is independent of what extension |
| 422 // permissions the given extension has been granted. | 422 // permissions the given extension has been granted. |
| 423 bool ExtensionBindingsAllowed(const GURL& url); | 423 bool ExtensionBindingsAllowed(const GURL& url); |
| 424 | 424 |
| 425 // Returns true if a normal browser window should avoid showing |url| in a | 425 // Returns true if a normal browser window should avoid showing |url| in a |
| 426 // tab. In this case, |url| is also rewritten to an error URL. | 426 // tab. In this case, |url| is also rewritten to an error URL. |
| 427 bool ShouldBlockUrlInBrowserTab(GURL* url); | 427 bool ShouldBlockUrlInBrowserTab(GURL* url); |
| 428 | 428 |
| 429 // Returns the icon to display in the omnibox for the given extension. | |
| 430 gfx::Image GetOmniboxIcon(const std::string& extension_id); | |
| 431 | |
| 432 // Returns the icon to display in the omnibox popup window for the given | |
| 433 // extension. | |
| 434 gfx::Image GetOmniboxPopupIcon(const std::string& extension_id); | |
| 435 | |
| 436 // Called when the initial extensions load has completed. | 429 // Called when the initial extensions load has completed. |
| 437 virtual void OnLoadedInstalledExtensions(); | 430 virtual void OnLoadedInstalledExtensions(); |
| 438 | 431 |
| 439 // Adds |extension| to this ExtensionService and notifies observers than an | 432 // Adds |extension| to this ExtensionService and notifies observers than an |
| 440 // extension has been loaded. Called by the backend after an extension has | 433 // extension has been loaded. Called by the backend after an extension has |
| 441 // been loaded from a file and installed. | 434 // been loaded from a file and installed. |
| 442 virtual void AddExtension(const extensions::Extension* extension) OVERRIDE; | 435 virtual void AddExtension(const extensions::Extension* extension) OVERRIDE; |
| 443 | 436 |
| 444 // Check if we have preferences for the component extension and, if not or if | 437 // Check if we have preferences for the component extension and, if not or if |
| 445 // the stored version differs, install the extension (without requirements | 438 // the stored version differs, install the extension (without requirements |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 | 937 |
| 945 // Keeps track of loading and unloading component extensions. | 938 // Keeps track of loading and unloading component extensions. |
| 946 scoped_ptr<extensions::ComponentLoader> component_loader_; | 939 scoped_ptr<extensions::ComponentLoader> component_loader_; |
| 947 | 940 |
| 948 // Keeps track of menu items added by extensions. | 941 // Keeps track of menu items added by extensions. |
| 949 extensions::MenuManager menu_manager_; | 942 extensions::MenuManager menu_manager_; |
| 950 | 943 |
| 951 // Keeps track of app notifications. | 944 // Keeps track of app notifications. |
| 952 scoped_refptr<extensions::AppNotificationManager> app_notification_manager_; | 945 scoped_refptr<extensions::AppNotificationManager> app_notification_manager_; |
| 953 | 946 |
| 954 // Keeps track of favicon-sized omnibox icons for extensions. | |
| 955 ExtensionIconManager omnibox_icon_manager_; | |
| 956 ExtensionIconManager omnibox_popup_icon_manager_; | |
| 957 | |
| 958 // Flag to make sure event routers are only initialized once. | 947 // Flag to make sure event routers are only initialized once. |
| 959 bool event_routers_initialized_; | 948 bool event_routers_initialized_; |
| 960 | 949 |
| 961 // TODO(yoz): None of these should be owned by ExtensionService. | 950 // TODO(yoz): None of these should be owned by ExtensionService. |
| 962 // crbug.com/159265 | 951 // crbug.com/159265 |
| 963 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; | 952 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; |
| 964 | 953 |
| 965 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; | 954 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; |
| 966 | 955 |
| 967 scoped_ptr<extensions::WindowEventRouter> window_event_router_; | 956 scoped_ptr<extensions::WindowEventRouter> window_event_router_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 #endif | 1010 #endif |
| 1022 | 1011 |
| 1023 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1012 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 1024 InstallAppsWithUnlimtedStorage); | 1013 InstallAppsWithUnlimtedStorage); |
| 1025 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1014 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 1026 InstallAppsAndCheckStorageProtection); | 1015 InstallAppsAndCheckStorageProtection); |
| 1027 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 1016 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 1028 }; | 1017 }; |
| 1029 | 1018 |
| 1030 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 1019 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |