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

Side by Side Diff: ui/views/mus/window_tree_host_mus.cc

Issue 2284003002: Revert of IME for Mus: Make InputMethodMus use the IME Mojo API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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/views/mus/window_tree_host_mus.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mus/window_tree_host_mus.h" 5 #include "ui/views/mus/window_tree_host_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "services/ui/public/cpp/window.h" 8 #include "services/ui/public/cpp/window.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Initialize the stub platform window bounds to those of the ui::Window. 47 // Initialize the stub platform window bounds to those of the ui::Window.
48 platform_window()->SetBounds(window->bounds()); 48 platform_window()->SetBounds(window->bounds());
49 49
50 // The location of events is already transformed, and there is no way to 50 // The location of events is already transformed, and there is no way to
51 // correctly determine the reverse transform. So, don't attempt to transform 51 // correctly determine the reverse transform. So, don't attempt to transform
52 // event locations, else the root location is wrong. 52 // event locations, else the root location is wrong.
53 // TODO(sky): we need to transform for device scale though. 53 // TODO(sky): we need to transform for device scale though.
54 dispatcher()->set_transform_events(false); 54 dispatcher()->set_transform_events(false);
55 compositor()->SetHostHasTransparentBackground(true); 55 compositor()->SetHostHasTransparentBackground(true);
56 56
57 input_method_.reset(new InputMethodMus(this, window)); 57 input_method_.reset(new InputMethodMUS(this, window));
58 SetSharedInputMethod(input_method_.get()); 58 SetSharedInputMethod(input_method_.get());
59 } 59 }
60 60
61 WindowTreeHostMus::~WindowTreeHostMus() { 61 WindowTreeHostMus::~WindowTreeHostMus() {
62 DestroyCompositor(); 62 DestroyCompositor();
63 DestroyDispatcher(); 63 DestroyDispatcher();
64 } 64 }
65 65
66 void WindowTreeHostMus::InitInputMethod(shell::Connector* connector) {
67 input_method_->Init(connector);
68 }
69
70 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { 66 void WindowTreeHostMus::DispatchEvent(ui::Event* event) {
71 if (event->IsKeyEvent() && GetInputMethod()) { 67 if (event->IsKeyEvent() && GetInputMethod()) {
72 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent()); 68 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent());
73 return; 69 return;
74 } 70 }
75 WindowTreeHostPlatform::DispatchEvent(event); 71 WindowTreeHostPlatform::DispatchEvent(event);
76 } 72 }
77 73
78 void WindowTreeHostMus::OnClosed() { 74 void WindowTreeHostMus::OnClosed() {
79 if (native_widget_) 75 if (native_widget_)
80 native_widget_->OnPlatformWindowClosed(); 76 native_widget_->OnPlatformWindowClosed();
81 } 77 }
82 78
83 void WindowTreeHostMus::OnActivationChanged(bool active) { 79 void WindowTreeHostMus::OnActivationChanged(bool active) {
84 if (active) 80 if (active)
85 GetInputMethod()->OnFocus(); 81 GetInputMethod()->OnFocus();
86 else 82 else
87 GetInputMethod()->OnBlur(); 83 GetInputMethod()->OnBlur();
88 if (native_widget_) 84 if (native_widget_)
89 native_widget_->OnActivationChanged(active); 85 native_widget_->OnActivationChanged(active);
90 WindowTreeHostPlatform::OnActivationChanged(active); 86 WindowTreeHostPlatform::OnActivationChanged(active);
91 } 87 }
92 88
93 void WindowTreeHostMus::OnCloseRequest() { 89 void WindowTreeHostMus::OnCloseRequest() {
94 OnHostCloseRequested(); 90 OnHostCloseRequested();
95 } 91 }
96 92
97 } // namespace views 93 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/window_tree_host_mus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698