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/native_desktop_media_list.h" | 5 #include "chrome/browser/media/native_desktop_media_list.h" |
6 | 6 |
7 #include "base/hash.h" | 7 #include "base/hash.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "chrome/browser/media/desktop_media_list_observer.h" | 10 #include "chrome/browser/media/desktop_media_list_observer.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 const DesktopMediaID::Id& view_dialog_id) { | 129 const DesktopMediaID::Id& view_dialog_id) { |
130 std::vector<SourceDescription> sources; | 130 std::vector<SourceDescription> sources; |
131 | 131 |
132 if (screen_capturer_) { | 132 if (screen_capturer_) { |
133 webrtc::ScreenCapturer::ScreenList screens; | 133 webrtc::ScreenCapturer::ScreenList screens; |
134 if (screen_capturer_->GetScreenList(&screens)) { | 134 if (screen_capturer_->GetScreenList(&screens)) { |
135 bool mutiple_screens = screens.size() > 1; | 135 bool mutiple_screens = screens.size() > 1; |
136 base::string16 title; | 136 base::string16 title; |
137 for (size_t i = 0; i < screens.size(); ++i) { | 137 for (size_t i = 0; i < screens.size(); ++i) { |
138 if (mutiple_screens) { | 138 if (mutiple_screens) { |
139 title = l10n_util::GetStringFUTF16Int( | 139 // Just in case 'Screen' is inflected depending on the screen number, |
| 140 // use plural formatter. |
| 141 title = l10n_util::GetPluralStringFUTF16( |
140 IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME, | 142 IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME, |
141 static_cast<int>(i + 1)); | 143 static_cast<int>(i + 1)); |
142 } else { | 144 } else { |
143 title = l10n_util::GetStringUTF16( | 145 title = l10n_util::GetStringUTF16( |
144 IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME); | 146 IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME); |
145 } | 147 } |
146 sources.push_back(SourceDescription(DesktopMediaID( | 148 sources.push_back(SourceDescription(DesktopMediaID( |
147 DesktopMediaID::TYPE_SCREEN, screens[i].id), title)); | 149 DesktopMediaID::TYPE_SCREEN, screens[i].id), title)); |
148 } | 150 } |
149 } | 151 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 if (pending_aura_capture_requests_ == 0) { | 365 if (pending_aura_capture_requests_ == 0) { |
364 previous_aura_thumbnail_hashes_ = std::move(new_aura_thumbnail_hashes_); | 366 previous_aura_thumbnail_hashes_ = std::move(new_aura_thumbnail_hashes_); |
365 // Schedule next refresh if aura thumbnail captures finished after native | 367 // Schedule next refresh if aura thumbnail captures finished after native |
366 // thumbnail captures. | 368 // thumbnail captures. |
367 if (!pending_native_thumbnail_capture_) | 369 if (!pending_native_thumbnail_capture_) |
368 ScheduleNextRefresh(); | 370 ScheduleNextRefresh(); |
369 } | 371 } |
370 } | 372 } |
371 | 373 |
372 #endif // defined(USE_AURA) | 374 #endif // defined(USE_AURA) |
OLD | NEW |