blob: c56591f0a2c97a406b972bead2b1d5717637f569 [file] [log] [blame]
[email protected]0477e8e62012-02-27 12:05:291// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]94fbaa42011-09-07 20:09:542// 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
[email protected]94fbaa42011-09-07 20:09:547#include "base/logging.h"
[email protected]f94f0f12011-09-14 21:14:018#include "ui/aura/window.h"
[email protected]94fbaa42011-09-07 20:09:549
[email protected]65d120442012-04-12 02:09:1610#if defined(USE_ASH)
11#include "ash/wm/window_util.h"
12#endif
13
[email protected]94fbaa42011-09-07 20:09:5414namespace platform_util {
15
[email protected]94fbaa42011-09-07 20:09:5416gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
[email protected]9331fce2011-11-30 21:48:3217 return view->GetToplevelWindow();
[email protected]94fbaa42011-09-07 20:09:5418}
19
20gfx::NativeView GetParent(gfx::NativeView view) {
21 return view->parent();
22}
23
24bool IsWindowActive(gfx::NativeWindow window) {
[email protected]65d120442012-04-12 02:09:1625#if defined(USE_ASH)
[email protected]0477e8e62012-02-27 12:05:2926 return ash::wm::IsActiveWindow(window);
[email protected]65d120442012-04-12 02:09:1627#else
28 NOTIMPLEMENTED();
29 return false;
30#endif
[email protected]94fbaa42011-09-07 20:09:5431}
32
33void ActivateWindow(gfx::NativeWindow window) {
[email protected]65d120442012-04-12 02:09:1634#if defined(USE_ASH)
[email protected]0477e8e62012-02-27 12:05:2935 ash::wm::ActivateWindow(window);
[email protected]65d120442012-04-12 02:09:1636#else
37 NOTIMPLEMENTED();
38#endif
[email protected]94fbaa42011-09-07 20:09:5439}
40
41bool IsVisible(gfx::NativeView view) {
[email protected]908fbf42011-10-05 14:40:1742 return view->IsVisible();
[email protected]94fbaa42011-09-07 20:09:5443}
44
45} // namespace platform_util