OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); | 313 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 void Window::SetExternalTexture(ui::Texture* texture) { | 317 void Window::SetExternalTexture(ui::Texture* texture) { |
318 layer_->SetExternalTexture(texture); | 318 layer_->SetExternalTexture(texture); |
319 } | 319 } |
320 | 320 |
321 void Window::SetDefaultParentByRootWindow(RootWindow* root_window, | 321 void Window::SetDefaultParentByRootWindow(RootWindow* root_window, |
322 const gfx::Rect& bounds_in_screen) { | 322 const gfx::Rect& bounds_in_screen) { |
323 // TODO(erg): Enable this DCHECK once it is safe. | 323 DCHECK(root_window); |
324 // DCHECK(root_window); | |
325 | 324 |
326 // Stacking clients are mandatory on RootWindow objects. | 325 // Stacking clients are mandatory on RootWindow objects. |
327 client::StackingClient* client = client::GetStackingClient(root_window); | 326 client::StackingClient* client = client::GetStackingClient(root_window); |
328 DCHECK(client); | 327 DCHECK(client); |
329 | 328 |
330 aura::Window* default_parent = client->GetDefaultParent( | 329 aura::Window* default_parent = client->GetDefaultParent( |
331 root_window, this, bounds_in_screen); | 330 root_window, this, bounds_in_screen); |
332 default_parent->AddChild(this); | 331 default_parent->AddChild(this); |
333 } | 332 } |
334 | 333 |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 bool contains_mouse = false; | 965 bool contains_mouse = false; |
967 if (IsVisible()) { | 966 if (IsVisible()) { |
968 RootWindow* root_window = GetRootWindow(); | 967 RootWindow* root_window = GetRootWindow(); |
969 contains_mouse = root_window && | 968 contains_mouse = root_window && |
970 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); | 969 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); |
971 } | 970 } |
972 return contains_mouse; | 971 return contains_mouse; |
973 } | 972 } |
974 | 973 |
975 } // namespace aura | 974 } // namespace aura |
OLD | NEW |