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

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

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" 11 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
12 #include "chrome/browser/media/router/receiver_presentation_service_delegate_imp l.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/web_contents_sizer.h" 14 #include "chrome/browser/ui/web_contents_sizer.h"
14 #include "content/public/browser/render_widget_host_view.h" 15 #include "content/public/browser/render_widget_host_view.h"
15 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
16 #include "extensions/browser/extension_host.h" 17 #include "extensions/browser/extension_host.h"
17 #include "extensions/browser/process_manager.h" 18 #include "extensions/browser/process_manager.h"
18 19
19 using content::WebContents; 20 using content::WebContents;
20 21
21 DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::OffscreenTabsOwner); 22 DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::OffscreenTabsOwner);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 WebContentsObserver::Observe(offscreen_tab_web_contents_.get()); 98 WebContentsObserver::Observe(offscreen_tab_web_contents_.get());
98 99
99 // Set initial size, if specified. 100 // Set initial size, if specified.
100 if (!initial_size.IsEmpty()) 101 if (!initial_size.IsEmpty())
101 ResizeWebContents(offscreen_tab_web_contents_.get(), initial_size); 102 ResizeWebContents(offscreen_tab_web_contents_.get(), initial_size);
102 103
103 // Mute audio output. When tab capture starts, the audio will be 104 // Mute audio output. When tab capture starts, the audio will be
104 // automatically unmuted, but will be captured into the MediaStream. 105 // automatically unmuted, but will be captured into the MediaStream.
105 offscreen_tab_web_contents_->SetAudioMuted(true); 106 offscreen_tab_web_contents_->SetAudioMuted(true);
106 107
107 // TODO(imcheng): If |optional_presentation_id| is not empty, register it with
108 // the PresentationRouter. http://crbug.com/513859
109 if (!optional_presentation_id.empty()) { 108 if (!optional_presentation_id.empty()) {
110 NOTIMPLEMENTED() 109 // Register the offscreen tab as the receiver of the offscreen presentation.
111 << "Register with PresentationRouter, id=" << optional_presentation_id; 110 media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
111 offscreen_tab_web_contents_.get(), optional_presentation_id);
112 } 112 }
113 113
114 // Navigate to the initial URL. 114 // Navigate to the initial URL.
115 content::NavigationController::LoadURLParams load_params(start_url_); 115 content::NavigationController::LoadURLParams load_params(start_url_);
116 load_params.should_replace_current_entry = true; 116 load_params.should_replace_current_entry = true;
117 load_params.should_clear_history_list = true; 117 load_params.should_clear_history_list = true;
118 offscreen_tab_web_contents_->GetController().LoadURLWithParams(load_params); 118 offscreen_tab_web_contents_->GetController().LoadURLWithParams(load_params);
119 119
120 start_time_ = base::TimeTicks::Now(); 120 start_time_ = base::TimeTicks::Now();
121 DieIfContentCaptureEnded(); 121 DieIfContentCaptureEnded();
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 // Schedule the timer to check again in a second. 352 // Schedule the timer to check again in a second.
353 capture_poll_timer_.Start( 353 capture_poll_timer_.Start(
354 FROM_HERE, 354 FROM_HERE,
355 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), 355 base::TimeDelta::FromSeconds(kPollIntervalInSeconds),
356 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, 356 base::Bind(&OffscreenTab::DieIfContentCaptureEnded,
357 base::Unretained(this))); 357 base::Unretained(this)));
358 } 358 }
359 359
360 } // namespace extensions 360 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/media/router/create_presentation_connection_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698