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

Side by Side Diff: ash/host/ash_window_tree_host_win.cc

Issue 1257603006: Refactoring for the InputMethod & InputMethodDelegate interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Sadrul's comment. Created 5 years, 4 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 | « ash/host/ash_window_tree_host_unified.cc ('k') | ash/host/ash_window_tree_host_x11.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 "ash/host/ash_window_tree_host.h" 5 #include "ash/host/ash_window_tree_host.h"
6 6
7 #include "ash/ash_export.h" 7 #include "ash/ash_export.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/host/ash_remote_window_tree_host_win.h" 9 #include "ash/host/ash_remote_window_tree_host_win.h"
10 #include "ash/host/ash_window_tree_host_init_params.h" 10 #include "ash/host/ash_window_tree_host_init_params.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return transformer_helper_.GetTransform(); 97 return transformer_helper_.GetTransform();
98 } 98 }
99 gfx::Transform GetInverseRootTransform() const override { 99 gfx::Transform GetInverseRootTransform() const override {
100 return transformer_helper_.GetInverseTransform(); 100 return transformer_helper_.GetInverseTransform();
101 } 101 }
102 void UpdateRootWindowSize(const gfx::Size& host_size) override { 102 void UpdateRootWindowSize(const gfx::Size& host_size) override {
103 transformer_helper_.UpdateWindowSize(host_size); 103 transformer_helper_.UpdateWindowSize(host_size);
104 } 104 }
105 105
106 // ui::internal::InputMethodDelegate: 106 // ui::internal::InputMethodDelegate:
107 bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override { 107 ui::EventDispatchDetails DispatchKeyEventPostIME(
108 ui::KeyEvent event_copy(event); 108 ui::KeyEvent* event) override {
109 input_method_handler()->SetPostIME(true); 109 input_method_handler()->SetPostIME(true);
110 ui::EventDispatchDetails details = 110 ui::EventDispatchDetails details =
111 event_processor()->OnEventFromSource(&event_copy); 111 event_processor()->OnEventFromSource(event);
112 if (details.dispatcher_destroyed) 112 if (!details.dispatcher_destroyed)
113 return true; 113 input_method_handler()->SetPostIME(false);
114 input_method_handler()->SetPostIME(false); 114 return details;
115 return event_copy.stopped_propagation();
116 } 115 }
117 116
118 bool fullscreen_; 117 bool fullscreen_;
119 RECT saved_window_rect_; 118 RECT saved_window_rect_;
120 DWORD saved_window_style_; 119 DWORD saved_window_style_;
121 DWORD saved_window_ex_style_; 120 DWORD saved_window_ex_style_;
122 121
123 TransformerHelper transformer_helper_; 122 TransformerHelper transformer_helper_;
124 123
125 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin); 124 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin);
126 }; 125 };
127 126
128 } // namespace 127 } // namespace
129 128
130 AshWindowTreeHost* AshWindowTreeHost::Create( 129 AshWindowTreeHost* AshWindowTreeHost::Create(
131 const AshWindowTreeHostInitParams& init_params) { 130 const AshWindowTreeHostInitParams& init_params) {
132 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && 131 if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
133 !base::CommandLine::ForCurrentProcess()->HasSwitch( 132 !base::CommandLine::ForCurrentProcess()->HasSwitch(
134 ash::switches::kForceAshToDesktop)) 133 ash::switches::kForceAshToDesktop))
135 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); 134 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd);
136 135
137 return new AshWindowTreeHostWin(init_params.initial_bounds); 136 return new AshWindowTreeHostWin(init_params.initial_bounds);
138 } 137 }
139 138
140 } // namespace ash 139 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_unified.cc ('k') | ash/host/ash_window_tree_host_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698