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 "chrome/browser/extensions/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 int bundled_extension_creation_flags = Extension::NO_FLAGS; | 466 int bundled_extension_creation_flags = Extension::NO_FLAGS; |
467 #endif | 467 #endif |
468 #if defined(OS_CHROMEOS) | 468 #if defined(OS_CHROMEOS) |
469 bundled_extension_creation_flags = Extension::FROM_WEBSTORE | | 469 bundled_extension_creation_flags = Extension::FROM_WEBSTORE | |
470 Extension::WAS_INSTALLED_BY_DEFAULT; | 470 Extension::WAS_INSTALLED_BY_DEFAULT; |
471 | 471 |
472 if (!is_chrome_os_public_session) { | 472 if (!is_chrome_os_public_session) { |
473 int external_apps_path_id = profile->IsSupervised() ? | 473 int external_apps_path_id = profile->IsSupervised() ? |
474 chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS : | 474 chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS : |
475 chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS; | 475 chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS; |
| 476 ExternalPrefLoader::Options pref_load_flags = |
| 477 profile->IsNewProfile() |
| 478 ? ExternalPrefLoader::DELAY_LOAD_UNTIL_PRIORITY_SYNC |
| 479 : ExternalPrefLoader::NONE; |
476 provider_list->push_back( | 480 provider_list->push_back( |
477 linked_ptr<ExternalProviderInterface>(new ExternalProviderImpl( | 481 linked_ptr<ExternalProviderInterface>(new ExternalProviderImpl( |
478 service, | 482 service, new ExternalPrefLoader(external_apps_path_id, |
479 new ExternalPrefLoader(external_apps_path_id, | 483 pref_load_flags, profile), |
480 ExternalPrefLoader::NONE, | 484 profile, Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD, |
481 profile), | |
482 profile, | |
483 Manifest::EXTERNAL_PREF, | |
484 Manifest::EXTERNAL_PREF_DOWNLOAD, | |
485 bundled_extension_creation_flags))); | 485 bundled_extension_creation_flags))); |
486 | 486 |
487 // OEM default apps. | 487 // OEM default apps. |
488 int oem_extension_creation_flags = | 488 int oem_extension_creation_flags = |
489 bundled_extension_creation_flags | Extension::WAS_INSTALLED_BY_OEM; | 489 bundled_extension_creation_flags | Extension::WAS_INSTALLED_BY_OEM; |
490 chromeos::ServicesCustomizationDocument* customization = | 490 chromeos::ServicesCustomizationDocument* customization = |
491 chromeos::ServicesCustomizationDocument::GetInstance(); | 491 chromeos::ServicesCustomizationDocument::GetInstance(); |
492 provider_list->push_back(linked_ptr<ExternalProviderInterface>( | 492 provider_list->push_back(linked_ptr<ExternalProviderInterface>( |
493 new ExternalProviderImpl(service, | 493 new ExternalProviderImpl(service, |
494 customization->CreateExternalLoader(profile), | 494 customization->CreateExternalLoader(profile), |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 service, | 577 service, |
578 new ExternalComponentLoader(profile), | 578 new ExternalComponentLoader(profile), |
579 profile, | 579 profile, |
580 Manifest::INVALID_LOCATION, | 580 Manifest::INVALID_LOCATION, |
581 Manifest::EXTERNAL_COMPONENT, | 581 Manifest::EXTERNAL_COMPONENT, |
582 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); | 582 Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT))); |
583 } | 583 } |
584 } | 584 } |
585 | 585 |
586 } // namespace extensions | 586 } // namespace extensions |
OLD | NEW |