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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/offscreen_tab.cc

Issue 2674273003: Revert of [Presentation API] (5th) (1-UA) integrate controller and receiver side for 1-UA messaging (Closed)
Patch Set: Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/router/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/tab_capture/offscreen_tab.h" 5 #include "chrome/browser/extensions/api/tab_capture/offscreen_tab.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" 12 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
13 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
14 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/web_contents_sizer.h" 14 #include "chrome/browser/ui/web_contents_sizer.h"
16 #include "content/public/browser/render_view_host.h" 15 #include "content/public/browser/render_view_host.h"
17 #include "content/public/browser/render_widget_host_view.h" 16 #include "content/public/browser/render_widget_host_view.h"
18 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
19 #include "content/public/common/web_preferences.h" 18 #include "content/public/common/web_preferences.h"
20 #include "extensions/browser/extension_host.h" 19 #include "extensions/browser/extension_host.h"
21 #include "extensions/browser/process_manager.h" 20 #include "extensions/browser/process_manager.h"
22 21
23 using content::WebContents; 22 using content::WebContents;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 110
112 // Set initial size, if specified. 111 // Set initial size, if specified.
113 if (!initial_size.IsEmpty()) 112 if (!initial_size.IsEmpty())
114 ResizeWebContents(offscreen_tab_web_contents_.get(), 113 ResizeWebContents(offscreen_tab_web_contents_.get(),
115 gfx::Rect(initial_size)); 114 gfx::Rect(initial_size));
116 115
117 // Mute audio output. When tab capture starts, the audio will be 116 // Mute audio output. When tab capture starts, the audio will be
118 // automatically unmuted, but will be captured into the MediaStream. 117 // automatically unmuted, but will be captured into the MediaStream.
119 offscreen_tab_web_contents_->SetAudioMuted(true); 118 offscreen_tab_web_contents_->SetAudioMuted(true);
120 119
120 // TODO(imcheng): If |optional_presentation_id| is not empty, register it with
121 // the PresentationRouter. http://crbug.com/513859
121 if (!optional_presentation_id.empty()) { 122 if (!optional_presentation_id.empty()) {
122 DVLOG(1) << " Register with ReceiverPresentationServiceDelegateImpl, " 123 NOTIMPLEMENTED()
123 << "[presentation_id]: " << optional_presentation_id; 124 << "Register with PresentationRouter, id=" << optional_presentation_id;
124 // Create a ReceiverPSDImpl associated with the offscreen tab's WebContents.
125 // The new instance will set up the necessary infrastructure to allow
126 // controlling peers the ability to connect to the offscreen tab.
127 media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
128 offscreen_tab_web_contents_.get(), optional_presentation_id);
129 125
130 if (auto* render_view_host = 126 if (auto* render_view_host =
131 offscreen_tab_web_contents_->GetRenderViewHost()) { 127 offscreen_tab_web_contents_->GetRenderViewHost()) {
132 auto web_prefs = render_view_host->GetWebkitPreferences(); 128 auto web_prefs = render_view_host->GetWebkitPreferences();
133 web_prefs.presentation_receiver = true; 129 web_prefs.presentation_receiver = true;
134 render_view_host->UpdateWebkitPreferences(web_prefs); 130 render_view_host->UpdateWebkitPreferences(web_prefs);
135 } 131 }
136 } 132 }
137 133
138 // Navigate to the initial URL. 134 // Navigate to the initial URL.
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 373
378 // Schedule the timer to check again in a second. 374 // Schedule the timer to check again in a second.
379 capture_poll_timer_.Start( 375 capture_poll_timer_.Start(
380 FROM_HERE, 376 FROM_HERE,
381 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), 377 base::TimeDelta::FromSeconds(kPollIntervalInSeconds),
382 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, 378 base::Bind(&OffscreenTab::DieIfContentCaptureEnded,
383 base::Unretained(this))); 379 base::Unretained(this)));
384 } 380 }
385 381
386 } // namespace extensions 382 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/router/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698