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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 bool has_event_listener = system->event_router()->ExtensionHasEventListener( | 272 bool has_event_listener = system->event_router()->ExtensionHasEventListener( |
273 extension_host->extension()->id(), | 273 extension_host->extension()->id(), |
274 app_runtime::OnEmbedRequested::kEventName); | 274 app_runtime::OnEmbedRequested::kEventName); |
275 if (!has_event_listener) { | 275 if (!has_event_listener) { |
276 callback.Run(nullptr); | 276 callback.Run(nullptr); |
277 return; | 277 return; |
278 } | 278 } |
279 | 279 |
280 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); | 280 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); |
281 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); | 281 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); |
282 embed_request->SetString(appview::kEmbedderID, owner_extension_id()); | 282 embed_request->SetString(appview::kEmbedderID, owner_host()); |
283 embed_request->Set(appview::kData, data.release()); | 283 embed_request->Set(appview::kData, data.release()); |
284 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 284 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
285 browser_context(), embed_request.Pass(), extension_host->extension()); | 285 browser_context(), embed_request.Pass(), extension_host->extension()); |
286 } | 286 } |
287 | 287 |
288 void AppViewGuest::SetAppDelegateForTest(AppDelegate* delegate) { | 288 void AppViewGuest::SetAppDelegateForTest(AppDelegate* delegate) { |
289 app_delegate_.reset(delegate); | 289 app_delegate_.reset(delegate); |
290 } | 290 } |
291 | 291 |
292 } // namespace extensions | 292 } // namespace extensions |
OLD | NEW |