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

Side by Side Diff: chrome/browser/ui/views/menu_test_base.cc

Issue 250943008: Move enum MenuAnchorPosition to reduce deps on menu_item_view.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 6 years, 7 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 | Annotate | Revision Log
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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/ui/views/menu_test_base.h" 6 #include "chrome/browser/ui/views/menu_test_base.h"
7 #include "chrome/test/base/interactive_test_utils.h" 7 #include "chrome/test/base/interactive_test_utils.h"
8 #include "chrome/test/base/ui_test_utils.h" 8 #include "chrome/test/base/ui_test_utils.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/base/test/ui_controls.h" 10 #include "ui/base/test/ui_controls.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 gfx::Size MenuTestBase::GetPreferredSize() { 64 gfx::Size MenuTestBase::GetPreferredSize() {
65 return button_->GetPreferredSize(); 65 return button_->GetPreferredSize();
66 } 66 }
67 67
68 void MenuTestBase::OnMenuButtonClicked(views::View* source, 68 void MenuTestBase::OnMenuButtonClicked(views::View* source,
69 const gfx::Point& point) { 69 const gfx::Point& point) {
70 gfx::Point screen_location; 70 gfx::Point screen_location;
71 views::View::ConvertPointToScreen(source, &screen_location); 71 views::View::ConvertPointToScreen(source, &screen_location);
72 gfx::Rect bounds(screen_location, source->size()); 72 gfx::Rect bounds(screen_location, source->size());
73 ignore_result(menu_runner_->RunMenuAt( 73 ignore_result(menu_runner_->RunMenuAt(source->GetWidget(),
74 source->GetWidget(), 74 button_,
75 button_, 75 bounds,
76 bounds, 76 views::MENU_ANCHOR_TOPLEFT,
77 views::MenuItemView::TOPLEFT, 77 ui::MENU_SOURCE_NONE,
78 ui::MENU_SOURCE_NONE, 78 views::MenuRunner::HAS_MNEMONICS));
79 views::MenuRunner::HAS_MNEMONICS));
80 } 79 }
81 80
82 void MenuTestBase::ExecuteCommand(int id) { 81 void MenuTestBase::ExecuteCommand(int id) {
83 last_command_ = id; 82 last_command_ = id;
84 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698