Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / platform_util_aura.cc
blobdb3a343893373b0ddca83fbdbbe1d47a4cbffbc3
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
3 // found in the LICENSE file.
5 #include "chrome/browser/platform_util.h"
7 #include "base/logging.h"
8 #include "ui/aura/window.h"
10 #if defined(USE_ASH)
11 #include "ash/wm/window_util.h"
12 #endif
14 namespace platform_util {
16 gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
17 return view->GetToplevelWindow();
20 gfx::NativeView GetViewForWindow(gfx::NativeWindow window) {
21 DCHECK(window);
22 return window;
25 gfx::NativeView GetParent(gfx::NativeView view) {
26 return view->parent();
29 bool IsWindowActive(gfx::NativeWindow window) {
30 #if defined(USE_ASH)
31 return ash::wm::IsActiveWindow(window);
32 #else
33 NOTIMPLEMENTED();
34 return false;
35 #endif
38 void ActivateWindow(gfx::NativeWindow window) {
39 #if defined(USE_ASH)
40 ash::wm::ActivateWindow(window);
41 #else
42 NOTIMPLEMENTED();
43 #endif
46 bool IsVisible(gfx::NativeView view) {
47 return view->IsVisible();
50 } // namespace platform_util