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

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

Issue 2659903002: Change MenuControllerDelegate to provide WeakPtr (Closed)
Patch Set: 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
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/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 parent, index, MenuController::INCREMENT_SELECTION_DOWN); 490 parent, index, MenuController::INCREMENT_SELECTION_DOWN);
491 } 491 }
492 492
493 MenuItemView* FindPreviousSelectableMenuItem(MenuItemView* parent, 493 MenuItemView* FindPreviousSelectableMenuItem(MenuItemView* parent,
494 int index) { 494 int index) {
495 return menu_controller_->FindNextSelectableMenuItem( 495 return menu_controller_->FindNextSelectableMenuItem(
496 parent, index, MenuController::INCREMENT_SELECTION_UP); 496 parent, index, MenuController::INCREMENT_SELECTION_UP);
497 } 497 }
498 498
499 internal::MenuControllerDelegate* GetCurrentDelegate() { 499 internal::MenuControllerDelegate* GetCurrentDelegate() {
500 return menu_controller_->delegate_; 500 return menu_controller_->delegate_.get();
501 } 501 }
502 502
503 bool IsAsyncRun() { return menu_controller_->async_run_; } 503 bool IsAsyncRun() { return menu_controller_->async_run_; }
504 504
505 bool IsShowing() { return menu_controller_->showing_; } 505 bool IsShowing() { return menu_controller_->showing_; }
506 506
507 MenuHost* GetMenuHost(SubmenuView* submenu) { return submenu->host_; } 507 MenuHost* GetMenuHost(SubmenuView* submenu) { return submenu->host_; }
508 508
509 void MenuHostOnDragWillStart(MenuHost* host) { host->OnDragWillStart(); } 509 void MenuHostOnDragWillStart(MenuHost* host) { host->OnDragWillStart(); }
510 510
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 controller->Run(owner(), nullptr, menu_item(), gfx::Rect(), 1514 controller->Run(owner(), nullptr, menu_item(), gfx::Rect(),
1515 MENU_ANCHOR_TOPLEFT, false, false, &mouse_event_flags); 1515 MENU_ANCHOR_TOPLEFT, false, false, &mouse_event_flags);
1516 EXPECT_EQ(run_result, nullptr); 1516 EXPECT_EQ(run_result, nullptr);
1517 TestDestroyedDuringViewsRelease(); 1517 TestDestroyedDuringViewsRelease();
1518 } 1518 }
1519 1519
1520 #endif // defined(USE_AURA) 1520 #endif // defined(USE_AURA)
1521 1521
1522 } // namespace test 1522 } // namespace test
1523 } // namespace views 1523 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller_delegate.h ('k') | ui/views/controls/menu/menu_runner_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698