• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
14 namespace platform_util {
15 
GetTopLevel(gfx::NativeView view)16 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
17   return view->GetToplevelWindow();
18 }
19 
GetParent(gfx::NativeView view)20 gfx::NativeView GetParent(gfx::NativeView view) {
21   return view->parent();
22 }
23 
IsWindowActive(gfx::NativeWindow window)24 bool 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 
ActivateWindow(gfx::NativeWindow window)33 void ActivateWindow(gfx::NativeWindow window) {
34 #if defined(USE_ASH)
35   ash::wm::ActivateWindow(window);
36 #else
37   NOTIMPLEMENTED();
38 #endif
39 }
40 
IsVisible(gfx::NativeView view)41 bool IsVisible(gfx::NativeView view) {
42   return view->IsVisible();
43 }
44 
45 }  // namespace platform_util
46