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
3 // found in the LICENSE file.
5 #include "chrome/browser/platform_util.h"
7 #include "base/check.h"
8 #include "ui/aura/window.h"
9 #include "ui/wm/core/window_util.h"
11 namespace platform_util {
13 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
14 return view->GetToplevelWindow();
17 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) {
22 gfx::NativeView GetParent(gfx::NativeView view) {
23 return view->parent();
26 bool IsWindowActive(gfx::NativeWindow window) {
27 return wm::IsActiveWindow(window);
30 void ActivateWindow(gfx::NativeWindow window) {
31 wm::ActivateWindow(window);
34 bool IsVisible(gfx::NativeView view) {
35 return view->IsVisible();
38 } // namespace platform_util