OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/views/location_bar/location_icon_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
6 | 6 |
7 #include "chrome/browser/ssl/security_state_tab_helper.h" | 7 #include "chrome/browser/ssl/security_state_tab_helper.h" |
8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
10 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" | 10 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 node_data->role = ui::AX_ROLE_POP_UP_BUTTON; | 129 node_data->role = ui::AX_ROLE_POP_UP_BUTTON; |
130 } | 130 } |
131 | 131 |
132 gfx::Size LocationIconView::GetMinimumSizeForLabelText( | 132 gfx::Size LocationIconView::GetMinimumSizeForLabelText( |
133 const base::string16& text) const { | 133 const base::string16& text) const { |
134 views::Label label(text, font_list()); | 134 views::Label label(text, font_list()); |
135 return GetMinimumSizeForPreferredSize( | 135 return GetMinimumSizeForPreferredSize( |
136 GetSizeForLabelWidth(label.GetPreferredSize().width())); | 136 GetSizeForLabelWidth(label.GetPreferredSize().width())); |
137 } | 137 } |
138 | 138 |
139 void LocationIconView::SetSecurityState(bool should_show, bool should_animate) { | 139 void LocationIconView::SetTextVisibility(bool should_show, |
| 140 bool should_animate) { |
140 if (!should_animate) { | 141 if (!should_animate) { |
141 animation_.Reset(should_show); | 142 animation_.Reset(should_show); |
142 } else if (should_show) { | 143 } else if (should_show) { |
143 animation_.Show(); | 144 animation_.Show(); |
144 } else { | 145 } else { |
145 animation_.Hide(); | 146 animation_.Hide(); |
146 } | 147 } |
147 // The label text color may have changed. | 148 // The label text color may have changed. |
148 OnNativeThemeChanged(GetNativeTheme()); | 149 OnNativeThemeChanged(GetNativeTheme()); |
149 } | 150 } |
(...skipping 20 matching lines...) Expand all Loading... |
170 return size; | 171 return size; |
171 } | 172 } |
172 | 173 |
173 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { | 174 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { |
174 // Do not show page info if the user has been editing the location bar or the | 175 // Do not show page info if the user has been editing the location bar or the |
175 // location bar is at the NTP. | 176 // location bar is at the NTP. |
176 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) | 177 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) |
177 return; | 178 return; |
178 ProcessLocatedEvent(event); | 179 ProcessLocatedEvent(event); |
179 } | 180 } |
OLD | NEW |