| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const std::string& extension_id); | 122 const std::string& extension_id); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 class RuntimeGetBackgroundPageFunction : public ChromeAsyncExtensionFunction { | 125 class RuntimeGetBackgroundPageFunction : public ChromeAsyncExtensionFunction { |
| 126 public: | 126 public: |
| 127 DECLARE_EXTENSION_FUNCTION("runtime.getBackgroundPage", | 127 DECLARE_EXTENSION_FUNCTION("runtime.getBackgroundPage", |
| 128 RUNTIME_GETBACKGROUNDPAGE) | 128 RUNTIME_GETBACKGROUNDPAGE) |
| 129 | 129 |
| 130 protected: | 130 protected: |
| 131 virtual ~RuntimeGetBackgroundPageFunction() {} | 131 virtual ~RuntimeGetBackgroundPageFunction() {} |
| 132 virtual bool RunImpl() OVERRIDE; | 132 virtual bool RunAsync() OVERRIDE; |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 void OnPageLoaded(ExtensionHost*); | 135 void OnPageLoaded(ExtensionHost*); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 class RuntimeSetUninstallURLFunction : public ChromeSyncExtensionFunction { | 138 class RuntimeSetUninstallURLFunction : public ChromeSyncExtensionFunction { |
| 139 public: | 139 public: |
| 140 DECLARE_EXTENSION_FUNCTION("runtime.setUninstallURL", | 140 DECLARE_EXTENSION_FUNCTION("runtime.setUninstallURL", |
| 141 RUNTIME_SETUNINSTALLURL) | 141 RUNTIME_SETUNINSTALLURL) |
| 142 | 142 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 156 | 156 |
| 157 class RuntimeRequestUpdateCheckFunction : public ChromeAsyncExtensionFunction, | 157 class RuntimeRequestUpdateCheckFunction : public ChromeAsyncExtensionFunction, |
| 158 public content::NotificationObserver { | 158 public content::NotificationObserver { |
| 159 public: | 159 public: |
| 160 DECLARE_EXTENSION_FUNCTION("runtime.requestUpdateCheck", | 160 DECLARE_EXTENSION_FUNCTION("runtime.requestUpdateCheck", |
| 161 RUNTIME_REQUESTUPDATECHECK) | 161 RUNTIME_REQUESTUPDATECHECK) |
| 162 | 162 |
| 163 RuntimeRequestUpdateCheckFunction(); | 163 RuntimeRequestUpdateCheckFunction(); |
| 164 protected: | 164 protected: |
| 165 virtual ~RuntimeRequestUpdateCheckFunction() {} | 165 virtual ~RuntimeRequestUpdateCheckFunction() {} |
| 166 virtual bool RunImpl() OVERRIDE; | 166 virtual bool RunAsync() OVERRIDE; |
| 167 | 167 |
| 168 // Implements content::NotificationObserver interface. | 168 // Implements content::NotificationObserver interface. |
| 169 virtual void Observe(int type, | 169 virtual void Observe(int type, |
| 170 const content::NotificationSource& source, | 170 const content::NotificationSource& source, |
| 171 const content::NotificationDetails& details) OVERRIDE; | 171 const content::NotificationDetails& details) OVERRIDE; |
| 172 private: | 172 private: |
| 173 void CheckComplete(); | 173 void CheckComplete(); |
| 174 void ReplyUpdateFound(const std::string& version); | 174 void ReplyUpdateFound(const std::string& version); |
| 175 | 175 |
| 176 content::NotificationRegistrar registrar_; | 176 content::NotificationRegistrar registrar_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 202 RUNTIME_GETPACKAGEDIRECTORYENTRY) | 202 RUNTIME_GETPACKAGEDIRECTORYENTRY) |
| 203 | 203 |
| 204 protected: | 204 protected: |
| 205 virtual ~RuntimeGetPackageDirectoryEntryFunction() {} | 205 virtual ~RuntimeGetPackageDirectoryEntryFunction() {} |
| 206 virtual bool RunSync() OVERRIDE; | 206 virtual bool RunSync() OVERRIDE; |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 } // namespace extensions | 209 } // namespace extensions |
| 210 | 210 |
| 211 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ | 211 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ |
| OLD | NEW |