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

Side by Side Diff: ui/aura/test/aura_test_utils.cc

Issue 2872343003: Remove InputMethodEventHandler. (Closed)
Patch Set: addressed feedback. Created 3 years, 7 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
« no previous file with comments | « ui/aura/test/aura_test_utils.h ('k') | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/aura/test/aura_test_utils.h" 5 #include "ui/aura/test/aura_test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
11 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
12 12
13 namespace aura { 13 namespace aura {
14 namespace test { 14 namespace test {
15 15
16 class WindowTreeHostTestApi { 16 class WindowTreeHostTestApi {
17 public: 17 public:
18 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {} 18 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {}
19 19
20 const gfx::Point& last_cursor_request_position_in_host() { 20 const gfx::Point& last_cursor_request_position_in_host() {
21 return host_->last_cursor_request_position_in_host_; 21 return host_->last_cursor_request_position_in_host_;
22 } 22 }
23 23
24 void set_dispatcher(std::unique_ptr<WindowEventDispatcher> dispatcher) { 24 void set_dispatcher(std::unique_ptr<WindowEventDispatcher> dispatcher) {
25 host_->dispatcher_ = std::move(dispatcher); 25 host_->dispatcher_ = std::move(dispatcher);
26 } 26 }
27 27
28 void disable_ime() { host_->dispatcher_->set_skip_ime(true); }
29
28 private: 30 private:
29 WindowTreeHost* host_; 31 WindowTreeHost* host_;
30 32
31 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi); 33 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi);
32 }; 34 };
33 35
34 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) { 36 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) {
35 WindowTreeHostTestApi host_test_api(host); 37 WindowTreeHostTestApi host_test_api(host);
36 return host_test_api.last_cursor_request_position_in_host(); 38 return host_test_api.last_cursor_request_position_in_host();
37 } 39 }
38 40
39 void SetHostDispatcher(WindowTreeHost* host, 41 void SetHostDispatcher(WindowTreeHost* host,
40 std::unique_ptr<WindowEventDispatcher> dispatcher) { 42 std::unique_ptr<WindowEventDispatcher> dispatcher) {
41 WindowTreeHostTestApi host_test_api(host); 43 WindowTreeHostTestApi host_test_api(host);
42 host_test_api.set_dispatcher(std::move(dispatcher)); 44 host_test_api.set_dispatcher(std::move(dispatcher));
43 } 45 }
44 46
47 void DisableIME(WindowTreeHost* host) {
48 WindowTreeHostTestApi(host).disable_ime();
49 }
50
45 } // namespace test 51 } // namespace test
46 } // namespace aura 52 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_utils.h ('k') | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698