| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return appview::kEmbedderAPINamespace; | 136 return appview::kEmbedderAPINamespace; |
| 137 } | 137 } |
| 138 | 138 |
| 139 int AppViewGuest::GetTaskPrefix() const { | 139 int AppViewGuest::GetTaskPrefix() const { |
| 140 return IDS_EXTENSION_TASK_MANAGER_APPVIEW_TAG_PREFIX; | 140 return IDS_EXTENSION_TASK_MANAGER_APPVIEW_TAG_PREFIX; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void AppViewGuest::CreateWebContents( | 143 void AppViewGuest::CreateWebContents( |
| 144 const std::string& embedder_extension_id, | 144 const std::string& embedder_extension_id, |
| 145 int embedder_render_process_id, | 145 int embedder_render_process_id, |
| 146 const GURL& embedder_site_url, |
| 146 const base::DictionaryValue& create_params, | 147 const base::DictionaryValue& create_params, |
| 147 const WebContentsCreatedCallback& callback) { | 148 const WebContentsCreatedCallback& callback) { |
| 148 std::string app_id; | 149 std::string app_id; |
| 149 if (!create_params.GetString(appview::kAppID, &app_id)) { | 150 if (!create_params.GetString(appview::kAppID, &app_id)) { |
| 150 callback.Run(NULL); | 151 callback.Run(NULL); |
| 151 return; | 152 return; |
| 152 } | 153 } |
| 153 | 154 |
| 154 const base::DictionaryValue* data = NULL; | 155 const base::DictionaryValue* data = NULL; |
| 155 if (!create_params.GetDictionary(appview::kData, &data)) { | 156 if (!create_params.GetDictionary(appview::kData, &data)) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 251 |
| 251 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); | 252 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); |
| 252 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); | 253 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); |
| 253 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); | 254 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); |
| 254 embed_request->Set(appview::kData, data.release()); | 255 embed_request->Set(appview::kData, data.release()); |
| 255 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 256 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
| 256 browser_context(), embed_request.Pass(), extension_host->extension()); | 257 browser_context(), embed_request.Pass(), extension_host->extension()); |
| 257 } | 258 } |
| 258 | 259 |
| 259 } // namespace extensions | 260 } // namespace extensions |
| OLD | NEW |