OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/media/desktop_media_list_ash.h" | 5 #include "chrome/browser/media/desktop_media_list_ash.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 std::vector<DesktopMediaListAsh::SourceDescription>* sources) { | 173 std::vector<DesktopMediaListAsh::SourceDescription>* sources) { |
174 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 174 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
175 | 175 |
176 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); | 176 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); |
177 | 177 |
178 for (aura::Window::Windows::const_iterator iter = root_windows.begin(); | 178 for (aura::Window::Windows::const_iterator iter = root_windows.begin(); |
179 iter != root_windows.end(); ++iter) { | 179 iter != root_windows.end(); ++iter) { |
180 if (source_types_ & SCREENS) { | 180 if (source_types_ & SCREENS) { |
181 SourceDescription screen_source( | 181 SourceDescription screen_source( |
182 content::DesktopMediaID::RegisterAuraWindow(*iter), (*iter)->title()); | 182 content::DesktopMediaID::RegisterAuraWindow(*iter), (*iter)->title()); |
183 sources->push_back(screen_source); | 183 if (*iter == ash::Shell::GetPrimaryRootWindow()) |
184 sources->insert(sources->begin(), screen_source); | |
Sergey Ulanov
2014/05/19 18:59:33
nit: add {} here and for the else case.
| |
185 else | |
186 sources->push_back(screen_source); | |
184 | 187 |
185 CaptureThumbnail(screen_source.id, *iter); | 188 CaptureThumbnail(screen_source.id, *iter); |
186 } | 189 } |
187 | 190 |
188 if (source_types_ & WINDOWS) { | 191 if (source_types_ & WINDOWS) { |
189 EnumerateWindowsForRoot( | 192 EnumerateWindowsForRoot( |
190 sources, *iter, ash::kShellWindowId_DefaultContainer); | 193 sources, *iter, ash::kShellWindowId_DefaultContainer); |
191 EnumerateWindowsForRoot( | 194 EnumerateWindowsForRoot( |
192 sources, *iter, ash::kShellWindowId_AlwaysOnTopContainer); | 195 sources, *iter, ash::kShellWindowId_AlwaysOnTopContainer); |
193 EnumerateWindowsForRoot( | 196 EnumerateWindowsForRoot( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 if (!pending_window_capture_requests_) { | 232 if (!pending_window_capture_requests_) { |
230 // Once we've finished capturing all windows post a task for the next list | 233 // Once we've finished capturing all windows post a task for the next list |
231 // update. | 234 // update. |
232 BrowserThread::PostDelayedTask( | 235 BrowserThread::PostDelayedTask( |
233 BrowserThread::UI, FROM_HERE, | 236 BrowserThread::UI, FROM_HERE, |
234 base::Bind(&DesktopMediaListAsh::Refresh, | 237 base::Bind(&DesktopMediaListAsh::Refresh, |
235 weak_factory_.GetWeakPtr()), | 238 weak_factory_.GetWeakPtr()), |
236 update_period_); | 239 update_period_); |
237 } | 240 } |
238 } | 241 } |
OLD | NEW |