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