| 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/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 9 #include "chrome/browser/ui/views/page_info/website_settings_popup_view.h" | 9 #include "chrome/browser/ui/views/page_info/website_settings_popup_view.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return true; | 105 return true; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void LocationIconView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 108 void LocationIconView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 109 IconLabelBubbleView::GetAccessibleNodeData(node_data); | 109 IconLabelBubbleView::GetAccessibleNodeData(node_data); |
| 110 node_data->role = ui::AX_ROLE_POP_UP_BUTTON; | 110 node_data->role = ui::AX_ROLE_POP_UP_BUTTON; |
| 111 } | 111 } |
| 112 | 112 |
| 113 gfx::Size LocationIconView::GetMinimumSizeForLabelText( | 113 gfx::Size LocationIconView::GetMinimumSizeForLabelText( |
| 114 const base::string16& text) const { | 114 const base::string16& text) const { |
| 115 views::Label label(text, font_list()); | 115 views::Label label(text, {font_list()}); |
| 116 return GetMinimumSizeForPreferredSize( | 116 return GetMinimumSizeForPreferredSize( |
| 117 GetSizeForLabelWidth(label.GetPreferredSize().width())); | 117 GetSizeForLabelWidth(label.GetPreferredSize().width())); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void LocationIconView::SetTextVisibility(bool should_show, | 120 void LocationIconView::SetTextVisibility(bool should_show, |
| 121 bool should_animate) { | 121 bool should_animate) { |
| 122 if (!should_animate) { | 122 if (!should_animate) { |
| 123 animation_.Reset(should_show); | 123 animation_.Reset(should_show); |
| 124 } else if (should_show) { | 124 } else if (should_show) { |
| 125 animation_.Show(); | 125 animation_.Show(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 152 return size; | 152 return size; |
| 153 } | 153 } |
| 154 | 154 |
| 155 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { | 155 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { |
| 156 // Do not show page info if the user has been editing the location bar or the | 156 // Do not show page info if the user has been editing the location bar or the |
| 157 // location bar is at the NTP. | 157 // location bar is at the NTP. |
| 158 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) | 158 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) |
| 159 return; | 159 return; |
| 160 ProcessLocatedEvent(event); | 160 ProcessLocatedEvent(event); |
| 161 } | 161 } |
| OLD | NEW |