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