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/toolbar/toolbar_button.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 ui::MenuModel* model) | 33 ui::MenuModel* model) |
34 : views::LabelButton(listener, base::string16()), | 34 : views::LabelButton(listener, base::string16()), |
35 profile_(profile), | 35 profile_(profile), |
36 model_(model), | 36 model_(model), |
37 menu_showing_(false), | 37 menu_showing_(false), |
38 y_position_on_lbuttondown_(0), | 38 y_position_on_lbuttondown_(0), |
39 show_menu_factory_(this) { | 39 show_menu_factory_(this) { |
40 set_has_ink_drop_action_on_click(true); | 40 set_has_ink_drop_action_on_click(true); |
41 set_context_menu_controller(this); | 41 set_context_menu_controller(this); |
42 if (ui::MaterialDesignController::IsModeMaterial()) { | 42 if (ui::MaterialDesignController::IsModeMaterial()) { |
43 SetHasInkDrop(true); | 43 SetInkDropMode(InkDropMode::ON); |
44 SetFocusPainter(nullptr); | 44 SetFocusPainter(nullptr); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 ToolbarButton::~ToolbarButton() {} | 48 ToolbarButton::~ToolbarButton() {} |
49 | 49 |
50 void ToolbarButton::Init() { | 50 void ToolbarButton::Init() { |
51 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); | 51 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
52 image()->EnableCanvasFlippingForRTLUI(true); | 52 image()->EnableCanvasFlippingForRTLUI(true); |
53 } | 53 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (state() != STATE_DISABLED) | 254 if (state() != STATE_DISABLED) |
255 SetState(STATE_NORMAL); | 255 SetState(STATE_NORMAL); |
256 | 256 |
257 menu_runner_.reset(); | 257 menu_runner_.reset(); |
258 menu_model_adapter_.reset(); | 258 menu_model_adapter_.reset(); |
259 } | 259 } |
260 | 260 |
261 const char* ToolbarButton::GetClassName() const { | 261 const char* ToolbarButton::GetClassName() const { |
262 return "ToolbarButton"; | 262 return "ToolbarButton"; |
263 } | 263 } |
OLD | NEW |