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

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

Issue 14080004: Remove some chrome-specific methods from content::WebUI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments and fix null check Created 7 years, 8 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 | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/webui/extensions/extension_activity_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/webui/extensions/extension_activity_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698