OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 WindowTreeHostMus::~WindowTreeHostMus() { | 59 WindowTreeHostMus::~WindowTreeHostMus() { |
60 DestroyCompositor(); | 60 DestroyCompositor(); |
61 DestroyDispatcher(); | 61 DestroyDispatcher(); |
62 } | 62 } |
63 | 63 |
64 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { | 64 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { |
65 if (event->IsKeyEvent() && GetInputMethod()) { | 65 if (event->IsKeyEvent() && GetInputMethod()) { |
66 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent()); | 66 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent()); |
67 event->StopPropagation(); | |
68 return; | 67 return; |
69 } | 68 } |
70 WindowTreeHostPlatform::DispatchEvent(event); | 69 WindowTreeHostPlatform::DispatchEvent(event); |
71 } | 70 } |
72 | 71 |
73 void WindowTreeHostMus::OnClosed() { | 72 void WindowTreeHostMus::OnClosed() { |
74 if (native_widget_) | 73 if (native_widget_) |
75 native_widget_->OnPlatformWindowClosed(); | 74 native_widget_->OnPlatformWindowClosed(); |
76 } | 75 } |
77 | 76 |
78 void WindowTreeHostMus::OnActivationChanged(bool active) { | 77 void WindowTreeHostMus::OnActivationChanged(bool active) { |
79 if (active) | 78 if (active) |
80 GetInputMethod()->OnFocus(); | 79 GetInputMethod()->OnFocus(); |
81 else | 80 else |
82 GetInputMethod()->OnBlur(); | 81 GetInputMethod()->OnBlur(); |
83 if (native_widget_) | 82 if (native_widget_) |
84 native_widget_->OnActivationChanged(active); | 83 native_widget_->OnActivationChanged(active); |
85 WindowTreeHostPlatform::OnActivationChanged(active); | 84 WindowTreeHostPlatform::OnActivationChanged(active); |
86 } | 85 } |
87 | 86 |
88 void WindowTreeHostMus::OnCloseRequest() { | 87 void WindowTreeHostMus::OnCloseRequest() { |
89 OnHostCloseRequested(); | 88 OnHostCloseRequested(); |
90 } | 89 } |
91 | 90 |
92 } // namespace views | 91 } // namespace views |
OLD | NEW |