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

Side by Side Diff: extensions/browser/guest_view/app_view/app_view_guest.cc

Issue 572633003: Enable webview tag in webui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix object-src Created 6 years, 2 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698