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

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

Issue 1209663002: Use EventHandler for IME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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"
11 #include "ash/host/root_window_transformer.h" 11 #include "ash/host/root_window_transformer.h"
12 #include "ash/host/transformer_helper.h" 12 #include "ash/host/transformer_helper.h"
13 #include "ash/ime/input_method_event_handler.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/win/windows_version.h" 15 #include "base/win/windows_version.h"
15 #include "ui/aura/window_tree_host_win.h" 16 #include "ui/aura/window_tree_host_win.h"
16 #include "ui/gfx/geometry/insets.h" 17 #include "ui/gfx/geometry/insets.h"
17 #include "ui/gfx/transform.h" 18 #include "ui/gfx/transform.h"
18 19
19 namespace ash { 20 namespace ash {
20 namespace { 21 namespace {
21 22
22 class AshWindowTreeHostWin : public AshWindowTreeHost, 23 class AshWindowTreeHostWin : public AshWindowTreeHost,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 gfx::Transform GetRootTransform() const override { 95 gfx::Transform GetRootTransform() const override {
95 return transformer_helper_.GetTransform(); 96 return transformer_helper_.GetTransform();
96 } 97 }
97 gfx::Transform GetInverseRootTransform() const override { 98 gfx::Transform GetInverseRootTransform() const override {
98 return transformer_helper_.GetInverseTransform(); 99 return transformer_helper_.GetInverseTransform();
99 } 100 }
100 void UpdateRootWindowSize(const gfx::Size& host_size) override { 101 void UpdateRootWindowSize(const gfx::Size& host_size) override {
101 transformer_helper_.UpdateWindowSize(host_size); 102 transformer_helper_.UpdateWindowSize(host_size);
102 } 103 }
103 104
105 // ui::internal::InputMethodDelegate:
106 bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
107 ui::KeyEvent event_copy(event);
108 input_method_handler()->SetPostIME(true);
109 ui::EventSource::DeliverEventToProcessor(&event_copy);
110 input_method_handler()->SetPostIME(false);
111 return event_copy.handled();
112 }
113
114 // ui::EventSource:
115 ui::EventDispatchDetails DeliverEventToProcessor(ui::Event* event) override {
116 return ui::EventSource::DeliverEventToProcessor(event);
117 }
118
104 bool fullscreen_; 119 bool fullscreen_;
105 RECT saved_window_rect_; 120 RECT saved_window_rect_;
106 DWORD saved_window_style_; 121 DWORD saved_window_style_;
107 DWORD saved_window_ex_style_; 122 DWORD saved_window_ex_style_;
108 123
109 TransformerHelper transformer_helper_; 124 TransformerHelper transformer_helper_;
110 125
111 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin); 126 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin);
112 }; 127 };
113 128
114 } // namespace 129 } // namespace
115 130
116 AshWindowTreeHost* AshWindowTreeHost::Create( 131 AshWindowTreeHost* AshWindowTreeHost::Create(
117 const AshWindowTreeHostInitParams& init_params) { 132 const AshWindowTreeHostInitParams& init_params) {
118 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && 133 if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
119 !base::CommandLine::ForCurrentProcess()->HasSwitch( 134 !base::CommandLine::ForCurrentProcess()->HasSwitch(
120 ash::switches::kForceAshToDesktop)) 135 ash::switches::kForceAshToDesktop))
121 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); 136 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd);
122 137
123 return new AshWindowTreeHostWin(init_params.initial_bounds); 138 return new AshWindowTreeHostWin(init_params.initial_bounds);
124 } 139 }
125 140
126 } // namespace ash 141 } // 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