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

Side by Side Diff: components/toolbar/toolbar_model_impl.cc

Issue 2028933002: Fix color of looking glass when searching on remote NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/toolbar/toolbar_model_impl.h" 5 #include "components/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return delegate_->GetURL(&url) ? url : GURL(url::kAboutBlankURL); 91 return delegate_->GetURL(&url) ? url : GURL(url::kAboutBlankURL);
92 } 92 }
93 93
94 bool ToolbarModelImpl::WouldPerformSearchTermReplacement( 94 bool ToolbarModelImpl::WouldPerformSearchTermReplacement(
95 bool ignore_editing) const { 95 bool ignore_editing) const {
96 return !GetSearchTerms(ignore_editing).empty(); 96 return !GetSearchTerms(ignore_editing).empty();
97 } 97 }
98 98
99 SecurityStateModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel( 99 SecurityStateModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel(
100 bool ignore_editing) const { 100 bool ignore_editing) const {
101 // When editing, assume no security style. 101 // When editing or empty, assume no security style.
102 return (input_in_progress() && !ignore_editing) 102 return ((input_in_progress() && !ignore_editing) || !ShouldDisplayURL())
103 ? SecurityStateModel::NONE 103 ? SecurityStateModel::NONE
104 : delegate_->GetSecurityLevel(); 104 : delegate_->GetSecurityLevel();
105 } 105 }
106 106
107 int ToolbarModelImpl::GetIcon() const { 107 int ToolbarModelImpl::GetIcon() const {
108 switch (GetSecurityLevel(false)) { 108 switch (GetSecurityLevel(false)) {
109 case SecurityStateModel::NONE: 109 case SecurityStateModel::NONE:
110 return IDR_LOCATION_BAR_HTTP; 110 return IDR_LOCATION_BAR_HTTP;
111 case SecurityStateModel::EV_SECURE: 111 case SecurityStateModel::EV_SECURE:
112 case SecurityStateModel::SECURE: 112 case SecurityStateModel::SECURE:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 bool ToolbarModelImpl::ShouldDisplayURL() const { 166 bool ToolbarModelImpl::ShouldDisplayURL() const {
167 return delegate_->ShouldDisplayURL(); 167 return delegate_->ShouldDisplayURL();
168 } 168 }
169 169
170 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { 170 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const {
171 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing)) 171 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing))
172 return base::string16(); 172 return base::string16();
173 173
174 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing)); 174 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing));
175 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698