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

Unified Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 7049004: Normalize chrome://foo/ trailing slashes, ChromeURLHostEquals comparison, RIP dead consts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace StartsWithASCII with scheme and host matching. Created 9 years, 7 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 | chrome/browser/tabs/tab_strip_model.cc » ('j') | chrome/common/url_constants.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_ui.cc
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index 783ccdc446a55f5f99aa0413da17876b4192a48a..ab6c353bba5547e1d19c409688204b97854a613e 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -69,9 +69,9 @@ void ShowAppInstalledAnimation(Browser* browser, const std::string& app_id) {
// Select an already open NTP, if there is one. Existing NTPs will
// automatically show the install animation for any new apps.
for (int i = 0; i < browser->tab_count(); ++i) {
- TabContents* tab_contents = browser->GetTabContentsAt(i);
- GURL url = tab_contents->GetURL();
- if (StartsWithASCII(url.spec(), chrome::kChromeUINewTabURL, false)) {
+ GURL url = browser->GetTabContentsAt(i)->GetURL();
+ if (url.SchemeIs(chrome::kChromeUIScheme) &&
+ LowerCaseEqualsASCII(url.host(), chrome::kChromeUINewTabHost)) {
browser->ActivateTabAt(i, false);
return;
}
@@ -79,7 +79,7 @@ void ShowAppInstalledAnimation(Browser* browser, const std::string& app_id) {
// If there isn't an NTP, open one and pass it the ID of the installed app.
std::string url = base::StringPrintf(
- "%s/#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str());
+ "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str());
browser->AddSelectedTabWithURL(GURL(url), PageTransition::TYPED);
}
« no previous file with comments | « no previous file | chrome/browser/tabs/tab_strip_model.cc » ('j') | chrome/common/url_constants.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698