Chromium Code Reviews| 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. |
|
Avi (use Gerrit)
2013/04/11 17:01:37
Oh, that's much clearer. Thanks.
|
| - // - 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,29 @@ |
| entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { |
| return true; |
| } |
| - } |
| - WebContents* web_contents = delegate_->GetActiveWebContents(); |
| - if (web_contents && web_contents->GetWebUIForCurrentState()) |
| - return !web_contents->GetWebUIForCurrentState()->ShouldHideURL(); |
| + const GURL& url = entry->GetURL(); |
| + if (url.SchemeIs(chrome::kChromeUIScheme) && |
| + (url.host() == chrome::kChromeUINewTabHost || |
| + url.host() == chrome::kChromeUIExtensionActivityHost)) { |
| + return false; |
| + } |
| - if (entry && entry->GetURL().SchemeIs(extensions::kExtensionScheme)) |
| - return false; |
| + if (entry->GetVirtualURL().SchemeIs(chrome::kChromeUIScheme) && |
| + entry->GetVirtualURL().host() == chrome::kChromeUIBookmarksHost) { |
| + return true; |
| + } |
| + 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; |