summaryrefslogtreecommitdiffstats
path: root/chrome/browser/fullscreen_ash.cc
blob: a0951cb4a8c1f3519150de02aee8c3d08328634e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/fullscreen.h"

#include "ash/shell.h"
#include "base/logging.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"

namespace {

bool CheckIfFullscreenWindowExists(aura::Window* window) {
  if (window->GetProperty(aura::client::kShowStateKey) ==
      ui::SHOW_STATE_FULLSCREEN)
    return true;
  aura::Window::Windows children = window->children();
  for (aura::Window::Windows::const_iterator i = children.begin();
       i != children.end();
       ++i) {
    if (CheckIfFullscreenWindowExists(*i))
      return true;
  }
  return false;
}

}  // namespace

bool IsFullScreenMode() {
  // This is used only by notification_ui_manager.cc. On aura, notification
  // will be managed in panel. This is temporary to get certain feature running
  // until we implement it for aura.
  return CheckIfFullscreenWindowExists(ash::Shell::GetPrimaryRootWindow());
}