OLD | NEW |
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/app_view/app_view_guest.h" | 5 #include "extensions/browser/guest_view/app_view/app_view_guest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/browser/render_view_host.h" | 8 #include "content/public/browser/render_view_host.h" |
9 #include "content/public/common/renderer_preferences.h" | 9 #include "content/public/common/renderer_preferences.h" |
10 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 10 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DCHECK(host); | 196 DCHECK(host); |
197 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host); | 197 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host); |
198 } | 198 } |
199 | 199 |
200 void AppViewGuest::DidAttachToEmbedder() { | 200 void AppViewGuest::DidAttachToEmbedder() { |
201 // This is called after the guest process has been attached to a host | 201 // This is called after the guest process has been attached to a host |
202 // element. This means that the host element knows how to route input | 202 // element. This means that the host element knows how to route input |
203 // events to the guest, and the guest knows how to get frames to the | 203 // events to the guest, and the guest knows how to get frames to the |
204 // embedder. | 204 // embedder. |
205 web_contents()->GetController().LoadURL( | 205 web_contents()->GetController().LoadURL( |
206 url_, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); | 206 url_, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
207 } | 207 } |
208 | 208 |
209 void AppViewGuest::DidInitialize() { | 209 void AppViewGuest::DidInitialize() { |
210 extension_function_dispatcher_.reset( | 210 extension_function_dispatcher_.reset( |
211 new ExtensionFunctionDispatcher(browser_context(), this)); | 211 new ExtensionFunctionDispatcher(browser_context(), this)); |
212 } | 212 } |
213 | 213 |
214 void AppViewGuest::OnRequest(const ExtensionHostMsg_Request_Params& params) { | 214 void AppViewGuest::OnRequest(const ExtensionHostMsg_Request_Params& params) { |
215 extension_function_dispatcher_->Dispatch(params, | 215 extension_function_dispatcher_->Dispatch(params, |
216 web_contents()->GetRenderViewHost()); | 216 web_contents()->GetRenderViewHost()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); | 251 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); |
252 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); | 252 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); |
253 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); | 253 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); |
254 embed_request->Set(appview::kData, data.release()); | 254 embed_request->Set(appview::kData, data.release()); |
255 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 255 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
256 browser_context(), embed_request.Pass(), extension_host->extension()); | 256 browser_context(), embed_request.Pass(), extension_host->extension()); |
257 } | 257 } |
258 | 258 |
259 } // namespace extensions | 259 } // namespace extensions |
OLD | NEW |