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/logging.h"
8 #include "ui/aura/window.h"
11 #include "ash/wm/window_util.h"
14 namespace platform_util
{
16 gfx::NativeWindow
GetTopLevel(gfx::NativeView view
) {
17 return view
->GetToplevelWindow();
20 gfx::NativeView
GetViewForWindow(gfx::NativeWindow window
) {
25 gfx::NativeView
GetParent(gfx::NativeView view
) {
26 return view
->parent();
29 bool IsWindowActive(gfx::NativeWindow window
) {
31 return ash::wm::IsActiveWindow(window
);
38 void ActivateWindow(gfx::NativeWindow window
) {
40 ash::wm::ActivateWindow(window
);
46 bool IsVisible(gfx::NativeView view
) {
47 return view
->IsVisible();
50 } // namespace platform_util