OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 #include "chrome/common/crash_keys.h" | 62 #include "chrome/common/crash_keys.h" |
63 #include "chrome/common/extensions/extension_constants.h" | 63 #include "chrome/common/extensions/extension_constants.h" |
64 #include "chrome/common/features.h" | 64 #include "chrome/common/features.h" |
65 #include "chrome/common/url_constants.h" | 65 #include "chrome/common/url_constants.h" |
66 #include "components/content_settings/core/browser/host_content_settings_map.h" | 66 #include "components/content_settings/core/browser/host_content_settings_map.h" |
67 #include "components/crx_file/id_util.h" | 67 #include "components/crx_file/id_util.h" |
68 #include "content/public/browser/devtools_agent_host.h" | 68 #include "content/public/browser/devtools_agent_host.h" |
69 #include "content/public/browser/notification_service.h" | 69 #include "content/public/browser/notification_service.h" |
70 #include "content/public/browser/render_process_host.h" | 70 #include "content/public/browser/render_process_host.h" |
71 #include "content/public/browser/storage_partition.h" | 71 #include "content/public/browser/storage_partition.h" |
72 #include "content/public/common/content_switches.h" | |
72 #include "extensions/browser/app_sorting.h" | 73 #include "extensions/browser/app_sorting.h" |
73 #include "extensions/browser/event_router.h" | 74 #include "extensions/browser/event_router.h" |
74 #include "extensions/browser/extension_host.h" | 75 #include "extensions/browser/extension_host.h" |
75 #include "extensions/browser/extension_registry.h" | 76 #include "extensions/browser/extension_registry.h" |
76 #include "extensions/browser/extension_system.h" | 77 #include "extensions/browser/extension_system.h" |
77 #include "extensions/browser/extensions_browser_client.h" | 78 #include "extensions/browser/extensions_browser_client.h" |
78 #include "extensions/browser/external_install_info.h" | 79 #include "extensions/browser/external_install_info.h" |
79 #include "extensions/browser/install_flag.h" | 80 #include "extensions/browser/install_flag.h" |
80 #include "extensions/browser/renderer_startup_helper.h" | 81 #include "extensions/browser/renderer_startup_helper.h" |
81 #include "extensions/browser/runtime_data.h" | 82 #include "extensions/browser/runtime_data.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 | 433 |
433 DCHECK(!is_ready()); // Can't redo init. | 434 DCHECK(!is_ready()); // Can't redo init. |
434 DCHECK_EQ(registry_->enabled_extensions().size(), 0u); | 435 DCHECK_EQ(registry_->enabled_extensions().size(), 0u); |
435 | 436 |
436 // LoadAllExtensions() calls OnLoadedInstalledExtensions(). | 437 // LoadAllExtensions() calls OnLoadedInstalledExtensions(). |
437 component_loader_->LoadAll(); | 438 component_loader_->LoadAll(); |
438 extensions::InstalledLoader(this).LoadAllExtensions(); | 439 extensions::InstalledLoader(this).LoadAllExtensions(); |
439 LoadExtensionsFromCommandLineFlag(switches::kDisableExtensionsExcept); | 440 LoadExtensionsFromCommandLineFlag(switches::kDisableExtensionsExcept); |
440 if (extensions_enabled_) | 441 if (extensions_enabled_) |
441 LoadExtensionsFromCommandLineFlag(switches::kLoadExtension); | 442 LoadExtensionsFromCommandLineFlag(switches::kLoadExtension); |
443 // TODO(samuong): Remove this when ChromeDriver stops supporting Chrome 56. | |
444 // ChromeDriver has no way of determining the Chrome version until after | |
445 // launch, so it needs to continue passing load-component-extension until it | |
446 // stops supporting Chrome 56. | |
447 if (command_line_->HasSwitch(switches::kEnableChromeDriver)) | |
448 LoadExtensionsFromCommandLineFlag(switches::kLoadComponentExtension); | |
Devlin
2017/02/01 23:05:00
I think we should make this a separate change - le
samuong
2017/02/04 00:11:03
Done.
| |
442 EnabledReloadableExtensions(); | 449 EnabledReloadableExtensions(); |
443 MaybeFinishShutdownDelayed(); | 450 MaybeFinishShutdownDelayed(); |
444 SetReadyAndNotifyListeners(); | 451 SetReadyAndNotifyListeners(); |
445 | 452 |
446 // TODO(erikkay): this should probably be deferred to a future point | 453 // TODO(erikkay): this should probably be deferred to a future point |
447 // rather than running immediately at startup. | 454 // rather than running immediately at startup. |
448 CheckForExternalUpdates(); | 455 CheckForExternalUpdates(); |
449 | 456 |
450 LoadGreylistFromPrefs(); | 457 LoadGreylistFromPrefs(); |
451 } | 458 } |
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2490 } | 2497 } |
2491 | 2498 |
2492 void ExtensionService::OnProfileDestructionStarted() { | 2499 void ExtensionService::OnProfileDestructionStarted() { |
2493 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2500 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2494 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2501 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2495 it != ids_to_unload.end(); | 2502 it != ids_to_unload.end(); |
2496 ++it) { | 2503 ++it) { |
2497 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2504 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2498 } | 2505 } |
2499 } | 2506 } |
OLD | NEW |