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

Side by Side Diff: ui/views/controls/menu/menu_controller_unittest.cc

Issue 1454583002: Change Views menus to consistently use GetNativeTheme for theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get menu config from item Created 5 years, 1 month 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
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/aura/scoped_window_targeter.h" 8 #include "ui/aura/scoped_window_targeter.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/events/event_handler.h" 10 #include "ui/events/event_handler.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 void SetupMenuItem() { 208 void SetupMenuItem() {
209 menu_item_.reset(new TestMenuItemViewShown); 209 menu_item_.reset(new TestMenuItemViewShown);
210 menu_item_->AppendMenuItemWithLabel(1, base::ASCIIToUTF16("One")); 210 menu_item_->AppendMenuItemWithLabel(1, base::ASCIIToUTF16("One"));
211 menu_item_->AppendMenuItemWithLabel(2, base::ASCIIToUTF16("Two")); 211 menu_item_->AppendMenuItemWithLabel(2, base::ASCIIToUTF16("Two"));
212 menu_item_->AppendMenuItemWithLabel(3, base::ASCIIToUTF16("Three")); 212 menu_item_->AppendMenuItemWithLabel(3, base::ASCIIToUTF16("Three"));
213 menu_item_->AppendMenuItemWithLabel(4, base::ASCIIToUTF16("Four")); 213 menu_item_->AppendMenuItemWithLabel(4, base::ASCIIToUTF16("Four"));
214 } 214 }
215 215
216 void SetupMenuController() { 216 void SetupMenuController() {
217 menu_controller_= new MenuController(nullptr, true, nullptr); 217 menu_controller_= new MenuController(true, nullptr);
218 menu_controller_->owner_ = owner_.get(); 218 menu_controller_->owner_ = owner_.get();
219 menu_controller_->showing_ = true; 219 menu_controller_->showing_ = true;
220 menu_controller_->SetSelection( 220 menu_controller_->SetSelection(
221 menu_item_.get(), MenuController::SELECTION_UPDATE_IMMEDIATELY); 221 menu_item_.get(), MenuController::SELECTION_UPDATE_IMMEDIATELY);
222 } 222 }
223 223
224 scoped_ptr<Widget> owner_; 224 scoped_ptr<Widget> owner_;
225 scoped_ptr<ui::test::EventGenerator> event_generator_; 225 scoped_ptr<ui::test::EventGenerator> event_generator_;
226 scoped_ptr<TestMenuItemViewShown> menu_item_; 226 scoped_ptr<TestMenuItemViewShown> menu_item_;
227 MenuController* menu_controller_; 227 MenuController* menu_controller_;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Move up and select a previous (in our case the last enabled) item. 411 // Move up and select a previous (in our case the last enabled) item.
412 DecrementSelection(); 412 DecrementSelection();
413 EXPECT_EQ(3, pending_state_item()->GetCommand()); 413 EXPECT_EQ(3, pending_state_item()->GetCommand());
414 414
415 // Clear references in menu controller to the menu item that is going away. 415 // Clear references in menu controller to the menu item that is going away.
416 ResetSelection(); 416 ResetSelection();
417 } 417 }
418 418
419 } // namespace test 419 } // namespace test
420 } // namespace views 420 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698