Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: chrome/browser/media/desktop_media_list_ash.cc

Issue 283573002: Place primary screen before secondary screens in picker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@output-order-fix
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698