Commit 7fc28bea authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Fix cpplint warnings and misspelling in menu_controller.cc

Change-Id: Ia674d6e5cae68b3a60f67f655ba6353e31be053a
Reviewed-on: https://chromium-review.googlesource.com/957475Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542888}
parent 03cec264
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include "ui/views/controls/menu/menu_controller.h" #include "ui/views/controls/menu/menu_controller.h"
#include <algorithm>
#include <utility>
#include "base/i18n/case_conversion.h" #include "base/i18n/case_conversion.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -164,7 +167,7 @@ View* GetNextFocusableView(View* ancestor, View* start_at, bool forward) { ...@@ -164,7 +167,7 @@ View* GetNextFocusableView(View* ancestor, View* start_at, bool forward) {
} }
#if defined(OS_WIN) || defined(OS_CHROMEOS) #if defined(OS_WIN) || defined(OS_CHROMEOS)
// Determines the correct cooridinates and window to repost |event| to, if it is // Determines the correct coordinates and window to repost |event| to, if it is
// a mouse or touch event. // a mouse or touch event.
static void RepostEventImpl(const ui::LocatedEvent* event, static void RepostEventImpl(const ui::LocatedEvent* event,
const gfx::Point& screen_loc, const gfx::Point& screen_loc,
...@@ -2011,7 +2014,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item, ...@@ -2011,7 +2014,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
state_.monitor_bounds.right()) state_.monitor_bounds.right())
x -= pref.width(); // Move the menu to the left of the button. x -= pref.width(); // Move the menu to the left of the button.
else else
x += state_.initial_bounds.width(); // Move the menu right. x += state_.initial_bounds.width(); // Move the menu right.
} else { } else {
// The menu should end with the same x coordinate as the owning // The menu should end with the same x coordinate as the owning
// button. // button.
...@@ -2019,7 +2022,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item, ...@@ -2019,7 +2022,7 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
state_.initial_bounds.x() - pref.width()) state_.initial_bounds.x() - pref.width())
x = state_.initial_bounds.right(); // Move right of the button. x = state_.initial_bounds.right(); // Move right of the button.
else else
x = state_.initial_bounds.x() - pref.width(); // Move left. x = state_.initial_bounds.x() - pref.width(); // Move left.
} }
} }
item->set_actual_menu_position(orientation); item->set_actual_menu_position(orientation);
...@@ -2316,7 +2319,7 @@ MenuController::SelectByCharDetails MenuController::FindChildForMnemonic( ...@@ -2316,7 +2319,7 @@ MenuController::SelectByCharDetails MenuController::FindChildForMnemonic(
void MenuController::AcceptOrSelect(MenuItemView* parent, void MenuController::AcceptOrSelect(MenuItemView* parent,
const SelectByCharDetails& details) { const SelectByCharDetails& details) {
// This should only be invoked if there is a match. // This should only be invoked if there is a match.
DCHECK(details.first_match != -1); DCHECK_NE(details.first_match, -1);
DCHECK(parent->HasSubmenu()); DCHECK(parent->HasSubmenu());
SubmenuView* submenu = parent->GetSubmenu(); SubmenuView* submenu = parent->GetSubmenu();
DCHECK(submenu); DCHECK(submenu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment