| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bar_control_button.h" | 5 #include "chrome/browser/ui/views/bar_control_button.h" |
| 6 | 6 |
| 7 #include "ui/gfx/color_utils.h" | 7 #include "ui/gfx/color_utils.h" |
| 8 #include "ui/gfx/paint_vector_icon.h" | 8 #include "ui/gfx/paint_vector_icon.h" |
| 9 #include "ui/gfx/vector_icons_public.h" | 9 #include "ui/gfx/vector_icons_public.h" |
| 10 #include "ui/views/animation/button_ink_drop_delegate.h" | 10 #include "ui/views/animation/button_ink_drop_delegate.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 layer()->Add(ink_drop_layer); | 69 layer()->Add(ink_drop_layer); |
| 70 layer()->StackAtBottom(ink_drop_layer); | 70 layer()->StackAtBottom(ink_drop_layer); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 73 void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
| 74 layer()->Remove(ink_drop_layer); | 74 layer()->Remove(ink_drop_layer); |
| 75 SetFillsBoundsOpaquely(true); | 75 SetFillsBoundsOpaquely(true); |
| 76 SetPaintToLayer(false); | 76 SetPaintToLayer(false); |
| 77 } | 77 } |
| 78 | 78 |
| 79 gfx::Point BarControlButton::CalculateInkDropCenter() const { | |
| 80 return GetLocalBounds().CenterPoint(); | |
| 81 } | |
| 82 | |
| 83 bool BarControlButton::OnMousePressed(const ui::MouseEvent& event) { | 79 bool BarControlButton::OnMousePressed(const ui::MouseEvent& event) { |
| 84 if (IsTriggerableEvent(event)) | 80 if (IsTriggerableEvent(event)) |
| 85 ink_drop_delegate()->OnAction(views::InkDropState::ACTION_PENDING); | 81 ink_drop_delegate()->OnAction(views::InkDropState::ACTION_PENDING); |
| 86 | 82 |
| 87 return ImageButton::OnMousePressed(event); | 83 return ImageButton::OnMousePressed(event); |
| 88 } | 84 } |
| OLD | NEW |