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

Unified Diff: chrome/browser/extensions/extension_tab_util.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/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 400922144ec68b409456100a7023afd5e221623b..d5feb70183a271e5aec92d7e595b1deb81a163d8 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -575,9 +575,10 @@ WindowController* ExtensionTabUtil::GetWindowControllerOfTab(
return NULL;
}
-void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
+bool ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
Browser* browser) {
- DCHECK(OptionsPageInfo::HasOptionsPage(extension));
+ if (!OptionsPageInfo::HasOptionsPage(extension))
+ return false;
// Force the options page to open in non-OTR window, because it won't be
// able to save settings from OTR.
@@ -617,6 +618,8 @@ void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
browser->tab_strip_model()->GetActiveWebContents();
web_contents->GetDelegate()->ActivateContents(web_contents);
}
+
+ return true;
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698