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

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

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 1 month 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 queue->AddPendingTask(browser_context(), 178 queue->AddPendingTask(browser_context(),
179 guest_extension->id(), 179 guest_extension->id(),
180 base::Bind( 180 base::Bind(
181 &AppViewGuest::LaunchAppAndFireEvent, 181 &AppViewGuest::LaunchAppAndFireEvent,
182 weak_ptr_factory_.GetWeakPtr(), 182 weak_ptr_factory_.GetWeakPtr(),
183 base::Passed(make_scoped_ptr(data->DeepCopy())), 183 base::Passed(make_scoped_ptr(data->DeepCopy())),
184 callback)); 184 callback));
185 return; 185 return;
186 } 186 }
187 187
188 ProcessManager* process_manager = 188 ProcessManager* process_manager = ProcessManager::Get(browser_context());
189 ExtensionSystem::Get(browser_context())->process_manager();
190 ExtensionHost* host = 189 ExtensionHost* host =
191 process_manager->GetBackgroundHostForExtension(guest_extension->id()); 190 process_manager->GetBackgroundHostForExtension(guest_extension->id());
192 DCHECK(host); 191 DCHECK(host);
193 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host); 192 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host);
194 } 193 }
195 194
196 void AppViewGuest::DidAttachToEmbedder() { 195 void AppViewGuest::DidAttachToEmbedder() {
197 // This is called after the guest process has been attached to a host 196 // This is called after the guest process has been attached to a host
198 // element. This means that the host element knows how to route input 197 // element. This means that the host element knows how to route input
199 // events to the guest, and the guest knows how to get frames to the 198 // events to the guest, and the guest knows how to get frames to the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 249
251 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); 250 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue());
252 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); 251 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id());
253 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); 252 embed_request->SetString(appview::kEmbedderID, embedder_extension_id());
254 embed_request->Set(appview::kData, data.release()); 253 embed_request->Set(appview::kData, data.release());
255 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( 254 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent(
256 browser_context(), embed_request.Pass(), extension_host->extension()); 255 browser_context(), embed_request.Pass(), extension_host->extension());
257 } 256 }
258 257
259 } // namespace extensions 258 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_system.h ('k') | extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698