Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/ui/views/bar_control_button.cc

Issue 1550443002: Pushed InkDropHost inheritence up to CustomButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed diff delta. Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698