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

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

Issue 12463042: Shows chrome-extension urls and greys out the whole url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation does not depend on having a host and fixed nits. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_impl.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (entry && entry->GetURL().SchemeIs(chrome::kDriveScheme)) 172 if (entry && entry->GetURL().SchemeIs(chrome::kDriveScheme))
173 return false; 173 return false;
174 #endif 174 #endif
175 175
176 if (chrome::IsInstantNTP(web_contents)) 176 if (chrome::IsInstantNTP(web_contents))
177 return false; 177 return false;
178 178
179 return true; 179 return true;
180 } 180 }
181 181
182 bool ToolbarModelImpl::ShouldGreyOutURL() const {
183 WebContents* web_contents = delegate_->GetActiveWebContents();
184 return web_contents && web_contents->GetWebUIForCurrentState() &&
185 web_contents->GetWebUIForCurrentState()->ShouldGreyOutURL();
Peter Kasting 2013/04/04 21:07:05 Nit: Indent 4, not even
Patrick Riordan 2013/04/10 02:00:24 Done.
186 }
187
182 ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel() const { 188 ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel() const {
183 if (input_in_progress_) // When editing, assume no security style. 189 if (input_in_progress_) // When editing, assume no security style.
184 return NONE; 190 return NONE;
185 191
186 return GetSecurityLevelForWebContents(delegate_->GetActiveWebContents()); 192 return GetSecurityLevelForWebContents(delegate_->GetActiveWebContents());
187 } 193 }
188 194
189 int ToolbarModelImpl::GetIcon() const { 195 int ToolbarModelImpl::GetIcon() const {
190 if (WouldReplaceSearchURLWithSearchTerms()) 196 if (WouldReplaceSearchURLWithSearchTerms())
191 return IDR_OMNIBOX_SEARCH; 197 return IDR_OMNIBOX_SEARCH;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 Profile* profile = 267 Profile* profile =
262 Profile::FromBrowserContext(contents->GetBrowserContext()); 268 Profile::FromBrowserContext(contents->GetBrowserContext());
263 AutocompleteClassifierFactory::GetForProfile(profile)->Classify( 269 AutocompleteClassifierFactory::GetForProfile(profile)->Classify(
264 search_terms, false, false, &match, NULL); 270 search_terms, false, false, &match, NULL);
265 if (!AutocompleteMatch::IsSearchType(match.type)) 271 if (!AutocompleteMatch::IsSearchType(match.type))
266 search_terms.clear(); 272 search_terms.clear();
267 } 273 }
268 274
269 return search_terms; 275 return search_terms;
270 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698