Chromium Code Reviews| 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 class Version; | 11 class Version; |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 class Extension; | 14 class Extension; |
| 15 class ExtensionHost; | 15 class ExtensionHost; |
| 16 | 16 |
| 17 class RuntimeEventRouter { | 17 class RuntimeEventRouter { |
| 18 public: | 18 public: |
| 19 // Dispatches the onStartup event to all currently-loaded extensions. | 19 // Dispatches the onStartup event to all currently-loaded extensions. |
| 20 static void DispatchOnStartupEvent(Profile* profile, | 20 static void DispatchOnStartupEvent(Profile* profile, |
| 21 const std::string& extension_id); | 21 const std::string& extension_id); |
| 22 | 22 |
| 23 // Dispatches the onInstalled event to the given extension. | 23 // Dispatches the onInstalled event to the given extension. |
| 24 static void DispatchOnInstalledEvent(Profile* profile, | 24 static void DispatchOnInstalledEvent(Profile* profile, |
| 25 const std::string& extension_id, | 25 const std::string& extension_id, |
| 26 const Version& old_version); | 26 const Version& old_version, |
| 27 bool chrome_updated); | |
|
Aaron Boodman
2012/09/18 00:19:03
Is it possible to send old Chrome version as well?
Matt Perry
2012/09/18 00:57:03
I thought about it, but decided against it, becaus
| |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction { | 30 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction { |
| 30 public: | 31 public: |
| 31 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage"); | 32 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage"); |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 virtual ~RuntimeGetBackgroundPageFunction() {} | 35 virtual ~RuntimeGetBackgroundPageFunction() {} |
| 35 virtual bool RunImpl() OVERRIDE; | 36 virtual bool RunImpl() OVERRIDE; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 void OnPageLoaded(ExtensionHost*); | 39 void OnPageLoaded(ExtensionHost*); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace extensions | 42 } // namespace extensions |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ | 44 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ |
| OLD | NEW |