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

Side by Side Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

Issue 2079943002: Change RenderFrame to use InterfaceRegistry et al. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2
Patch Set: . 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
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/mojo/service_registration.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h" 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "components/guest_view/common/guest_view_constants.h" 10 #include "components/guest_view/common/guest_view_constants.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/host_zoom_map.h" 12 #include "content/public/browser/host_zoom_map.h"
13 #include "content/public/browser/navigation_entry.h" 13 #include "content/public/browser/navigation_entry.h"
14 #include "content/public/browser/render_process_host.h" 14 #include "content/public/browser/render_process_host.h"
15 #include "content/public/browser/stream_handle.h" 15 #include "content/public/browser/stream_handle.h"
16 #include "content/public/browser/stream_info.h" 16 #include "content/public/browser/stream_info.h"
17 #include "content/public/common/service_registry.h"
18 #include "content/public/common/url_constants.h" 17 #include "content/public/common/url_constants.h"
19 #include "extensions/browser/api/extensions_api_client.h" 18 #include "extensions/browser/api/extensions_api_client.h"
20 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" 19 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
21 #include "extensions/browser/extension_registry.h" 20 #include "extensions/browser/extension_registry.h"
22 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h" 21 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_ma nager.h"
23 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_cons tants.h" 22 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_cons tants.h"
24 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t_delegate.h" 23 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t_delegate.h"
25 #include "extensions/browser/process_manager.h" 24 #include "extensions/browser/process_manager.h"
26 #include "extensions/common/constants.h" 25 #include "extensions/common/constants.h"
27 #include "extensions/common/extension_messages.h" 26 #include "extensions/common/extension_messages.h"
28 #include "extensions/common/guest_view/extensions_guest_view_messages.h" 27 #include "extensions/common/guest_view/extensions_guest_view_messages.h"
29 #include "extensions/strings/grit/extensions_strings.h" 28 #include "extensions/strings/grit/extensions_strings.h"
30 #include "ipc/ipc_message_macros.h" 29 #include "ipc/ipc_message_macros.h"
31 #include "net/base/url_util.h" 30 #include "net/base/url_util.h"
31 #include "services/shell/public/cpp/interface_registry.h"
32 #include "third_party/WebKit/public/web/WebInputEvent.h" 32 #include "third_party/WebKit/public/web/WebInputEvent.h"
33 33
34 using content::WebContents; 34 using content::WebContents;
35 using guest_view::GuestViewBase; 35 using guest_view::GuestViewBase;
36 36
37 namespace extensions { 37 namespace extensions {
38 38
39 StreamContainer::StreamContainer(std::unique_ptr<content::StreamInfo> stream, 39 StreamContainer::StreamContainer(std::unique_ptr<content::StreamInfo> stream,
40 int tab_id, 40 int tab_id,
41 bool embedded, 41 bool embedded,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 WebContents::CreateParams params(browser_context(), 134 WebContents::CreateParams params(browser_context(),
135 guest_site_instance.get()); 135 guest_site_instance.get());
136 params.guest_delegate = this; 136 params.guest_delegate = this;
137 callback.Run(WebContents::Create(params)); 137 callback.Run(WebContents::Create(params));
138 } 138 }
139 139
140 void MimeHandlerViewGuest::DidAttachToEmbedder() { 140 void MimeHandlerViewGuest::DidAttachToEmbedder() {
141 web_contents()->GetController().LoadURL( 141 web_contents()->GetController().LoadURL(
142 stream_->handler_url(), content::Referrer(), 142 stream_->handler_url(), content::Referrer(),
143 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); 143 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
144 web_contents()->GetMainFrame()->GetServiceRegistry()->AddService( 144 web_contents()->GetMainFrame()->GetInterfaceRegistry()->AddInterface(
145 base::Bind(&MimeHandlerServiceImpl::Create, stream_->GetWeakPtr())); 145 base::Bind(&MimeHandlerServiceImpl::Create, stream_->GetWeakPtr()));
146 } 146 }
147 147
148 void MimeHandlerViewGuest::DidInitialize( 148 void MimeHandlerViewGuest::DidInitialize(
149 const base::DictionaryValue& create_params) { 149 const base::DictionaryValue& create_params) {
150 ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); 150 ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents());
151 } 151 }
152 152
153 bool MimeHandlerViewGuest::ShouldHandleFindRequestsForEmbedder() const { 153 bool MimeHandlerViewGuest::ShouldHandleFindRequestsForEmbedder() const {
154 return is_full_page_plugin(); 154 return is_full_page_plugin();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 element_instance_id())); 235 element_instance_id()));
236 } 236 }
237 237
238 base::WeakPtr<StreamContainer> MimeHandlerViewGuest::GetStream() const { 238 base::WeakPtr<StreamContainer> MimeHandlerViewGuest::GetStream() const {
239 if (!stream_) 239 if (!stream_)
240 return base::WeakPtr<StreamContainer>(); 240 return base::WeakPtr<StreamContainer>();
241 return stream_->GetWeakPtr(); 241 return stream_->GetWeakPtr();
242 } 242 }
243 243
244 } // namespace extensions 244 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/mojo/service_registration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698