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) |
| @@ -146,12 +146,11 @@ |
| bool ToolbarModelImpl::ShouldDisplayURL() const { |
| // Note: The order here is important. |
| - // - 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 NTP test must come before the extension scheme test because there |
| + // extensions can implement the NTP. |
|
Avi (use Gerrit)
2013/04/11 00:51:19
"because extensions can implement the NTP"? Drop t
|
| + // - 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 +158,23 @@ |
| entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { |
| return true; |
| } |
| - } |
| - WebContents* web_contents = delegate_->GetActiveWebContents(); |
| - if (web_contents && web_contents->GetWebUIForCurrentState()) |
| - return !web_contents->GetWebUIForCurrentState()->ShouldHideURL(); |
| + if (entry->GetURL().SchemeIs(chrome::kChromeUIScheme) && |
| + (entry->GetURL().host() == chrome::kChromeUINewTabHost || |
| + entry->GetURL().host() == chrome::kChromeUIExtensionActivityHost)) { |
| + return false; |
| + } |
| - if (entry && entry->GetURL().SchemeIs(extensions::kExtensionScheme)) |
| - return false; |
| + if (entry->GetURL().SchemeIs(extensions::kExtensionScheme)) |
| + return false; |
| #if defined(OS_CHROMEOS) |
| - if (entry && entry->GetURL().SchemeIs(chrome::kDriveScheme)) |
| - return false; |
| + if (entry->GetURL().SchemeIs(chrome::kDriveScheme)) |
| + return false; |
| #endif |
| + } |
| - if (chrome::IsInstantNTP(web_contents)) |
| + if (chrome::IsInstantNTP(delegate_->GetActiveWebContents())) |
| return false; |
| return true; |