[email protected] | 0477e8e6 | 2012-02-27 12:05:29 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 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 | |||||
Hans Wennborg | 1790e6b | 2020-04-24 19:10:33 | [diff] [blame] | 7 | #include "base/check.h" |
[email protected] | f94f0f1 | 2011-09-14 21:14:01 | [diff] [blame] | 8 | #include "ui/aura/window.h" |
scottmg | 147142b | 2016-02-19 00:28:20 | [diff] [blame] | 9 | #include "ui/wm/core/window_util.h" |
[email protected] | 65d12044 | 2012-04-12 02:09:16 | [diff] [blame] | 10 | |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 11 | namespace platform_util { |
12 | |||||
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 13 | gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
[email protected] | 9331fce | 2011-11-30 21:48:32 | [diff] [blame] | 14 | return view->GetToplevelWindow(); |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 15 | } |
16 | |||||
andresantoso | f8f9fd18 | 2014-11-15 01:14:39 | [diff] [blame] | 17 | gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { |
18 | DCHECK(window); | ||||
19 | return window; | ||||
20 | } | ||||
21 | |||||
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 22 | gfx::NativeView GetParent(gfx::NativeView view) { |
23 | return view->parent(); | ||||
24 | } | ||||
25 | |||||
26 | bool IsWindowActive(gfx::NativeWindow window) { | ||||
scottmg | 147142b | 2016-02-19 00:28:20 | [diff] [blame] | 27 | return wm::IsActiveWindow(window); |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 28 | } |
29 | |||||
30 | void ActivateWindow(gfx::NativeWindow window) { | ||||
scottmg | 147142b | 2016-02-19 00:28:20 | [diff] [blame] | 31 | wm::ActivateWindow(window); |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 32 | } |
33 | |||||
34 | bool IsVisible(gfx::NativeView view) { | ||||
[email protected] | 908fbf4 | 2011-10-05 14:40:17 | [diff] [blame] | 35 | return view->IsVisible(); |
[email protected] | 94fbaa4 | 2011-09-07 20:09:54 | [diff] [blame] | 36 | } |
37 | |||||
38 | } // namespace platform_util |