Index: extensions/browser/api/runtime/runtime_api.cc |
diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc |
index 51e8ec9bcf771dfcd5fe4e89eeaa52edff2d2108..6f0716a24898d75fd40acbcb7f1140512047f5d0 100644 |
--- a/extensions/browser/api/runtime/runtime_api.cc |
+++ b/extensions/browser/api/runtime/runtime_api.cc |
@@ -46,6 +46,7 @@ namespace { |
const char kNoBackgroundPageError[] = "You do not have a background page."; |
const char kPageLoadError[] = "Background page failed to load."; |
+const char kFailedToCreateOptionsPage[] = "Could not create an options page."; |
const char kInstallId[] = "id"; |
const char kInstallReason[] = "reason"; |
const char kInstallReasonChromeUpdate[] = "chrome_update"; |
@@ -268,6 +269,10 @@ bool RuntimeAPI::RestartDevice(std::string* error_message) { |
return delegate_->RestartDevice(error_message); |
} |
+bool RuntimeAPI::OpenOptionsPage(const Extension* extension) { |
+ return delegate_->OpenOptionsPage(extension); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
// static |
@@ -425,6 +430,13 @@ void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost* host) { |
} |
} |
+ExtensionFunction::ResponseAction RuntimeOpenOptionsPageFunction::Run() { |
+ RuntimeAPI* api = RuntimeAPI::GetFactoryInstance()->Get(browser_context()); |
+ return RespondNow(api->OpenOptionsPage(extension()) |
+ ? NoArguments() |
+ : Error(kFailedToCreateOptionsPage)); |
+} |
+ |
ExtensionFunction::ResponseAction RuntimeSetUninstallURLFunction::Run() { |
std::string url_string; |
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url_string)); |