| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_USER_SCRIPT_LOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LOADER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LOADER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Initiates procedure to start loading scripts on the file thread. | 73 // Initiates procedure to start loading scripts on the file thread. |
| 74 void StartLoad(); | 74 void StartLoad(); |
| 75 | 75 |
| 76 // Return true if we have any scripts ready. | 76 // Return true if we have any scripts ready. |
| 77 bool scripts_ready() const { return shared_memory_.get() != NULL; } | 77 bool scripts_ready() const { return shared_memory_.get() != NULL; } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 // content::NotificationObserver implementation. | 80 // content::NotificationObserver implementation. |
| 81 virtual void Observe(int type, | 81 virtual void Observe(int type, |
| 82 const content::NotificationSource& source, | 82 const content::NotificationSource& source, |
| 83 const content::NotificationDetails& details) OVERRIDE; | 83 const content::NotificationDetails& details) override; |
| 84 | 84 |
| 85 // ExtensionRegistryObserver implementation. | 85 // ExtensionRegistryObserver implementation. |
| 86 virtual void OnExtensionUnloaded( | 86 virtual void OnExtensionUnloaded( |
| 87 content::BrowserContext* browser_context, | 87 content::BrowserContext* browser_context, |
| 88 const Extension* extension, | 88 const Extension* extension, |
| 89 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 89 UnloadedExtensionInfo::Reason reason) override; |
| 90 | 90 |
| 91 // Initiates script load when we have been waiting for the extension system | 91 // Initiates script load when we have been waiting for the extension system |
| 92 // to be ready. | 92 // to be ready. |
| 93 void OnExtensionSystemReady(); | 93 void OnExtensionSystemReady(); |
| 94 | 94 |
| 95 // Returns whether or not it is possible that calls to AddScripts(), | 95 // Returns whether or not it is possible that calls to AddScripts(), |
| 96 // RemoveScripts(), and/or ClearScripts() have caused any real change in the | 96 // RemoveScripts(), and/or ClearScripts() have caused any real change in the |
| 97 // set of scripts to be loaded. | 97 // set of scripts to be loaded. |
| 98 bool ScriptsMayHaveChanged() const; | 98 bool ScriptsMayHaveChanged() const; |
| 99 | 99 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 extension_registry_observer_; | 172 extension_registry_observer_; |
| 173 | 173 |
| 174 base::WeakPtrFactory<UserScriptLoader> weak_factory_; | 174 base::WeakPtrFactory<UserScriptLoader> weak_factory_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(UserScriptLoader); | 176 DISALLOW_COPY_AND_ASSIGN(UserScriptLoader); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 } // namespace extensions | 179 } // namespace extensions |
| 180 | 180 |
| 181 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LOADER_H_ | 181 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LOADER_H_ |
| OLD | NEW |