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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model.cc

Issue 8224023: Don't show URL for pending new navigations initiated by the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsBrowserInitiated helper. Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/toolbar_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autocomplete/autocomplete.h" 8 #include "chrome/browser/autocomplete/autocomplete.h"
9 #include "chrome/browser/autocomplete/autocomplete_edit.h" 9 #include "chrome/browser/autocomplete/autocomplete_edit.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // of view-source:chrome://newtab, which should display its URL despite what 70 // of view-source:chrome://newtab, which should display its URL despite what
71 // chrome://newtab's WebUI says. 71 // chrome://newtab's WebUI says.
72 NavigationController* controller = GetNavigationController(); 72 NavigationController* controller = GetNavigationController();
73 NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL; 73 NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL;
74 if (entry) { 74 if (entry) {
75 if (entry->IsViewSourceMode() || entry->page_type() == INTERSTITIAL_PAGE) 75 if (entry->IsViewSourceMode() || entry->page_type() == INTERSTITIAL_PAGE)
76 return true; 76 return true;
77 } 77 }
78 78
79 TabContents* tab_contents = browser_->GetSelectedTabContents(); 79 TabContents* tab_contents = browser_->GetSelectedTabContents();
80 if (tab_contents && tab_contents->web_ui()) 80 if (tab_contents && tab_contents->GetWebUIForCurrentState())
81 return !tab_contents->web_ui()->should_hide_url(); 81 return !tab_contents->GetWebUIForCurrentState()->should_hide_url();
82 82
83 if (entry && entry->url().SchemeIs(chrome::kExtensionScheme)) 83 if (entry && entry->url().SchemeIs(chrome::kExtensionScheme))
84 return false; 84 return false;
85 85
86 return true; 86 return true;
87 } 87 }
88 88
89 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { 89 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const {
90 if (input_in_progress_) // When editing, assume no security style. 90 if (input_in_progress_) // When editing, assume no security style.
91 return NONE; 91 return NONE;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 UTF8ToUTF16(cert.subject().country_name)); 163 UTF8ToUTF16(cert.subject().country_name));
164 } 164 }
165 165
166 NavigationController* ToolbarModel::GetNavigationController() const { 166 NavigationController* ToolbarModel::GetNavigationController() const {
167 // This |current_tab| can be NULL during the initialization of the 167 // This |current_tab| can be NULL during the initialization of the
168 // toolbar during window creation (i.e. before any tabs have been added 168 // toolbar during window creation (i.e. before any tabs have been added
169 // to the window). 169 // to the window).
170 TabContents* current_tab = browser_->GetSelectedTabContents(); 170 TabContents* current_tab = browser_->GetSelectedTabContents();
171 return current_tab ? &current_tab->controller() : NULL; 171 return current_tab ? &current_tab->controller() : NULL;
172 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698