Index: ui/views/widget/desktop_aura/desktop_dispatcher_client.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc b/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc |
index 9962eaa0ec15bb7f00587a7db152710f16f6cc83..7be5e4875406d6585fb36cec6e307d70c7fc4933 100644 |
--- a/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc |
+++ b/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc |
@@ -9,40 +9,25 @@ |
namespace views { |
-DesktopDispatcherClient::DesktopDispatcherClient() |
- : weak_ptr_factory_(this) {} |
+DesktopDispatcherClient::DesktopDispatcherClient() { |
+} |
DesktopDispatcherClient::~DesktopDispatcherClient() { |
} |
void DesktopDispatcherClient::RunWithDispatcher( |
- base::MessagePumpDispatcher* nested_dispatcher) { |
- // TODO(erg): This class has been copypastad from |
- // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes |
- // commented out because I don't entirely understand the implications of the |
- // change. |
+ base::MessagePumpDispatcher* nested_dispatcher, |
+ base::Closure* quit_runloop) { |
base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop); |
- base::Closure old_quit_closure = quit_closure_; |
#if defined(OS_WIN) |
base::RunLoop run_loop(nested_dispatcher); |
#else |
base::RunLoop run_loop; |
#endif |
- |
- quit_closure_ = run_loop.QuitClosure(); |
- base::WeakPtr<DesktopDispatcherClient> alive(weak_ptr_factory_.GetWeakPtr()); |
+ *quit_runloop = run_loop.QuitClosure(); |
run_loop.Run(); |
- if (alive) { |
- weak_ptr_factory_.InvalidateWeakPtrs(); |
- quit_closure_ = old_quit_closure; |
- } |
-} |
- |
-void DesktopDispatcherClient::QuitNestedMessageLoop() { |
- CHECK(!quit_closure_.is_null()); |
- quit_closure_.Run(); |
} |
} // namespace views |