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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 void CastWindowManagerAura::SetWindowId(gfx::NativeView window, | 234 void CastWindowManagerAura::SetWindowId(gfx::NativeView window, |
235 WindowId window_id) { | 235 WindowId window_id) { |
236 window->set_id(window_id); | 236 window->set_id(window_id); |
237 } | 237 } |
238 | 238 |
239 gfx::NativeView CastWindowManagerAura::GetRootWindow() { | 239 gfx::NativeView CastWindowManagerAura::GetRootWindow() { |
240 Setup(); | 240 Setup(); |
241 return window_tree_host_->window(); | 241 return window_tree_host_->window(); |
242 } | 242 } |
243 | 243 |
244 aura::Window* CastWindowManagerAura::GetDefaultParent(aura::Window* context, | 244 aura::Window* CastWindowManagerAura::GetDefaultParent(aura::Window* window, |
245 aura::Window* window, | |
246 const gfx::Rect& bounds) { | 245 const gfx::Rect& bounds) { |
247 DCHECK(window_tree_host_); | 246 DCHECK(window_tree_host_); |
248 return window_tree_host_->window(); | 247 return window_tree_host_->window(); |
249 } | 248 } |
250 | 249 |
251 void CastWindowManagerAura::AddWindow(gfx::NativeView child) { | 250 void CastWindowManagerAura::AddWindow(gfx::NativeView child) { |
252 LOG(INFO) << "Adding window: " << child->id() << ": " << child->GetName(); | 251 LOG(INFO) << "Adding window: " << child->id() << ": " << child->GetName(); |
253 Setup(); | 252 Setup(); |
254 | 253 |
255 DCHECK(child); | 254 DCHECK(child); |
256 aura::Window* parent = window_tree_host_->window(); | 255 aura::Window* parent = window_tree_host_->window(); |
257 if (!parent->Contains(child)) { | 256 if (!parent->Contains(child)) { |
258 parent->AddChild(child); | 257 parent->AddChild(child); |
259 } | 258 } |
260 } | 259 } |
261 | 260 |
262 void CastWindowManagerAura::OnVSyncIntervalChanged(base::TimeDelta interval) { | 261 void CastWindowManagerAura::OnVSyncIntervalChanged(base::TimeDelta interval) { |
263 DCHECK(window_tree_host_.get()); | 262 DCHECK(window_tree_host_.get()); |
264 window_tree_host_->compositor()->SetAuthoritativeVSyncInterval(interval); | 263 window_tree_host_->compositor()->SetAuthoritativeVSyncInterval(interval); |
265 } | 264 } |
266 | 265 |
267 } // namespace chromecast | 266 } // namespace chromecast |
OLD | NEW |