OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chromecast/graphics/cast_window_manager_aura.h" | 5 #include "chromecast/graphics/cast_window_manager_aura.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chromecast/graphics/cast_focus_client_aura.h" | 8 #include "chromecast/graphics/cast_focus_client_aura.h" |
9 #include "ui/aura/client/default_capture_client.h" | 9 #include "ui/aura/client/default_capture_client.h" |
10 #include "ui/aura/client/focus_change_observer.h" | 10 #include "ui/aura/client/focus_change_observer.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 CastWindowTreeHost::~CastWindowTreeHost() {} | 71 CastWindowTreeHost::~CastWindowTreeHost() {} |
72 | 72 |
73 void CastWindowTreeHost::DispatchEvent(ui::Event* event) { | 73 void CastWindowTreeHost::DispatchEvent(ui::Event* event) { |
74 if (!enable_input_) { | 74 if (!enable_input_) { |
75 return; | 75 return; |
76 } | 76 } |
77 | 77 |
78 if (event->IsKeyEvent()) { | 78 WindowTreeHostPlatform::DispatchEvent(event); |
79 // Convert a RawKeyDown into a character insertion; otherwise | |
80 // the WebContents will ignore most keyboard input. | |
81 GetInputMethod()->DispatchKeyEvent(event->AsKeyEvent()); | |
82 } else { | |
83 WindowTreeHostPlatform::DispatchEvent(event); | |
84 } | |
85 } | 79 } |
86 | 80 |
87 // A layout manager owned by the root window. | 81 // A layout manager owned by the root window. |
88 class CastLayoutManager : public aura::LayoutManager { | 82 class CastLayoutManager : public aura::LayoutManager { |
89 public: | 83 public: |
90 CastLayoutManager(); | 84 CastLayoutManager(); |
91 ~CastLayoutManager() override; | 85 ~CastLayoutManager() override; |
92 | 86 |
93 private: | 87 private: |
94 // aura::LayoutManager implementation: | 88 // aura::LayoutManager implementation: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 Setup(); | 240 Setup(); |
247 | 241 |
248 DCHECK(child); | 242 DCHECK(child); |
249 aura::Window* parent = window_tree_host_->window(); | 243 aura::Window* parent = window_tree_host_->window(); |
250 if (!parent->Contains(child)) { | 244 if (!parent->Contains(child)) { |
251 parent->AddChild(child); | 245 parent->AddChild(child); |
252 } | 246 } |
253 } | 247 } |
254 | 248 |
255 } // namespace chromecast | 249 } // namespace chromecast |
OLD | NEW |