Commit 88a928b2 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix nits in CastMirroringServiceHost.

Change-Id: I46e26e968f8ef512f890faa2d7c88abcfb17f0f6
Reviewed-on: https://chromium-review.googlesource.com/c/1256367Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595903}
parent 0e69cdc6
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
#include "chrome/browser/media/cast_mirroring_service_host.h" #include "chrome/browser/media/cast_mirroring_service_host.h"
#include "base/callback.h" #include <algorithm>
#include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
...@@ -131,7 +133,7 @@ void CastMirroringServiceHost::GetForTab( ...@@ -131,7 +133,7 @@ void CastMirroringServiceHost::GetForTab(
const content::DesktopMediaID media_id = const content::DesktopMediaID media_id =
BuildMediaIdForWebContents(target_contents); BuildMediaIdForWebContents(target_contents);
mojo::MakeStrongBinding( mojo::MakeStrongBinding(
std::make_unique<mirroring::CastMirroringServiceHost>(media_id), std::make_unique<CastMirroringServiceHost>(media_id),
std::move(request)); std::move(request));
} }
} }
...@@ -152,7 +154,7 @@ void CastMirroringServiceHost::GetForDesktop( ...@@ -152,7 +154,7 @@ void CastMirroringServiceHost::GetForDesktop(
initiator_contents->GetVisibleURL().GetOrigin(), initiator_contents->GetVisibleURL().GetOrigin(),
&original_extension_name, content::kRegistryStreamTypeDesktop); &original_extension_name, content::kRegistryStreamTypeDesktop);
mojo::MakeStrongBinding( mojo::MakeStrongBinding(
std::make_unique<mirroring::CastMirroringServiceHost>(media_id), std::make_unique<CastMirroringServiceHost>(media_id),
std::move(request)); std::move(request));
} }
} }
...@@ -164,8 +166,8 @@ void CastMirroringServiceHost::GetForOffscreenTab( ...@@ -164,8 +166,8 @@ void CastMirroringServiceHost::GetForOffscreenTab(
const std::string& presentation_id, const std::string& presentation_id,
mojom::MirroringServiceHostRequest request) { mojom::MirroringServiceHostRequest request) {
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
auto host = std::make_unique<mirroring::CastMirroringServiceHost>( auto host =
content::DesktopMediaID()); std::make_unique<CastMirroringServiceHost>(content::DesktopMediaID());
host->OpenOffscreenTab(context, presentation_url, presentation_id); host->OpenOffscreenTab(context, presentation_url, presentation_id);
mojo::MakeStrongBinding(std::move(host), std::move(request)); mojo::MakeStrongBinding(std::move(host), std::move(request));
#endif // BUILDFLAG(ENABLE_EXTENSIONS) #endif // BUILDFLAG(ENABLE_EXTENSIONS)
...@@ -261,7 +263,7 @@ void CastMirroringServiceHost::ConnectToRemotingSource( ...@@ -261,7 +263,7 @@ void CastMirroringServiceHost::ConnectToRemotingSource(
media::mojom::RemoterPtr remoter, media::mojom::RemoterPtr remoter,
media::mojom::RemotingSourceRequest request) { media::mojom::RemotingSourceRequest request) {
if (source_media_id_.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { if (source_media_id_.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) {
content::WebContents* const source_contents = web_contents(); content::WebContents* source_contents = web_contents();
if (source_contents) { if (source_contents) {
CastRemotingConnector::Get(source_contents) CastRemotingConnector::Get(source_contents)
->ConnectWithMediaRemoter(std::move(remoter), std::move(request)); ->ConnectWithMediaRemoter(std::move(remoter), std::move(request));
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
#ifndef CHROME_BROWSER_MEDIA_CAST_MIRRORING_SERVICE_HOST_H_ #ifndef CHROME_BROWSER_MEDIA_CAST_MIRRORING_SERVICE_HOST_H_
#define CHROME_BROWSER_MEDIA_CAST_MIRRORING_SERVICE_HOST_H_ #define CHROME_BROWSER_MEDIA_CAST_MIRRORING_SERVICE_HOST_H_
#include <memory>
#include <string>
#include "base/macros.h" #include "base/macros.h"
#include "build/build_config.h"
#include "components/mirroring/mojom/mirroring_service.mojom.h" #include "components/mirroring/mojom/mirroring_service.mojom.h"
#include "components/mirroring/mojom/mirroring_service_host.mojom.h" #include "components/mirroring/mojom/mirroring_service_host.mojom.h"
#include "components/mirroring/mojom/resource_provider.mojom.h" #include "components/mirroring/mojom/resource_provider.mojom.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment