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

Unified Diff: ui/views/controls/menu/menu_runner_impl.cc

Issue 2659903002: Change MenuControllerDelegate to provide WeakPtr (Closed)
Patch Set: 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/controls/menu/menu_runner_impl.h ('k') | ui/views/controls/menu/menu_runner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_runner_impl.cc
diff --git a/ui/views/controls/menu/menu_runner_impl.cc b/ui/views/controls/menu/menu_runner_impl.cc
index a247d5129bba444b463610ba9855590974ef70ae..9e4f72a273096cc8758e8c5918662c0d50876f06 100644
--- a/ui/views/controls/menu/menu_runner_impl.cc
+++ b/ui/views/controls/menu/menu_runner_impl.cc
@@ -36,8 +36,7 @@ MenuRunnerImpl::MenuRunnerImpl(MenuItemView* menu)
async_(false),
for_drop_(false),
controller_(NULL),
- owns_controller_(false),
- weak_factory_(this) {}
+ owns_controller_(false) {}
bool MenuRunnerImpl::IsRunning() const {
return running_;
@@ -202,7 +201,7 @@ MenuRunner::RunResult MenuRunnerImpl::MenuDone(NotifyType type,
running_ = false;
if (menu_->GetDelegate()) {
// Executing the command may also delete this.
- base::WeakPtr<MenuRunnerImpl> ref(weak_factory_.GetWeakPtr());
+ base::WeakPtr<MenuControllerDelegate> ref(AsWeakPtr());
if (result && !for_drop_) {
// Do not execute the menu that was dragged/dropped.
menu_->GetDelegate()->ExecuteCommand(result->GetCommand(),
« no previous file with comments | « ui/views/controls/menu/menu_runner_impl.h ('k') | ui/views/controls/menu/menu_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698