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

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

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/automation/ui_controls.h" 5 #include "chrome/browser/automation/ui_controls.h"
6 #include "chrome/test/interactive_ui/view_event_test_base.h" 6 #include "chrome/test/interactive_ui/view_event_test_base.h"
7 #include "views/controls/button/menu_button.h" 7 #include "views/controls/button/menu_button.h"
8 #include "views/controls/menu/menu_controller.h" 8 #include "views/controls/menu/menu_controller.h"
9 #include "views/controls/menu/menu_item_view.h" 9 #include "views/controls/menu/menu_item_view.h"
10 #include "views/controls/menu/submenu_view.h" 10 #include "views/controls/menu/submenu_view.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 virtual gfx::Size GetPreferredSize() OVERRIDE { 61 virtual gfx::Size GetPreferredSize() OVERRIDE {
62 return button_->GetPreferredSize(); 62 return button_->GetPreferredSize();
63 } 63 }
64 64
65 // views::ViewMenuDelegate implementation. 65 // views::ViewMenuDelegate implementation.
66 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE { 66 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE {
67 gfx::Point screen_location; 67 gfx::Point screen_location;
68 views::View::ConvertPointToScreen(source, &screen_location); 68 views::View::ConvertPointToScreen(source, &screen_location);
69 gfx::Rect bounds(screen_location, source->size()); 69 gfx::Rect bounds(screen_location, source->size());
70 menu_->RunMenuAt( 70 menu_->RunMenuAt(
71 source->GetWindow()->GetNativeWindow(), 71 source->GetWidget()->GetNativeWindow(),
72 button_, 72 button_,
73 bounds, 73 bounds,
74 views::MenuItemView::TOPLEFT, 74 views::MenuItemView::TOPLEFT,
75 true); 75 true);
76 } 76 }
77 77
78 protected: 78 protected:
79 // Generate a mouse click on the specified view and post a new task. 79 // Generate a mouse click on the specified view and post a new task.
80 virtual void Click(views::View* view, Task* next) { 80 virtual void Click(views::View* view, Task* next) {
81 ui_controls::MoveMouseToCenterAndPress( 81 ui_controls::MoveMouseToCenterAndPress(
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 private: 470 private:
471 int last_command_; 471 int last_command_;
472 views::MenuItemView* submenu_; 472 views::MenuItemView* submenu_;
473 }; 473 };
474 474
475 typedef MenuItemViewTestRemoveWithSubmenu<0> MenuItemViewTestRemoveWithSubmenu0; 475 typedef MenuItemViewTestRemoveWithSubmenu<0> MenuItemViewTestRemoveWithSubmenu0;
476 typedef MenuItemViewTestRemoveWithSubmenu<1> MenuItemViewTestRemoveWithSubmenu1; 476 typedef MenuItemViewTestRemoveWithSubmenu<1> MenuItemViewTestRemoveWithSubmenu1;
477 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu0, RemoveItemWithSubmenu0) 477 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu0, RemoveItemWithSubmenu0)
478 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu1, RemoveItemWithSubmenu1) 478 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu1, RemoveItemWithSubmenu1)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/profile_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698