blob: e416c08f0fa3d79ea5f0f70c17ae4c6d2e82cc20 [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
Hans Wennborg1790e6b2020-04-24 19:10:337#include "base/check.h"
[email protected]f94f0f12011-09-14 21:14:018#include "ui/aura/window.h"
scottmg147142b2016-02-19 00:28:209#include "ui/wm/core/window_util.h"
[email protected]65d120442012-04-12 02:09:1610
[email protected]94fbaa42011-09-07 20:09:5411namespace platform_util {
12
[email protected]94fbaa42011-09-07 20:09:5413gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
[email protected]9331fce2011-11-30 21:48:3214 return view->GetToplevelWindow();
[email protected]94fbaa42011-09-07 20:09:5415}
16
andresantosof8f9fd182014-11-15 01:14:3917gfx::NativeView GetViewForWindow(gfx::NativeWindow window) {
18 DCHECK(window);
19 return window;
20}
21
[email protected]94fbaa42011-09-07 20:09:5422gfx::NativeView GetParent(gfx::NativeView view) {
23 return view->parent();
24}
25
26bool IsWindowActive(gfx::NativeWindow window) {
scottmg147142b2016-02-19 00:28:2027 return wm::IsActiveWindow(window);
[email protected]94fbaa42011-09-07 20:09:5428}
29
30void ActivateWindow(gfx::NativeWindow window) {
scottmg147142b2016-02-19 00:28:2031 wm::ActivateWindow(window);
[email protected]94fbaa42011-09-07 20:09:5432}
33
34bool IsVisible(gfx::NativeView view) {
[email protected]908fbf42011-10-05 14:40:1735 return view->IsVisible();
[email protected]94fbaa42011-09-07 20:09:5436}
37
38} // namespace platform_util