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

Unified Diff: chrome/browser/ui/browser.cc

Issue 6259015: Change default logic for OpenApplicationTab for extensions without launch URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminated code-style-conflicting braces Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index c733bf1be8ffffef6abd272717722c6a206d8c45..fe5e5f7499ac5db77edf93b8bc39efedd5bf9e97 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -617,9 +617,17 @@ TabContents* Browser::OpenApplicationTab(Profile* profile,
if (launch_type == ExtensionPrefs::LAUNCH_PINNED)
add_type |= TabStripModel::ADD_PINNED;
+ // For extensions lacking launch urls, determine a reasonable fallback.
+ GURL extension_url = extension->GetFullLaunchURL();
+ if (!extension_url.is_valid()) {
+ extension_url = extension->options_url();
+ if (!extension_url.is_valid())
+ extension_url = GURL("chrome://extensions/");
Andrew T Wilson (Slow) 2011/01/22 01:32:14 You should use chrome::kChromeUIExtensionsURL here
The wrong rickcam account 2011/01/22 01:42:30 Done.
+ }
+
// TODO(erikkay): START_PAGE doesn't seem like the right transition in all
// cases.
- browser::NavigateParams params(browser, extension->GetFullLaunchURL(),
+ browser::NavigateParams params(browser, extension_url,
PageTransition::START_PAGE);
params.tabstrip_add_types = add_type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698