| OLD | NEW |
| 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/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "ui/aura/scoped_window_targeter.h" | 8 #include "ui/aura/scoped_window_targeter.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/events/event_targeter.h" | 10 #include "ui/events/event_targeter.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(TestPlatformEventSource); | 55 DISALLOW_COPY_AND_ASSIGN(TestPlatformEventSource); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class TestNullTargeter : public ui::EventTargeter { | 58 class TestNullTargeter : public ui::EventTargeter { |
| 59 public: | 59 public: |
| 60 TestNullTargeter() {} | 60 TestNullTargeter() {} |
| 61 virtual ~TestNullTargeter() {} | 61 virtual ~TestNullTargeter() {} |
| 62 | 62 |
| 63 virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, | 63 virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, |
| 64 ui::Event* event) OVERRIDE { | 64 ui::Event* event) override { |
| 65 return NULL; | 65 return NULL; |
| 66 } | 66 } |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(TestNullTargeter); | 69 DISALLOW_COPY_AND_ASSIGN(TestNullTargeter); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class TestDispatcherClient : public aura::client::DispatcherClient { | 72 class TestDispatcherClient : public aura::client::DispatcherClient { |
| 73 public: | 73 public: |
| 74 TestDispatcherClient() : dispatcher_(NULL) {} | 74 TestDispatcherClient() : dispatcher_(NULL) {} |
| 75 virtual ~TestDispatcherClient() {} | 75 virtual ~TestDispatcherClient() {} |
| 76 | 76 |
| 77 base::MessagePumpDispatcher* dispatcher() { | 77 base::MessagePumpDispatcher* dispatcher() { |
| 78 return dispatcher_; | 78 return dispatcher_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // aura::client::DispatcherClient: | 81 // aura::client::DispatcherClient: |
| 82 virtual void PrepareNestedLoopClosures( | 82 virtual void PrepareNestedLoopClosures( |
| 83 base::MessagePumpDispatcher* dispatcher, | 83 base::MessagePumpDispatcher* dispatcher, |
| 84 base::Closure* run_closure, | 84 base::Closure* run_closure, |
| 85 base::Closure* quit_closure) OVERRIDE { | 85 base::Closure* quit_closure) override { |
| 86 scoped_ptr<base::RunLoop> run_loop(new base::RunLoop()); | 86 scoped_ptr<base::RunLoop> run_loop(new base::RunLoop()); |
| 87 *quit_closure = run_loop->QuitClosure(); | 87 *quit_closure = run_loop->QuitClosure(); |
| 88 *run_closure = base::Bind(&TestDispatcherClient::RunNestedDispatcher, | 88 *run_closure = base::Bind(&TestDispatcherClient::RunNestedDispatcher, |
| 89 base::Unretained(this), | 89 base::Unretained(this), |
| 90 base::Passed(&run_loop), | 90 base::Passed(&run_loop), |
| 91 dispatcher); | 91 dispatcher); |
| 92 } | 92 } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 void RunNestedDispatcher(scoped_ptr<base::RunLoop> run_loop, | 95 void RunNestedDispatcher(scoped_ptr<base::RunLoop> run_loop, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 FROM_HERE, | 263 FROM_HERE, |
| 264 base::Bind(&MenuControllerTest::DispatchEscapeAndExpect, | 264 base::Bind(&MenuControllerTest::DispatchEscapeAndExpect, |
| 265 base::Unretained(this), | 265 base::Unretained(this), |
| 266 MenuController::EXIT_NONE)); | 266 MenuController::EXIT_NONE)); |
| 267 RunMenu(owner.get()); | 267 RunMenu(owner.get()); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 #endif | 270 #endif |
| 271 | 271 |
| 272 } // namespace views | 272 } // namespace views |
| OLD | NEW |