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 <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 void ExtensionService::Init() { | 385 void ExtensionService::Init() { |
386 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 386 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
387 | 387 |
388 base::Time begin_time = base::Time::Now(); | 388 base::Time begin_time = base::Time::Now(); |
389 | 389 |
390 DCHECK(!is_ready()); // Can't redo init. | 390 DCHECK(!is_ready()); // Can't redo init. |
391 DCHECK_EQ(registry_->enabled_extensions().size(), 0u); | 391 DCHECK_EQ(registry_->enabled_extensions().size(), 0u); |
392 | 392 |
393 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 393 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
394 if (cmd_line->HasSwitch(switches::kInstallFromWebstore) || | 394 if (cmd_line->HasSwitch(switches::kInstallEphemeralAppFromWebstore)) { |
395 cmd_line->HasSwitch(switches::kLimitedInstallFromWebstore)) { | |
396 // The sole purpose of this launch is to install a new extension from CWS | 395 // The sole purpose of this launch is to install a new extension from CWS |
397 // and immediately terminate: loading already installed extensions is | 396 // and immediately terminate: loading already installed extensions is |
398 // unnecessary and may interfere with the inline install dialog (e.g. if an | 397 // unnecessary and may interfere with the inline install dialog (e.g. if an |
399 // extension listens to onStartup and opens a window). | 398 // extension listens to onStartup and opens a window). |
400 SetReadyAndNotifyListeners(); | 399 SetReadyAndNotifyListeners(); |
401 } else { | 400 } else { |
402 // LoadAllExtensions() calls OnLoadedInstalledExtensions(). | 401 // LoadAllExtensions() calls OnLoadedInstalledExtensions(). |
403 component_loader_->LoadAll(); | 402 component_loader_->LoadAll(); |
404 extensions::InstalledLoader(this).LoadAllExtensions(); | 403 extensions::InstalledLoader(this).LoadAllExtensions(); |
405 | 404 |
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 } | 2354 } |
2356 | 2355 |
2357 void ExtensionService::OnProfileDestructionStarted() { | 2356 void ExtensionService::OnProfileDestructionStarted() { |
2358 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2357 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2359 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2358 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2360 it != ids_to_unload.end(); | 2359 it != ids_to_unload.end(); |
2361 ++it) { | 2360 ++it) { |
2362 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2361 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2363 } | 2362 } |
2364 } | 2363 } |
OLD | NEW |