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

Unified Diff: chrome/browser/extensions/api/tab_capture/offscreen_tab.cc

Issue 2555743008: [Presentation API] set presentation_receiver flag in offscreen tab (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
diff --git a/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc b/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
index 572b90cfc24bde8ecb4f6c81c330dc6f9752f63b..776dd0a32817053d059482c3f2e15d8522bef0cc 100644
--- a/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
+++ b/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
@@ -12,8 +12,10 @@
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/web_contents_sizer.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/web_preferences.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/process_manager.h"
@@ -120,6 +122,13 @@ void OffscreenTab::Start(const GURL& start_url,
if (!optional_presentation_id.empty()) {
NOTIMPLEMENTED()
<< "Register with PresentationRouter, id=" << optional_presentation_id;
+
+ if (auto* render_view_host =
+ offscreen_tab_web_contents_->GetRenderViewHost()) {
+ auto web_prefs = render_view_host->GetWebkitPreferences();
+ web_prefs.presentation_receiver = true;
+ render_view_host->UpdateWebkitPreferences(web_prefs);
+ }
}
// Navigate to the initial URL.
« 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