Index: chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc |
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc |
index 72cc78b5d4252c839e6bc2188bd28edd9424ecc3..1e3eb46cfb6b5b471a0a236c068a1e156f0a60a8 100644 |
--- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc |
+++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc |
@@ -11,6 +11,7 @@ |
#include "base/metrics/histogram.h" |
#include "base/time/time.h" |
#include "chrome/browser/extensions/extension_service.h" |
+#include "chrome/browser/extensions/extension_tab_util.h" |
#include "chrome/browser/extensions/updater/extension_updater.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser_finder.h" |
@@ -240,6 +241,15 @@ bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) { |
return false; |
} |
+bool ChromeRuntimeAPIDelegate::OpenOptionsPage(const Extension* extension) { |
+ Profile* profile = Profile::FromBrowserContext(browser_context_); |
+ Browser* browser = |
+ chrome::FindLastActiveWithProfile(profile, chrome::GetActiveDesktop()); |
+ if (!browser) |
+ return false; |
+ return extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser); |
+} |
+ |
void ChromeRuntimeAPIDelegate::Observe( |
int type, |
const content::NotificationSource& source, |