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

Unified Diff: ui/views/test/menu_test_utils.cc

Issue 2654093005: Fix MenuRunner Releasing (Closed)
Patch Set: Clarification and renaming Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/test/menu_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/menu_test_utils.cc
diff --git a/ui/views/test/menu_test_utils.cc b/ui/views/test/menu_test_utils.cc
index 0f6178ab243400d2a4ff6dc2b4d151d551692ee2..3b69f3be5541a53b221ae9b06e43ab4bd2b8b75f 100644
--- a/ui/views/test/menu_test_utils.cc
+++ b/ui/views/test/menu_test_utils.cc
@@ -47,15 +47,21 @@ void TestMenuDelegate::WriteDragData(MenuItemView* sender,
// MenuControllerTestApi ------------------------------------------------------
-MenuControllerTestApi::MenuControllerTestApi() {}
+MenuControllerTestApi::MenuControllerTestApi()
+ : controller_(MenuController::GetActiveInstance()->AsWeakPtr()) {}
MenuControllerTestApi::~MenuControllerTestApi() {}
-void MenuControllerTestApi::Hide() {
- MenuController* controller = MenuController::GetActiveInstance();
- if (!controller)
+void MenuControllerTestApi::ClearState() {
+ if (!controller_)
return;
- controller->showing_ = false;
+ controller_->ClearStateForTest();
+}
+
+void MenuControllerTestApi::SetShowing(bool showing) {
+ if (!controller_)
+ return;
+ controller_->showing_ = showing;
}
} // namespace test
« 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