tonikitoo | b10ea66f | 2016-11-07 23:52:01 | [diff] [blame] | 1 | // Copyright 2016 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. |
| 4 | |
| 5 | #include "chrome/browser/fullscreen.h" |
| 6 | |
Alexander Dunaev | 8e71990 | 2019-07-18 08:37:39 | [diff] [blame] | 7 | #include <algorithm> |
tonikitoo | b10ea66f | 2016-11-07 23:52:01 | [diff] [blame] | 8 | |
Alexander Dunaev | 8e71990 | 2019-07-18 08:37:39 | [diff] [blame] | 9 | #include "chrome/browser/ui/browser.h" |
| 10 | #include "chrome/browser/ui/browser_list.h" |
| 11 | #include "chrome/browser/ui/browser_window.h" |
| 12 | |
| 13 | // The Ozone implementation is limited to chrome only: it checks whether any |
| 14 | // existing browser object has a fullscreen window, but does not try to find |
| 15 | // if there are ones belonging to other applications. |
Tom Anderson | 13e9b84 | 2017-11-02 20:07:35 | [diff] [blame] | 16 | bool IsFullScreenMode() { |
Alexander Dunaev | 8e71990 | 2019-07-18 08:37:39 | [diff] [blame] | 17 | const auto* list = BrowserList::GetInstance(); |
| 18 | return std::any_of(list->begin(), list->end(), [](const Browser* browser) { |
| 19 | return browser->window()->IsFullscreen(); |
| 20 | }); |
tonikitoo | b10ea66f | 2016-11-07 23:52:01 | [diff] [blame] | 21 | } |