| 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 "ash/wm/window_util.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 10 | 9 |
| 10 #if defined(USE_ASH) |
| 11 #include "ash/wm/window_util.h" |
| 12 #endif |
| 13 |
| 11 namespace platform_util { | 14 namespace platform_util { |
| 12 | 15 |
| 13 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | 16 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
| 14 return view->GetToplevelWindow(); | 17 return view->GetToplevelWindow(); |
| 15 } | 18 } |
| 16 | 19 |
| 17 gfx::NativeView GetParent(gfx::NativeView view) { | 20 gfx::NativeView GetParent(gfx::NativeView view) { |
| 18 return view->parent(); | 21 return view->parent(); |
| 19 } | 22 } |
| 20 | 23 |
| 21 bool IsWindowActive(gfx::NativeWindow window) { | 24 bool IsWindowActive(gfx::NativeWindow window) { |
| 25 #if defined(USE_ASH) |
| 22 return ash::wm::IsActiveWindow(window); | 26 return ash::wm::IsActiveWindow(window); |
| 27 #else |
| 28 NOTIMPLEMENTED(); |
| 29 return false; |
| 30 #endif |
| 23 } | 31 } |
| 24 | 32 |
| 25 void ActivateWindow(gfx::NativeWindow window) { | 33 void ActivateWindow(gfx::NativeWindow window) { |
| 34 #if defined(USE_ASH) |
| 26 ash::wm::ActivateWindow(window); | 35 ash::wm::ActivateWindow(window); |
| 36 #else |
| 37 NOTIMPLEMENTED(); |
| 38 #endif |
| 27 } | 39 } |
| 28 | 40 |
| 29 bool IsVisible(gfx::NativeView view) { | 41 bool IsVisible(gfx::NativeView view) { |
| 30 return view->IsVisible(); | 42 return view->IsVisible(); |
| 31 } | 43 } |
| 32 | 44 |
| 33 } // namespace platform_util | 45 } // namespace platform_util |
| OLD | NEW |