| 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/layout_constants.h" | 8 #include "chrome/browser/ui/layout_constants.h" |
| 9 #include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h" | 9 #include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h" |
| 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 11 #include "ui/accessibility/ax_node_data.h" | 11 #include "ui/accessibility/ax_node_data.h" |
| 12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
| 13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
| 14 #include "ui/gfx/paint_vector_icon.h" | 14 #include "ui/gfx/paint_vector_icon.h" |
| 15 #include "ui/native_theme/native_theme.h" | 15 #include "ui/native_theme/native_theme.h" |
| 16 #include "ui/views/animation/ink_drop_highlight.h" | 16 #include "ui/views/animation/ink_drop_highlight.h" |
| 17 #include "ui/views/animation/ink_drop_impl.h" | 17 #include "ui/views/animation/ink_drop_impl.h" |
| 18 #include "ui/views/bubble/bubble_dialog_delegate.h" | 18 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 19 | 19 |
| 20 void BubbleIconView::Init() { | 20 void BubbleIconView::Init() { |
| 21 AddChildView(image_); | 21 AddChildView(image_); |
| 22 image_->set_interactive(false); | 22 image_->set_can_process_events_within_subtree(false); |
| 23 image_->EnableCanvasFlippingForRTLUI(true); | 23 image_->EnableCanvasFlippingForRTLUI(true); |
| 24 SetInkDropMode(InkDropMode::ON); | 24 SetInkDropMode(InkDropMode::ON); |
| 25 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); | 25 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 26 } | 26 } |
| 27 | 27 |
| 28 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) | 28 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) |
| 29 : image_(new views::ImageView()), | 29 : image_(new views::ImageView()), |
| 30 command_updater_(command_updater), | 30 command_updater_(command_updater), |
| 31 command_id_(command_id), | 31 command_id_(command_id), |
| 32 active_(false), | 32 active_(false), |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 image_->SetImage(gfx::CreateVectorIcon( | 203 image_->SetImage(gfx::CreateVectorIcon( |
| 204 GetVectorIcon(), LocationBarView::kIconWidth, icon_color)); | 204 GetVectorIcon(), LocationBarView::kIconWidth, icon_color)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void BubbleIconView::SetActiveInternal(bool active) { | 207 void BubbleIconView::SetActiveInternal(bool active) { |
| 208 if (active_ == active) | 208 if (active_ == active) |
| 209 return; | 209 return; |
| 210 active_ = active; | 210 active_ = active; |
| 211 UpdateIcon(); | 211 UpdateIcon(); |
| 212 } | 212 } |
| OLD | NEW |