Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc

Issue 936123002: [Extensions] Implement chrome.runtime.openOptionsPage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: default impl Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
« no previous file with comments | « chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h ('k') | chrome/browser/extensions/extension_tab_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698