Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / desktop_aura / ozone_util.cc
1 // Copyright 2014 Intel Corporation. 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.
4
5 #include "ozone/ui/desktop_aura/ozone_util.h"
6
7 #include <set>
8 #include <vector>
9
10 #include "chrome/browser/ui/views/tabs/window_finder.h"
11 #include "ozone/ui/desktop_aura/desktop_window_tree_host_ozone.h"
12
13 namespace ui {
14
15 VIEWS_EXPORT bool GetCustomFramePrefDefault() {
16   return true;
17 }
18
19 }  // namespace ui
20
21 VIEWS_EXPORT bool IsFullScreenMode() {
22   std::vector<aura::Window*> all_windows =
23       views::DesktopWindowTreeHostOzone::GetAllOpenWindows();
24   // Only the topmost window is checked. This works fine in the most cases, but
25   // it may return false when there are multiple displays and one display has
26   // a fullscreen window but others don't. See: crbug.com/345484
27   if (all_windows.empty())
28     return false;
29
30   views::Widget* widget =
31       views::Widget::GetWidgetForNativeWindow(all_windows[0]);
32   return widget && widget->IsFullscreen();
33 }
34
35 // TODO(Kalyan): Remove this once https://codereview.chromium.org/176893002/
36 // is fixed.
37 VIEWS_EXPORT aura::Window* GetLocalProcessWindowAtPoint(
38     chrome::HostDesktopType host_desktop_type,
39     const gfx::Point& screen_point,
40     const std::set<aura::Window*>& ignore) {
41   return NULL;
42 }