| Index: chrome/browser/ui/toolbar/toolbar_model_impl.cc
|
| ===================================================================
|
| --- chrome/browser/ui/toolbar/toolbar_model_impl.cc (revision 193436)
|
| +++ chrome/browser/ui/toolbar/toolbar_model_impl.cc (working copy)
|
| @@ -149,9 +149,9 @@
|
| // - The WebUI test must come before the extension scheme test because there
|
| // can be WebUIs that have extension schemes (e.g. the bookmark manager). In
|
| // that case, we should prefer what the WebUI instance says.
|
| - // - The view-source test must come before the WebUI test because of the case
|
| + // - The view-source test must come before the NTP test because of the case
|
| // of view-source:chrome://newtab, which should display its URL despite what
|
| - // chrome://newtab's WebUI says.
|
| + // chrome://newtab says.
|
| NavigationController* controller = GetNavigationController();
|
| NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL;
|
| if (entry) {
|
| @@ -159,21 +159,26 @@
|
| entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) {
|
| return true;
|
| }
|
| - }
|
|
|
| - WebContents* web_contents = delegate_->GetActiveWebContents();
|
| - if (web_contents && web_contents->GetWebUIForCurrentState())
|
| - return !web_contents->GetWebUIForCurrentState()->ShouldHideURL();
|
| + GURL url = entry->GetURL();
|
| + GURL virtual_url = entry->GetVirtualURL();
|
| + if (url.SchemeIs(chrome::kChromeUIScheme) ||
|
| + virtual_url.SchemeIs(chrome::kChromeUIScheme)) {
|
| + if (!url.SchemeIs(chrome::kChromeUIScheme))
|
| + url = virtual_url;
|
| + return url.host() != chrome::kChromeUINewTabHost;
|
| + }
|
|
|
| - if (entry && entry->GetURL().SchemeIs(extensions::kExtensionScheme))
|
| - return false;
|
| + if (url.SchemeIs(extensions::kExtensionScheme))
|
| + return false;
|
|
|
| #if defined(OS_CHROMEOS)
|
| - if (entry && entry->GetURL().SchemeIs(chrome::kDriveScheme))
|
| - return false;
|
| + if (url.SchemeIs(chrome::kDriveScheme))
|
| + return false;
|
| #endif
|
| + }
|
|
|
| - if (chrome::IsInstantNTP(web_contents))
|
| + if (chrome::IsInstantNTP(delegate_->GetActiveWebContents()))
|
| return false;
|
|
|
| return true;
|
|
|