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_action_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ToolbarActionViewController* view_controller, | 56 ToolbarActionViewController* view_controller, |
57 ToolbarActionView::Delegate* delegate) | 57 ToolbarActionView::Delegate* delegate) |
58 : MenuButton(base::string16(), this, false), | 58 : MenuButton(base::string16(), this, false), |
59 view_controller_(view_controller), | 59 view_controller_(view_controller), |
60 delegate_(delegate), | 60 delegate_(delegate), |
61 called_register_command_(false), | 61 called_register_command_(false), |
62 wants_to_run_(false), | 62 wants_to_run_(false), |
63 menu_(nullptr), | 63 menu_(nullptr), |
64 weak_factory_(this) { | 64 weak_factory_(this) { |
65 if (ui::MaterialDesignController::IsModeMaterial()) { | 65 if (ui::MaterialDesignController::IsModeMaterial()) { |
66 SetHasInkDrop(true); | 66 SetInkDropMode(INK_DROP_WITH_GESTURE_HANDLING); |
67 SetFocusPainter(nullptr); | 67 SetFocusPainter(nullptr); |
68 } | 68 } |
69 set_has_ink_drop_action_on_click(true); | 69 set_has_ink_drop_action_on_click(true); |
70 set_id(VIEW_ID_BROWSER_ACTION); | 70 set_id(VIEW_ID_BROWSER_ACTION); |
71 view_controller_->SetDelegate(this); | 71 view_controller_->SetDelegate(this); |
72 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 72 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
73 set_drag_controller(delegate_); | 73 set_drag_controller(delegate_); |
74 | 74 |
75 set_context_menu_controller(this); | 75 set_context_menu_controller(this); |
76 | 76 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (menu_controller->in_nested_run()) { | 322 if (menu_controller->in_nested_run()) { |
323 // There is another menu showing. Close the outermost menu (since we are | 323 // There is another menu showing. Close the outermost menu (since we are |
324 // shown in the same menu, we don't want to close the whole thing). | 324 // shown in the same menu, we don't want to close the whole thing). |
325 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 325 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
326 return true; | 326 return true; |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 return false; | 330 return false; |
331 } | 331 } |
OLD | NEW |