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/toolbar/toolbar_action_view.cc

Issue 1682603002: [UI Views] Don't allow a ButtonListener and a MenuButtonListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 10 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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 nullptr; 46 nullptr;
47 47
48 } // namespace 48 } // namespace
49 49
50 //////////////////////////////////////////////////////////////////////////////// 50 ////////////////////////////////////////////////////////////////////////////////
51 // ToolbarActionView 51 // ToolbarActionView
52 52
53 ToolbarActionView::ToolbarActionView( 53 ToolbarActionView::ToolbarActionView(
54 ToolbarActionViewController* view_controller, 54 ToolbarActionViewController* view_controller,
55 ToolbarActionView::Delegate* delegate) 55 ToolbarActionView::Delegate* delegate)
56 : MenuButton(nullptr, base::string16(), this, false), 56 : MenuButton(base::string16(), this, false),
57 view_controller_(view_controller), 57 view_controller_(view_controller),
58 delegate_(delegate), 58 delegate_(delegate),
59 called_register_command_(false), 59 called_register_command_(false),
60 wants_to_run_(false), 60 wants_to_run_(false),
61 menu_(nullptr), 61 menu_(nullptr),
62 ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)), 62 ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)),
63 weak_factory_(this) { 63 weak_factory_(this) {
64 set_ink_drop_delegate(ink_drop_delegate_.get()); 64 set_ink_drop_delegate(ink_drop_delegate_.get());
65 set_has_ink_drop_action_on_click(true); 65 set_has_ink_drop_action_on_click(true);
66 set_id(VIEW_ID_BROWSER_ACTION); 66 set_id(VIEW_ID_BROWSER_ACTION);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (menu_controller->in_nested_run()) { 330 if (menu_controller->in_nested_run()) {
331 // There is another menu showing. Close the outermost menu (since we are 331 // There is another menu showing. Close the outermost menu (since we are
332 // shown in the same menu, we don't want to close the whole thing). 332 // shown in the same menu, we don't want to close the whole thing).
333 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); 333 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST);
334 return true; 334 return true;
335 } 335 }
336 } 336 }
337 337
338 return false; 338 return false;
339 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698