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. 4 5#include "chrome/browser/platform_util.h" 6 7#include "base/logging.h" 8#include "ui/aura/window.h" 9 10#if defined(USE_ASH) 11#include "ash/wm/window_util.h" 12#endif 13 14namespace platform_util { 15 16gfx::NativeWindow GetTopLevel(gfx::NativeView view) { 17 return view->GetToplevelWindow(); 18} 19 20gfx::NativeView GetParent(gfx::NativeView view) { 21 return view->parent(); 22} 23 24bool IsWindowActive(gfx::NativeWindow window) { 25#if defined(USE_ASH) 26 return ash::wm::IsActiveWindow(window); 27#else 28 NOTIMPLEMENTED(); 29 return false; 30#endif 31} 32 33void ActivateWindow(gfx::NativeWindow window) { 34#if defined(USE_ASH) 35 ash::wm::ActivateWindow(window); 36#else 37 NOTIMPLEMENTED(); 38#endif 39} 40 41bool IsVisible(gfx::NativeView view) { 42 return view->IsVisible(); 43} 44 45} // namespace platform_util 46