OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/extensions/extension_process_manager.h" | 7 #include "chrome/browser/extensions/extension_process_manager.h" |
8 | 8 |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "content/browser/browsing_instance.h" | 10 #include "content/browser/browsing_instance.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 content::Source<Profile>(profile)); | 109 content::Source<Profile>(profile)); |
110 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, | 110 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, |
111 content::NotificationService::AllSources()); | 111 content::NotificationService::AllSources()); |
112 } | 112 } |
113 | 113 |
114 ExtensionProcessManager::~ExtensionProcessManager() { | 114 ExtensionProcessManager::~ExtensionProcessManager() { |
115 CloseBackgroundHosts(); | 115 CloseBackgroundHosts(); |
116 DCHECK(background_hosts_.empty()); | 116 DCHECK(background_hosts_.empty()); |
117 } | 117 } |
118 | 118 |
| 119 ExtensionHost* ExtensionProcessManager::CreateShellHost( |
| 120 const Extension* extension, |
| 121 const GURL& url) { |
| 122 DCHECK(extension); |
| 123 ExtensionHost* host = new ExtensionHost(extension, |
| 124 GetSiteInstanceForURL(url), |
| 125 url, |
| 126 chrome::VIEW_TYPE_APP_SHELL); |
| 127 host->CreateViewWithoutBrowser(); |
| 128 OnExtensionHostCreated(host, false /* not a background host */); |
| 129 return host; |
| 130 } |
| 131 |
119 ExtensionHost* ExtensionProcessManager::CreateViewHost( | 132 ExtensionHost* ExtensionProcessManager::CreateViewHost( |
120 const Extension* extension, | 133 const Extension* extension, |
121 const GURL& url, | 134 const GURL& url, |
122 Browser* browser, | 135 Browser* browser, |
123 content::ViewType view_type) { | 136 content::ViewType view_type) { |
124 DCHECK(extension); | 137 DCHECK(extension); |
125 // A NULL browser may only be given for pop-up views. | 138 // A NULL browser may only be given for pop-up views. |
126 DCHECK(browser || | 139 DCHECK(browser || |
127 (!browser && view_type == chrome::VIEW_TYPE_EXTENSION_POPUP)); | 140 (!browser && view_type == chrome::VIEW_TYPE_EXTENSION_POPUP)); |
128 ExtensionHost* host = | 141 ExtensionHost* host = |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 if (service && service->is_ready()) | 498 if (service && service->is_ready()) |
486 CreateBackgroundHostsForProfileStartup(this, service->extensions()); | 499 CreateBackgroundHostsForProfileStartup(this, service->extensions()); |
487 } | 500 } |
488 break; | 501 break; |
489 } | 502 } |
490 default: | 503 default: |
491 ExtensionProcessManager::Observe(type, source, details); | 504 ExtensionProcessManager::Observe(type, source, details); |
492 break; | 505 break; |
493 } | 506 } |
494 } | 507 } |
OLD | NEW |