OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 | 9 #include "ui/wm/core/window_util.h" |
10 #if defined(USE_ASH) | |
11 #include "ash/wm/window_util.h" | |
12 #endif | |
13 | 10 |
14 namespace platform_util { | 11 namespace platform_util { |
15 | 12 |
16 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | 13 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
17 return view->GetToplevelWindow(); | 14 return view->GetToplevelWindow(); |
18 } | 15 } |
19 | 16 |
20 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { | 17 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) { |
21 DCHECK(window); | 18 DCHECK(window); |
22 return window; | 19 return window; |
23 } | 20 } |
24 | 21 |
25 gfx::NativeView GetParent(gfx::NativeView view) { | 22 gfx::NativeView GetParent(gfx::NativeView view) { |
26 return view->parent(); | 23 return view->parent(); |
27 } | 24 } |
28 | 25 |
29 bool IsWindowActive(gfx::NativeWindow window) { | 26 bool IsWindowActive(gfx::NativeWindow window) { |
30 #if defined(USE_ASH) | 27 return wm::IsActiveWindow(window); |
31 return ash::wm::IsActiveWindow(window); | |
32 #else | |
33 NOTIMPLEMENTED(); | |
34 return false; | |
35 #endif | |
36 } | 28 } |
37 | 29 |
38 void ActivateWindow(gfx::NativeWindow window) { | 30 void ActivateWindow(gfx::NativeWindow window) { |
39 #if defined(USE_ASH) | 31 wm::ActivateWindow(window); |
40 ash::wm::ActivateWindow(window); | |
41 #else | |
42 NOTIMPLEMENTED(); | |
43 #endif | |
44 } | 32 } |
45 | 33 |
46 bool IsVisible(gfx::NativeView view) { | 34 bool IsVisible(gfx::NativeView view) { |
47 return view->IsVisible(); | 35 return view->IsVisible(); |
48 } | 36 } |
49 | 37 |
50 } // namespace platform_util | 38 } // namespace platform_util |
OLD | NEW |