| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 ToolbarButton::ToolbarButton(Profile* profile, | 31 ToolbarButton::ToolbarButton(Profile* profile, |
| 32 views::ButtonListener* listener, | 32 views::ButtonListener* listener, |
| 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 SetHasInkDrop(true); | |
| 41 set_has_ink_drop_action_on_click(true); | 40 set_has_ink_drop_action_on_click(true); |
| 42 set_context_menu_controller(this); | 41 set_context_menu_controller(this); |
| 43 if (ui::MaterialDesignController::IsModeMaterial()) | 42 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 43 SetHasInkDrop(true); |
| 44 SetFocusPainter(nullptr); | 44 SetFocusPainter(nullptr); |
| 45 } |
| 45 } | 46 } |
| 46 | 47 |
| 47 ToolbarButton::~ToolbarButton() {} | 48 ToolbarButton::~ToolbarButton() {} |
| 48 | 49 |
| 49 void ToolbarButton::Init() { | 50 void ToolbarButton::Init() { |
| 50 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); | 51 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 51 image()->EnableCanvasFlippingForRTLUI(true); | 52 image()->EnableCanvasFlippingForRTLUI(true); |
| 52 } | 53 } |
| 53 | 54 |
| 54 void ToolbarButton::ClearPendingMenu() { | 55 void ToolbarButton::ClearPendingMenu() { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 if (state() != STATE_DISABLED) | 254 if (state() != STATE_DISABLED) |
| 254 SetState(STATE_NORMAL); | 255 SetState(STATE_NORMAL); |
| 255 | 256 |
| 256 menu_runner_.reset(); | 257 menu_runner_.reset(); |
| 257 menu_model_adapter_.reset(); | 258 menu_model_adapter_.reset(); |
| 258 } | 259 } |
| 259 | 260 |
| 260 const char* ToolbarButton::GetClassName() const { | 261 const char* ToolbarButton::GetClassName() const { |
| 261 return "ToolbarButton"; | 262 return "ToolbarButton"; |
| 262 } | 263 } |
| OLD | NEW |