Commit 9a9d6e98 authored by Weiyong Yao's avatar Weiyong Yao Committed by Commit Bot

[desktopCapture] set the windows in correct order in the picker list

CrOS enumerates the top-level windows in a reverse order, not like other
platforms, e.g. the current active window is returned at last.
This cl is to reverse the windows order at creating the |sources| list.

Bug: 874235
Change-Id: Ic0a3b2dc6aa8c9378ec20d2fd476130f8ddb534d
Reviewed-on: https://chromium-review.googlesource.com/1175143Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Weiyong Yao <braveyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583107}
parent acf4b989
......@@ -52,8 +52,12 @@ void DesktopMediaListAsh::EnumerateWindowsForRoot(
aura::Window* container = ash::Shell::GetContainer(root_window, container_id);
if (!container)
return;
for (aura::Window::Windows::const_iterator it = container->children().begin();
it != container->children().end(); ++it) {
// The |container| has all the top-level windows in reverse order, e.g. the
// most top-level window is at the end. So iterate children reversely to make
// sure |sources| is in the expected order.
for (aura::Window::Windows::const_reverse_iterator it =
container->children().rbegin();
it != container->children().rend(); ++it) {
if (!(*it)->IsVisible() || !(*it)->CanFocus())
continue;
content::DesktopMediaID id = content::DesktopMediaID::RegisterAuraWindow(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment