| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 bool IsIncognitoEnabled(const Extension* extension); | 62 bool IsIncognitoEnabled(const Extension* extension); |
| 63 | 63 |
| 64 ExtensionProcessManager* original_manager_; | 64 ExtensionProcessManager* original_manager_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 static void CreateBackgroundHostForExtensionLoad( | 67 static void CreateBackgroundHostForExtensionLoad( |
| 68 ExtensionProcessManager* manager, const Extension* extension) { | 68 ExtensionProcessManager* manager, const Extension* extension) { |
| 69 // Start the process for the master page, if it exists and we're not lazy. | 69 // Start the process for the master page, if it exists and we're not lazy. |
| 70 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 70 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 71 switches::kEnableLazyBackgroundPages) && | 71 switches::kEnableLazyBackgroundPages) && |
| 72 extension->background_url().is_valid()) | 72 extension->has_background_page()) { |
| 73 manager->CreateBackgroundHost(extension, extension->background_url()); | 73 manager->CreateBackgroundHost(extension, extension->GetBackgroundURL()); |
| 74 } |
| 74 } | 75 } |
| 75 | 76 |
| 76 static void CreateBackgroundHostsForProfileStartup( | 77 static void CreateBackgroundHostsForProfileStartup( |
| 77 ExtensionProcessManager* manager, const ExtensionSet* extensions) { | 78 ExtensionProcessManager* manager, const ExtensionSet* extensions) { |
| 78 for (ExtensionSet::const_iterator extension = extensions->begin(); | 79 for (ExtensionSet::const_iterator extension = extensions->begin(); |
| 79 extension != extensions->end(); ++extension) { | 80 extension != extensions->end(); ++extension) { |
| 80 CreateBackgroundHostForExtensionLoad(manager, *extension); | 81 CreateBackgroundHostForExtensionLoad(manager, *extension); |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 if (service && service->is_ready()) | 499 if (service && service->is_ready()) |
| 499 CreateBackgroundHostsForProfileStartup(this, service->extensions()); | 500 CreateBackgroundHostsForProfileStartup(this, service->extensions()); |
| 500 } | 501 } |
| 501 break; | 502 break; |
| 502 } | 503 } |
| 503 default: | 504 default: |
| 504 ExtensionProcessManager::Observe(type, source, details); | 505 ExtensionProcessManager::Observe(type, source, details); |
| 505 break; | 506 break; |
| 506 } | 507 } |
| 507 } | 508 } |
| OLD | NEW |