| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SecurityStateTabHelper::FromWebContents(contents); | 117 SecurityStateTabHelper::FromWebContents(contents); |
| 118 DCHECK(helper); | 118 DCHECK(helper); |
| 119 security_state::SecurityInfo security_info; | 119 security_state::SecurityInfo security_info; |
| 120 helper->GetSecurityInfo(&security_info); | 120 helper->GetSecurityInfo(&security_info); |
| 121 | 121 |
| 122 location_bar_->delegate()->ShowWebsiteSettings( | 122 location_bar_->delegate()->ShowWebsiteSettings( |
| 123 contents, entry->GetVirtualURL(), security_info); | 123 contents, entry->GetVirtualURL(), security_info); |
| 124 return true; | 124 return true; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void LocationIconView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 128 IconLabelBubbleView::GetAccessibleNodeData(node_data); |
| 129 node_data->role = ui::AX_ROLE_POP_UP_BUTTON; |
| 130 } |
| 131 |
| 127 gfx::Size LocationIconView::GetMinimumSizeForLabelText( | 132 gfx::Size LocationIconView::GetMinimumSizeForLabelText( |
| 128 const base::string16& text) const { | 133 const base::string16& text) const { |
| 129 views::Label label(text, font_list()); | 134 views::Label label(text, font_list()); |
| 130 return GetMinimumSizeForPreferredSize( | 135 return GetMinimumSizeForPreferredSize( |
| 131 GetSizeForLabelWidth(label.GetPreferredSize().width())); | 136 GetSizeForLabelWidth(label.GetPreferredSize().width())); |
| 132 } | 137 } |
| 133 | 138 |
| 134 void LocationIconView::SetSecurityState(bool should_show, bool should_animate) { | 139 void LocationIconView::SetSecurityState(bool should_show, bool should_animate) { |
| 135 if (!should_animate) { | 140 if (!should_animate) { |
| 136 animation_.Reset(should_show); | 141 animation_.Reset(should_show); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 165 return size; | 170 return size; |
| 166 } | 171 } |
| 167 | 172 |
| 168 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { | 173 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { |
| 169 // Do not show page info if the user has been editing the location bar or the | 174 // Do not show page info if the user has been editing the location bar or the |
| 170 // location bar is at the NTP. | 175 // location bar is at the NTP. |
| 171 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) | 176 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) |
| 172 return; | 177 return; |
| 173 ProcessLocatedEvent(event); | 178 ProcessLocatedEvent(event); |
| 174 } | 179 } |
| OLD | NEW |