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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) { 569 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) {
570 return navigation_type == FrameMsg_Navigate_Type::RELOAD || 570 return navigation_type == FrameMsg_Navigate_Type::RELOAD ||
571 navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE || 571 navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE ||
572 navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; 572 navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL;
573 } 573 }
574 574
575 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = 575 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl =
576 nullptr; 576 nullptr;
577 577
578 void OnGotContentHandlerID(uint32_t content_handler_id) {} 578 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
579 579
580 WebString ConvertRelativePathToHtmlAttribute(const base::FilePath& path) { 580 WebString ConvertRelativePathToHtmlAttribute(const base::FilePath& path) {
581 DCHECK(!path.IsAbsolute()); 581 DCHECK(!path.IsAbsolute());
582 return WebString::fromUTF8( 582 return WebString::fromUTF8(
583 std::string("./") + 583 std::string("./") +
584 path.NormalizePathSeparatorsTo(FILE_PATH_LITERAL('/')).AsUTF8Unsafe()); 584 path.NormalizePathSeparatorsTo(FILE_PATH_LITERAL('/')).AsUTF8Unsafe());
585 } 585 }
586 586
587 // Implementation of WebFrameSerializer::MHTMLPartsGenerationDelegate that 587 // Implementation of WebFrameSerializer::MHTMLPartsGenerationDelegate that
588 // 1. Bases shouldSkipResource and getContentID responses on contents of 588 // 1. Bases shouldSkipResource and getContentID responses on contents of
(...skipping 5086 matching lines...) Expand 10 before | Expand all | Expand 10 after
5675 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); 5675 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_));
5676 mojo::ServiceProviderPtr service_provider; 5676 mojo::ServiceProviderPtr service_provider;
5677 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5677 mojo::URLRequestPtr request(mojo::URLRequest::New());
5678 request->url = mojo::String::From(url); 5678 request->url = mojo::String::From(url);
5679 mojo::CapabilityFilterPtr filter(mojo::CapabilityFilter::New()); 5679 mojo::CapabilityFilterPtr filter(mojo::CapabilityFilter::New());
5680 mojo::Array<mojo::String> all_interfaces; 5680 mojo::Array<mojo::String> all_interfaces;
5681 all_interfaces.push_back("*"); 5681 all_interfaces.push_back("*");
5682 filter->filter.insert("*", std::move(all_interfaces)); 5682 filter->filter.insert("*", std::move(all_interfaces));
5683 mojo_shell_->ConnectToApplication( 5683 mojo_shell_->ConnectToApplication(
5684 std::move(request), GetProxy(&service_provider), nullptr, 5684 std::move(request), GetProxy(&service_provider), nullptr,
5685 std::move(filter), base::Bind(&OnGotContentHandlerID)); 5685 std::move(filter), base::Bind(&OnGotRemoteIDs));
5686 return service_provider; 5686 return service_provider;
5687 } 5687 }
5688 5688
5689 media::RendererWebMediaPlayerDelegate* 5689 media::RendererWebMediaPlayerDelegate*
5690 RenderFrameImpl::GetWebMediaPlayerDelegate() { 5690 RenderFrameImpl::GetWebMediaPlayerDelegate() {
5691 if (!media_player_delegate_) 5691 if (!media_player_delegate_)
5692 media_player_delegate_ = new media::RendererWebMediaPlayerDelegate(this); 5692 media_player_delegate_ = new media::RendererWebMediaPlayerDelegate(this);
5693 return media_player_delegate_; 5693 return media_player_delegate_;
5694 } 5694 }
5695 5695
5696 void RenderFrameImpl::checkIfAudioSinkExistsAndIsAuthorized( 5696 void RenderFrameImpl::checkIfAudioSinkExistsAndIsAuthorized(
5697 const blink::WebString& sink_id, 5697 const blink::WebString& sink_id,
5698 const blink::WebSecurityOrigin& security_origin, 5698 const blink::WebSecurityOrigin& security_origin,
5699 blink::WebSetSinkIdCallbacks* web_callbacks) { 5699 blink::WebSetSinkIdCallbacks* web_callbacks) {
5700 media::SwitchOutputDeviceCB callback = 5700 media::SwitchOutputDeviceCB callback =
5701 media::ConvertToSwitchOutputDeviceCB(web_callbacks); 5701 media::ConvertToSwitchOutputDeviceCB(web_callbacks);
5702 scoped_refptr<media::AudioOutputDevice> device = 5702 scoped_refptr<media::AudioOutputDevice> device =
5703 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), 5703 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(),
5704 security_origin); 5704 security_origin);
5705 media::OutputDeviceStatus status = device->GetDeviceStatus(); 5705 media::OutputDeviceStatus status = device->GetDeviceStatus();
5706 device->Stop(); 5706 device->Stop();
5707 callback.Run(status); 5707 callback.Run(status);
5708 } 5708 }
5709 5709
5710 } // namespace content 5710 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698