| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bubble_icon_view.h" | 5 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/command_updater.h" | 7 #include "chrome/browser/command_updater.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 "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_node_data.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
| 12 #include "ui/gfx/paint_vector_icon.h" | 12 #include "ui/gfx/paint_vector_icon.h" |
| 13 #include "ui/native_theme/native_theme.h" | 13 #include "ui/native_theme/native_theme.h" |
| 14 #include "ui/views/animation/ink_drop_highlight.h" | 14 #include "ui/views/animation/ink_drop_highlight.h" |
| 15 #include "ui/views/bubble/bubble_dialog_delegate.h" | 15 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 16 | 16 |
| 17 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) | 17 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) |
| 18 : image_(new views::ImageView()), | 18 : image_(new views::ImageView()), |
| 19 command_updater_(command_updater), | 19 command_updater_(command_updater), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 const gfx::ImageSkia& BubbleIconView::GetImage() const { | 42 const gfx::ImageSkia& BubbleIconView::GetImage() const { |
| 43 return image_->GetImage(); | 43 return image_->GetImage(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void BubbleIconView::SetTooltipText(const base::string16& tooltip) { | 46 void BubbleIconView::SetTooltipText(const base::string16& tooltip) { |
| 47 image_->SetTooltipText(tooltip); | 47 image_->SetTooltipText(tooltip); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void BubbleIconView::GetAccessibleState(ui::AXViewState* state) { | 50 void BubbleIconView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 51 image_->GetAccessibleState(state); | 51 image_->GetAccessibleNodeData(node_data); |
| 52 state->role = ui::AX_ROLE_BUTTON; | 52 node_data->role = ui::AX_ROLE_BUTTON; |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool BubbleIconView::GetTooltipText(const gfx::Point& p, | 55 bool BubbleIconView::GetTooltipText(const gfx::Point& p, |
| 56 base::string16* tooltip) const { | 56 base::string16* tooltip) const { |
| 57 return !IsBubbleShowing() && image_->GetTooltipText(p, tooltip); | 57 return !IsBubbleShowing() && image_->GetTooltipText(p, tooltip); |
| 58 } | 58 } |
| 59 | 59 |
| 60 gfx::Size BubbleIconView::GetPreferredSize() const { | 60 gfx::Size BubbleIconView::GetPreferredSize() const { |
| 61 return image_->GetPreferredSize(); | 61 return image_->GetPreferredSize(); |
| 62 } | 62 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 image_->SetImage(gfx::CreateVectorIcon( | 194 image_->SetImage(gfx::CreateVectorIcon( |
| 195 GetVectorIcon(), LocationBarView::kIconWidth, icon_color)); | 195 GetVectorIcon(), LocationBarView::kIconWidth, icon_color)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void BubbleIconView::SetActiveInternal(bool active) { | 198 void BubbleIconView::SetActiveInternal(bool active) { |
| 199 if (active_ == active) | 199 if (active_ == active) |
| 200 return; | 200 return; |
| 201 active_ = active; | 201 active_ = active; |
| 202 UpdateIcon(); | 202 UpdateIcon(); |
| 203 } | 203 } |
| OLD | NEW |