| 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_API_RUNTIME_RUNTIME_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 | 9 |
| 10 class Profile; | 10 class Profile; |
| 11 | 11 |
| 12 namespace extensions { | 12 namespace extensions { |
| 13 class Extension; | 13 class Extension; |
| 14 class ExtensionHost; | 14 class ExtensionHost; |
| 15 | 15 |
| 16 class RuntimeEventRouter { | 16 class RuntimeEventRouter { |
| 17 public: | 17 public: |
| 18 // Dispatches the onStartup event to all currently-loaded extensions. |
| 19 static void DispatchOnStartupEvent(Profile* profile, |
| 20 const std::string& extension_id); |
| 21 |
| 18 // Dispatches the onInstalled event to the given extension. | 22 // Dispatches the onInstalled event to the given extension. |
| 19 static void DispatchOnInstalledEvent(Profile* profile, | 23 static void DispatchOnInstalledEvent(Profile* profile, |
| 20 const std::string& extension_id); | 24 const std::string& extension_id); |
| 21 }; | 25 }; |
| 22 | 26 |
| 23 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction { | 27 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction { |
| 24 public: | 28 public: |
| 25 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage"); | 29 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage"); |
| 26 | 30 |
| 27 protected: | 31 protected: |
| 28 virtual ~RuntimeGetBackgroundPageFunction() {} | 32 virtual ~RuntimeGetBackgroundPageFunction() {} |
| 29 virtual bool RunImpl() OVERRIDE; | 33 virtual bool RunImpl() OVERRIDE; |
| 30 | 34 |
| 31 private: | 35 private: |
| 32 void OnPageLoaded(ExtensionHost*); | 36 void OnPageLoaded(ExtensionHost*); |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 } // namespace extensions | 39 } // namespace extensions |
| 36 | 40 |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ | 41 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ |
| OLD | NEW |