Place primary screen before secondary screens in picker

The DesktopMediaPicker treats the contents of the DesktopMediaList as an
ordered list of sources. This change ensures the primary display is
always in the first position in the picker.

BUG=372444
TEST=Under ChromeOS connect/disconnect/reconnect secondary screen and
observe that the primary display is in the first position in the picker.

Review URL: https://codereview.chromium.org/283573002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271669 0039d316-1c4b-4281-b951-d872f2087c98
parent 44f10198
...@@ -180,7 +180,11 @@ void DesktopMediaListAsh::EnumerateSources( ...@@ -180,7 +180,11 @@ void DesktopMediaListAsh::EnumerateSources(
if (source_types_ & SCREENS) { if (source_types_ & SCREENS) {
SourceDescription screen_source( SourceDescription screen_source(
content::DesktopMediaID::RegisterAuraWindow(*iter), (*iter)->title()); content::DesktopMediaID::RegisterAuraWindow(*iter), (*iter)->title());
sources->push_back(screen_source); if (*iter == ash::Shell::GetPrimaryRootWindow()) {
sources->insert(sources->begin(), screen_source);
} else {
sources->push_back(screen_source);
}
CaptureThumbnail(screen_source.id, *iter); CaptureThumbnail(screen_source.id, *iter);
} }
......
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