native_desktop_media_list.h depends on //chrome/app:generated_resources

This commit is contained in:
Jeremy Apthorp 2018-10-03 13:50:07 -07:00
Родитель 8eb15f7554
Коммит 647322e299
4 изменённых файлов: 42 добавлений и 31 удалений

Просмотреть файл

@ -1,12 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<!-- The Resource ids for messages start from 31750 and for includes
it starts from 31950, make sure they don't overlap when the limit
exceeds in //tools/gritsettings/resource_ids -->
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"
source_lang_id="en">
<outputs>
<output filename="grit/electron_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="electron_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<release seq="1" allow_pseudo="false">
<messages fallback_to_english="true">
<!-- TODO(deepak1556): Add translations,
check https://www.chromium.org/developers/design-documents/ui-localization -->
<part file="electron_strings.grdp" />
</messages>
<includes>
<include name="IDR_ELECTRON_CONTENT_BROWSER_MANIFEST_OVERLAY" file="${target_gen_dir}\electron_content_browser_manifest_overlay.json" use_base_dir="false" type="BINDATA" />
<include name="IDR_ELECTRON_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY" file="${target_gen_dir}\electron_content_packaged_services_manifest_overlay.json" use_base_dir="false" type="BINDATA" />

15
electron_strings.grdp Normal file
Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<!-- Proxy Resolver Service -->
<message name="IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME" desc="The name of the utility process used for out-of-process V8 proxy resolution.">
V8 Proxy Resolver
</message>
<!-- Desktop Capturer API -->
<message name="IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there is only one monitor.">
Entire screen
</message>
<message name="IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there are multiple monitors.">
{SCREEN_INDEX, plural, =1{Screen #} other{Screen #}}
</message>
</grit-part>

Просмотреть файл

@ -123,10 +123,10 @@ index 47401abc984e..ca6a527ffac8 100644
protected:
virtual ~DesktopMediaListObserver() {}
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 0c9ba953cb3c..5a2d853aeeac 100644
index 0c9ba953cb3c..c2482774f074 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -5,10 +5,16 @@
@@ -5,11 +5,15 @@
#include "chrome/browser/media/webrtc/native_desktop_media_list.h"
#include "base/hash.h"
@ -137,13 +137,13 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
+#include "base/threading/thread_restrictions.h"
+#include "build/build_config.h"
#include "chrome/browser/media/webrtc/desktop_media_list_observer.h"
+#if 0
#include "chrome/grit/generated_resources.h"
+#endif
-#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h"
+#include "electron/grit/electron_resources.h"
#include "media/base/video_util.h"
#include "third_party/libyuv/include/libyuv/scale_argb.h"
@@ -76,11 +82,13 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
#include "third_party/skia/include/core/SkBitmap.h"
@@ -76,11 +80,13 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
class NativeDesktopMediaList::Worker
: public webrtc::DesktopCapturer::Callback {
public:
@ -158,7 +158,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
void Refresh(const DesktopMediaID::Id& view_dialog_id);
void RefreshThumbnails(const std::vector<DesktopMediaID>& native_ids,
@@ -93,6 +101,9 @@ class NativeDesktopMediaList::Worker
@@ -93,6 +99,9 @@ class NativeDesktopMediaList::Worker
void OnCaptureResult(webrtc::DesktopCapturer::Result result,
std::unique_ptr<webrtc::DesktopFrame> frame) override;
@ -168,7 +168,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
base::WeakPtr<NativeDesktopMediaList> media_list_;
DesktopMediaID::Type type_;
@@ -106,17 +117,27 @@ class NativeDesktopMediaList::Worker
@@ -106,17 +115,27 @@ class NativeDesktopMediaList::Worker
};
NativeDesktopMediaList::Worker::Worker(
@ -199,21 +199,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
std::vector<SourceDescription> result;
webrtc::DesktopCapturer::SourceList sources;
@@ -133,11 +154,8 @@ void NativeDesktopMediaList::Worker::Refresh(
// Just in case 'Screen' is inflected depending on the screen number,
// use plural formatter.
title = mutiple_sources
- ? l10n_util::GetPluralStringFUTF16(
- IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME,
- static_cast<int>(i + 1))
- : l10n_util::GetStringUTF16(
- IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME);
+ ? base::UTF8ToUTF16("Screen " + base::IntToString(i + 1))
+ : base::UTF8ToUTF16("Entire screen");
break;
case DesktopMediaID::TYPE_WINDOW:
@@ -163,6 +181,7 @@ void NativeDesktopMediaList::Worker::Refresh(
@@ -163,6 +182,7 @@ void NativeDesktopMediaList::Worker::Refresh(
void NativeDesktopMediaList::Worker::RefreshThumbnails(
const std::vector<DesktopMediaID>& native_ids,
const gfx::Size& thumbnail_size) {
@ -221,7 +207,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
ImageHashesMap new_image_hashes;
// Get a thumbnail for each native source.
@@ -210,17 +229,30 @@ NativeDesktopMediaList::NativeDesktopMediaList(
@@ -210,17 +230,30 @@ NativeDesktopMediaList::NativeDesktopMediaList(
std::unique_ptr<webrtc::DesktopCapturer> capturer)
: DesktopMediaListBase(base::TimeDelta::FromMilliseconds(
kDefaultNativeDesktopMediaListUpdatePeriod)),
@ -257,7 +243,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
}
void NativeDesktopMediaList::Refresh() {
@@ -230,7 +262,7 @@ void NativeDesktopMediaList::Refresh() {
@@ -230,7 +263,7 @@ void NativeDesktopMediaList::Refresh() {
new_aura_thumbnail_hashes_.clear();
#endif
@ -266,7 +252,7 @@ index 0c9ba953cb3c..5a2d853aeeac 100644
FROM_HERE,
base::BindOnce(&Worker::Refresh, base::Unretained(worker_.get()),
view_dialog_id_.id));
@@ -280,7 +312,7 @@ void NativeDesktopMediaList::RefreshForAuraWindows(
@@ -280,7 +313,7 @@ void NativeDesktopMediaList::RefreshForAuraWindows(
#if defined(USE_AURA)
pending_native_thumbnail_capture_ = true;
#endif

Просмотреть файл

@ -1,13 +1,14 @@
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids
index fc16a42e623e..8faa1363e177 100644
index efa6e5c90b88..a40476bb9c87 100644
--- a/tools/gritsettings/resource_ids
+++ b/tools/gritsettings/resource_ids
@@ -407,6 +407,10 @@
@@ -407,6 +407,11 @@
"includes": [28900],
},
+ "electron/electron_resources.grd": {
+ "includes": [31750],
+ "messages": [31750],
+ "includes": [31950],
+ },
+
# END "everything else" section.