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

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

Issue 2013503002: Keep non-key event handling in-house for NativeWidgetMus Base URL: https://chromium.googlesource.com/chromium/src.git@native_widget_mus9
Patch Set: Add test for mouse input info agreement between widget and view Created 4 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
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 "components/bitmap_uploader/bitmap_uploader.h" 8 #include "components/bitmap_uploader/bitmap_uploader.h"
9 #include "components/mus/public/cpp/window.h" 9 #include "components/mus/public/cpp/window.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 input_method_.reset(new InputMethodMUS(this, window)); 66 input_method_.reset(new InputMethodMUS(this, window));
67 SetSharedInputMethod(input_method_.get()); 67 SetSharedInputMethod(input_method_.get());
68 } 68 }
69 69
70 WindowTreeHostMus::~WindowTreeHostMus() { 70 WindowTreeHostMus::~WindowTreeHostMus() {
71 DestroyCompositor(); 71 DestroyCompositor();
72 DestroyDispatcher(); 72 DestroyDispatcher();
73 } 73 }
74 74
75 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { 75 void WindowTreeHostMus::DispatchEvent(ui::Event* event) {
76 if (event->IsKeyEvent() && GetInputMethod()) { 76 // TODO(markdittmer): This flow is going away. For now, it is only intended
77 // for managing key events.
78 DCHECK(event->IsKeyEvent());
79 if (GetInputMethod()) {
77 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent()); 80 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent());
78 event->StopPropagation(); 81 event->StopPropagation();
79 return; 82 return;
80 } 83 }
81 WindowTreeHostPlatform::DispatchEvent(event); 84 WindowTreeHostPlatform::DispatchEvent(event);
82 } 85 }
83 86
84 void WindowTreeHostMus::OnClosed() { 87 void WindowTreeHostMus::OnClosed() {
85 if (native_widget_) 88 if (native_widget_)
86 native_widget_->OnPlatformWindowClosed(); 89 native_widget_->OnPlatformWindowClosed();
87 } 90 }
88 91
89 void WindowTreeHostMus::OnActivationChanged(bool active) { 92 void WindowTreeHostMus::OnActivationChanged(bool active) {
90 if (active) 93 if (active)
91 GetInputMethod()->OnFocus(); 94 GetInputMethod()->OnFocus();
92 else 95 else
93 GetInputMethod()->OnBlur(); 96 GetInputMethod()->OnBlur();
94 if (native_widget_) 97 if (native_widget_)
95 native_widget_->OnActivationChanged(active); 98 native_widget_->OnActivationChanged(active);
96 WindowTreeHostPlatform::OnActivationChanged(active); 99 WindowTreeHostPlatform::OnActivationChanged(active);
97 } 100 }
98 101
99 void WindowTreeHostMus::OnCloseRequest() { 102 void WindowTreeHostMus::OnCloseRequest() {
100 OnHostCloseRequested(); 103 OnHostCloseRequested();
101 } 104 }
102 105
103 } // namespace views 106 } // namespace views
OLDNEW
« ui/views/mus/native_widget_mus_unittest.cc ('K') | « ui/views/mus/native_widget_mus_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698