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

Side by Side Diff: chrome/browser/extensions/extension_view_host_factory.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/extension_view_host_factory.h" 5 #include "chrome/browser/extensions/extension_view_host_factory.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_util.h" 8 #include "chrome/browser/extensions/extension_util.h"
9 #include "chrome/browser/extensions/extension_view_host.h" 9 #include "chrome/browser/extensions/extension_view_host.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 16 matching lines...) Expand all
27 // appropriate SiteInstance (and therefore process) based on the URL and 27 // appropriate SiteInstance (and therefore process) based on the URL and
28 // profile. 28 // profile.
29 ExtensionViewHost* CreateViewHostForExtension(const Extension* extension, 29 ExtensionViewHost* CreateViewHostForExtension(const Extension* extension,
30 const GURL& url, 30 const GURL& url,
31 Profile* profile, 31 Profile* profile,
32 Browser* browser, 32 Browser* browser,
33 ViewType view_type) { 33 ViewType view_type) {
34 DCHECK(profile); 34 DCHECK(profile);
35 // A NULL browser may only be given for dialogs. 35 // A NULL browser may only be given for dialogs.
36 DCHECK(browser || view_type == VIEW_TYPE_EXTENSION_DIALOG); 36 DCHECK(browser || view_type == VIEW_TYPE_EXTENSION_DIALOG);
37 ProcessManager* pm = 37 content::SiteInstance* site_instance =
38 ExtensionSystem::Get(profile)->process_manager(); 38 ProcessManager::Get(profile)->GetSiteInstanceForURL(url);
39 content::SiteInstance* site_instance = pm->GetSiteInstanceForURL(url);
40 ExtensionViewHost* host = 39 ExtensionViewHost* host =
41 #if defined(OS_MACOSX) 40 #if defined(OS_MACOSX)
42 new ExtensionViewHostMac(extension, site_instance, url, view_type); 41 new ExtensionViewHostMac(extension, site_instance, url, view_type);
43 #else 42 #else
44 new ExtensionViewHost(extension, site_instance, url, view_type); 43 new ExtensionViewHost(extension, site_instance, url, view_type);
45 #endif 44 #endif
46 host->CreateView(browser); 45 host->CreateView(browser);
47 return host; 46 return host;
48 } 47 }
49 48
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 129
131 // static 130 // static
132 ExtensionViewHost* ExtensionViewHostFactory::CreateDialogHost( 131 ExtensionViewHost* ExtensionViewHostFactory::CreateDialogHost(
133 const GURL& url, 132 const GURL& url,
134 Profile* profile) { 133 Profile* profile) {
135 DCHECK(profile); 134 DCHECK(profile);
136 return CreateViewHost(url, profile, NULL, VIEW_TYPE_EXTENSION_DIALOG); 135 return CreateViewHost(url, profile, NULL, VIEW_TYPE_EXTENSION_DIALOG);
137 } 136 }
138 137
139 } // namespace extensions 138 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/browser/extensions/gpu_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698