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

Side by Side Diff: ui/views/test/menu_test_utils.cc

Issue 2654093005: Fix MenuRunner Releasing (Closed)
Patch Set: Clarification and renaming Created 3 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
« no previous file with comments | « ui/views/test/menu_test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/menu_test_utils.h" 5 #include "ui/views/test/menu_test_utils.h"
6 6
7 #include "ui/views/controls/menu/menu_controller.h" 7 #include "ui/views/controls/menu/menu_controller.h"
8 8
9 namespace views { 9 namespace views {
10 namespace test { 10 namespace test {
(...skipping 29 matching lines...) Expand all
40 40
41 int TestMenuDelegate::GetDragOperations(MenuItemView* sender) { 41 int TestMenuDelegate::GetDragOperations(MenuItemView* sender) {
42 return ui::DragDropTypes::DRAG_COPY; 42 return ui::DragDropTypes::DRAG_COPY;
43 } 43 }
44 44
45 void TestMenuDelegate::WriteDragData(MenuItemView* sender, 45 void TestMenuDelegate::WriteDragData(MenuItemView* sender,
46 OSExchangeData* data) {} 46 OSExchangeData* data) {}
47 47
48 // MenuControllerTestApi ------------------------------------------------------ 48 // MenuControllerTestApi ------------------------------------------------------
49 49
50 MenuControllerTestApi::MenuControllerTestApi() {} 50 MenuControllerTestApi::MenuControllerTestApi()
51 : controller_(MenuController::GetActiveInstance()->AsWeakPtr()) {}
51 52
52 MenuControllerTestApi::~MenuControllerTestApi() {} 53 MenuControllerTestApi::~MenuControllerTestApi() {}
53 54
54 void MenuControllerTestApi::Hide() { 55 void MenuControllerTestApi::ClearState() {
55 MenuController* controller = MenuController::GetActiveInstance(); 56 if (!controller_)
56 if (!controller)
57 return; 57 return;
58 controller->showing_ = false; 58 controller_->ClearStateForTest();
59 }
60
61 void MenuControllerTestApi::SetShowing(bool showing) {
62 if (!controller_)
63 return;
64 controller_->showing_ = showing;
59 } 65 }
60 66
61 } // namespace test 67 } // namespace test
62 } // namespace views 68 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/menu_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698