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

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: 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
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,12 @@
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
+ // can be NTPs that have extension schemes (e.g. the bookmark manager). In
Avi (use Gerrit) 2013/04/10 23:12:15 "NTPs that have extension schemes"? I'm not sure a
jam 2013/04/10 23:45:35 updated comment
+ // that case, we should prefer what the NTP instance says.
+ // - 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,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;

Powered by Google App Engine
This is Rietveld 408576698