| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ | 6 #define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void Observe(int type, | 57 void Observe(int type, |
| 58 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
| 59 const content::NotificationDetails& details) override; | 59 const content::NotificationDetails& details) override; |
| 60 | 60 |
| 61 void ReloadExtension(const std::string& extension_id); | 61 void ReloadExtension(const std::string& extension_id); |
| 62 bool CheckForUpdates(const std::string& extension_id, | 62 bool CheckForUpdates(const std::string& extension_id, |
| 63 const RuntimeAPIDelegate::UpdateCheckCallback& callback); | 63 const RuntimeAPIDelegate::UpdateCheckCallback& callback); |
| 64 void OpenURL(const GURL& uninstall_url); | 64 void OpenURL(const GURL& uninstall_url); |
| 65 bool GetPlatformInfo(core_api::runtime::PlatformInfo* info); | 65 bool GetPlatformInfo(core_api::runtime::PlatformInfo* info); |
| 66 bool RestartDevice(std::string* error_message); | 66 bool RestartDevice(std::string* error_message); |
| 67 bool OpenOptionsPage(const Extension* extension); |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 friend class BrowserContextKeyedAPIFactory<RuntimeAPI>; | 70 friend class BrowserContextKeyedAPIFactory<RuntimeAPI>; |
| 70 | 71 |
| 71 // ExtensionRegistryObserver implementation. | 72 // ExtensionRegistryObserver implementation. |
| 72 void OnExtensionLoaded(content::BrowserContext* browser_context, | 73 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 73 const Extension* extension) override; | 74 const Extension* extension) override; |
| 74 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, | 75 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, |
| 75 const Extension* extension, | 76 const Extension* extension, |
| 76 bool is_update, | 77 bool is_update, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 RUNTIME_GETBACKGROUNDPAGE) | 156 RUNTIME_GETBACKGROUNDPAGE) |
| 156 | 157 |
| 157 protected: | 158 protected: |
| 158 ~RuntimeGetBackgroundPageFunction() override {} | 159 ~RuntimeGetBackgroundPageFunction() override {} |
| 159 ResponseAction Run() override; | 160 ResponseAction Run() override; |
| 160 | 161 |
| 161 private: | 162 private: |
| 162 void OnPageLoaded(ExtensionHost*); | 163 void OnPageLoaded(ExtensionHost*); |
| 163 }; | 164 }; |
| 164 | 165 |
| 166 class RuntimeOpenOptionsPageFunction : public UIThreadExtensionFunction { |
| 167 public: |
| 168 DECLARE_EXTENSION_FUNCTION("runtime.openOptionsPage", RUNTIME_OPENOPTIONSPAGE) |
| 169 |
| 170 protected: |
| 171 ~RuntimeOpenOptionsPageFunction() override {} |
| 172 ResponseAction Run() override; |
| 173 }; |
| 174 |
| 165 class RuntimeSetUninstallURLFunction : public UIThreadExtensionFunction { | 175 class RuntimeSetUninstallURLFunction : public UIThreadExtensionFunction { |
| 166 public: | 176 public: |
| 167 DECLARE_EXTENSION_FUNCTION("runtime.setUninstallURL", RUNTIME_SETUNINSTALLURL) | 177 DECLARE_EXTENSION_FUNCTION("runtime.setUninstallURL", RUNTIME_SETUNINSTALLURL) |
| 168 | 178 |
| 169 protected: | 179 protected: |
| 170 ~RuntimeSetUninstallURLFunction() override {} | 180 ~RuntimeSetUninstallURLFunction() override {} |
| 171 ResponseAction Run() override; | 181 ResponseAction Run() override; |
| 172 }; | 182 }; |
| 173 | 183 |
| 174 class RuntimeReloadFunction : public UIThreadExtensionFunction { | 184 class RuntimeReloadFunction : public UIThreadExtensionFunction { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 RUNTIME_GETPACKAGEDIRECTORYENTRY) | 229 RUNTIME_GETPACKAGEDIRECTORYENTRY) |
| 220 | 230 |
| 221 protected: | 231 protected: |
| 222 ~RuntimeGetPackageDirectoryEntryFunction() override {} | 232 ~RuntimeGetPackageDirectoryEntryFunction() override {} |
| 223 ResponseAction Run() override; | 233 ResponseAction Run() override; |
| 224 }; | 234 }; |
| 225 | 235 |
| 226 } // namespace extensions | 236 } // namespace extensions |
| 227 | 237 |
| 228 #endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ | 238 #endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_H_ |
| OLD | NEW |