| 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 "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/wm/core/window_util.h" | 9 #include "ui/wm/core/window_util.h" |
| 10 | 10 |
| 11 namespace platform_util { | 11 namespace platform_util { |
| 12 | 12 |
| 13 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | |
| 14 return view->GetToplevelWindow(); | |
| 15 } | |
| 16 | |
| 17 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { | 13 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { |
| 18 DCHECK(window); | 14 DCHECK(window); |
| 19 return window; | 15 return window; |
| 20 } | 16 } |
| 21 | 17 |
| 22 gfx::NativeView GetParent(gfx::NativeView view) { | 18 gfx::NativeView GetParent(gfx::NativeView view) { |
| 23 return view->parent(); | 19 return view->parent(); |
| 24 } | 20 } |
| 25 | 21 |
| 26 bool IsWindowActive(gfx::NativeWindow window) { | 22 bool IsWindowActive(gfx::NativeWindow window) { |
| 27 return wm::IsActiveWindow(window); | 23 return wm::IsActiveWindow(window); |
| 28 } | 24 } |
| 29 | 25 |
| 30 void ActivateWindow(gfx::NativeWindow window) { | 26 void ActivateWindow(gfx::NativeWindow window) { |
| 31 wm::ActivateWindow(window); | 27 wm::ActivateWindow(window); |
| 32 } | 28 } |
| 33 | 29 |
| 34 bool IsVisible(gfx::NativeView view) { | 30 bool IsVisible(gfx::NativeView view) { |
| 35 return view->IsVisible(); | 31 return view->IsVisible(); |
| 36 } | 32 } |
| 37 | 33 |
| 38 } // namespace platform_util | 34 } // namespace platform_util |
| OLD | NEW |