| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |