OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 content::Source<Profile>(profile)); | 105 content::Source<Profile>(profile)); |
106 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, | 106 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, |
107 content::NotificationService::AllSources()); | 107 content::NotificationService::AllSources()); |
108 } | 108 } |
109 | 109 |
110 ExtensionProcessManager::~ExtensionProcessManager() { | 110 ExtensionProcessManager::~ExtensionProcessManager() { |
111 CloseBackgroundHosts(); | 111 CloseBackgroundHosts(); |
112 DCHECK(background_hosts_.empty()); | 112 DCHECK(background_hosts_.empty()); |
113 } | 113 } |
114 | 114 |
115 ExtensionHost* ExtensionProcessManager::CreateShellHost( | |
116 const Extension* extension, | |
117 const GURL& url) { | |
118 DCHECK(extension); | |
119 ExtensionHost* host = new ExtensionHost(extension, | |
120 GetSiteInstanceForURL(url), | |
121 url, | |
122 chrome::VIEW_TYPE_APP_SHELL); | |
123 host->CreateView(NULL); | |
miket_OOO
2011/12/20 19:12:34
I wish ExtensionHost had something like CreateView
Mihai Parparita -not on Chrome
2012/01/04 22:46:46
Done.
| |
124 OnExtensionHostCreated(host, false /* not a background host */); | |
125 return host; | |
126 } | |
127 | |
115 ExtensionHost* ExtensionProcessManager::CreateViewHost( | 128 ExtensionHost* ExtensionProcessManager::CreateViewHost( |
116 const Extension* extension, | 129 const Extension* extension, |
117 const GURL& url, | 130 const GURL& url, |
118 Browser* browser, | 131 Browser* browser, |
119 content::ViewType view_type) { | 132 content::ViewType view_type) { |
120 DCHECK(extension); | 133 DCHECK(extension); |
121 // A NULL browser may only be given for pop-up views. | 134 // A NULL browser may only be given for pop-up views. |
122 DCHECK(browser || | 135 DCHECK(browser || |
123 (!browser && view_type == chrome::VIEW_TYPE_EXTENSION_POPUP)); | 136 (!browser && view_type == chrome::VIEW_TYPE_EXTENSION_POPUP)); |
124 ExtensionHost* host = | 137 ExtensionHost* host = |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
480 if (service && service->is_ready()) | 493 if (service && service->is_ready()) |
481 CreateBackgroundHostsForProfileStartup(this, service->extensions()); | 494 CreateBackgroundHostsForProfileStartup(this, service->extensions()); |
482 } | 495 } |
483 break; | 496 break; |
484 } | 497 } |
485 default: | 498 default: |
486 ExtensionProcessManager::Observe(type, source, details); | 499 ExtensionProcessManager::Observe(type, source, details); |
487 break; | 500 break; |
488 } | 501 } |
489 } | 502 } |
OLD | NEW |