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

Side by Side Diff: chrome/browser/ui/views/toolbar/chevron_menu_button.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chevron_menu_button.h" 5 #include "chrome/browser/ui/views/toolbar/chevron_menu_button.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 size_t ChevronMenuButton::MenuController::IndexForId(int id) const { 355 size_t ChevronMenuButton::MenuController::IndexForId(int id) const {
356 // The index of the view being dragged (GetCommand gives a 1-based index into 356 // The index of the view being dragged (GetCommand gives a 1-based index into
357 // the overflow menu). 357 // the overflow menu).
358 DCHECK_GT(browser_actions_container_->VisibleBrowserActions() + id, 0u); 358 DCHECK_GT(browser_actions_container_->VisibleBrowserActions() + id, 0u);
359 return browser_actions_container_->VisibleBrowserActions() + id - 1; 359 return browser_actions_container_->VisibleBrowserActions() + id - 1;
360 } 360 }
361 361
362 ChevronMenuButton::ChevronMenuButton( 362 ChevronMenuButton::ChevronMenuButton(
363 BrowserActionsContainer* browser_actions_container) 363 BrowserActionsContainer* browser_actions_container)
364 : views::MenuButton(NULL, base::string16(), this, false), 364 : views::MenuButton(base::string16(), this, false),
365 browser_actions_container_(browser_actions_container), 365 browser_actions_container_(browser_actions_container),
366 weak_factory_(this) { 366 weak_factory_(this) {
367 // Set the border explicitly, because otherwise the native theme manager takes 367 // Set the border explicitly, because otherwise the native theme manager takes
368 // over and reassigns the insets we set in CreateDefaultBorder(). 368 // over and reassigns the insets we set in CreateDefaultBorder().
369 SetBorder(CreateDefaultBorder()); 369 SetBorder(CreateDefaultBorder());
370 } 370 }
371 371
372 ChevronMenuButton::~ChevronMenuButton() { 372 ChevronMenuButton::~ChevronMenuButton() {
373 } 373 }
374 374
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // We should never try to show an overflow menu when one is already visible. 440 // We should never try to show an overflow menu when one is already visible.
441 DCHECK(!menu_controller_); 441 DCHECK(!menu_controller_);
442 menu_controller_.reset(new MenuController( 442 menu_controller_.reset(new MenuController(
443 this, browser_actions_container_, for_drop)); 443 this, browser_actions_container_, for_drop));
444 menu_controller_->RunMenu(GetWidget()); 444 menu_controller_->RunMenu(GetWidget());
445 } 445 }
446 446
447 void ChevronMenuButton::MenuDone() { 447 void ChevronMenuButton::MenuDone() {
448 menu_controller_.reset(); 448 menu_controller_.reset();
449 } 449 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698