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 "ash/wm/video_detector.h" | 5 #include "ash/wm/video_detector.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return; | 124 return; |
125 | 125 |
126 // As a relatively-cheap way to avoid flipping back and forth between | 126 // As a relatively-cheap way to avoid flipping back and forth between |
127 // fullscreen and non-fullscreen notifications when one video is playing in a | 127 // fullscreen and non-fullscreen notifications when one video is playing in a |
128 // fullscreen window and a second video is playing in a non-fullscreen window, | 128 // fullscreen window and a second video is playing in a non-fullscreen window, |
129 // report fullscreen video whenever a fullscreen window exists on any desktop | 129 // report fullscreen video whenever a fullscreen window exists on any desktop |
130 // regardless of whether the video is actually playing in that window: | 130 // regardless of whether the video is actually playing in that window: |
131 // http://crbug.com/340666 | 131 // http://crbug.com/340666 |
132 bool fullscreen_window_exists = false; | 132 bool fullscreen_window_exists = false; |
133 std::vector<aura::Window*> containers = | 133 std::vector<aura::Window*> containers = |
134 Shell::GetContainersFromAllRootWindows( | 134 Shell::GetContainersFromAllRootWindows(kShellWindowId_DefaultContainer, |
135 internal::kShellWindowId_DefaultContainer, NULL); | 135 NULL); |
136 for (std::vector<aura::Window*>::const_iterator container = | 136 for (std::vector<aura::Window*>::const_iterator container = |
137 containers.begin(); container != containers.end(); ++container) { | 137 containers.begin(); container != containers.end(); ++container) { |
138 const aura::Window::Windows& windows = (*container)->children(); | 138 const aura::Window::Windows& windows = (*container)->children(); |
139 for (aura::Window::Windows::const_iterator window = windows.begin(); | 139 for (aura::Window::Windows::const_iterator window = windows.begin(); |
140 window != windows.end(); ++window) { | 140 window != windows.end(); ++window) { |
141 if (wm::GetWindowState(*window)->IsFullscreen()) { | 141 if (wm::GetWindowState(*window)->IsFullscreen()) { |
142 fullscreen_window_exists = true; | 142 fullscreen_window_exists = true; |
143 break; | 143 break; |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 FOR_EACH_OBSERVER(VideoDetectorObserver, | 148 FOR_EACH_OBSERVER(VideoDetectorObserver, |
149 observers_, | 149 observers_, |
150 OnVideoDetected(fullscreen_window_exists)); | 150 OnVideoDetected(fullscreen_window_exists)); |
151 last_observer_notification_time_ = now; | 151 last_observer_notification_time_ = now; |
152 } | 152 } |
153 | 153 |
154 } // namespace ash | 154 } // namespace ash |
OLD | NEW |