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 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/extensions/external_provider_impl.h" | 33 #include "chrome/browser/extensions/external_provider_impl.h" |
34 #include "chrome/browser/extensions/install_verifier.h" | 34 #include "chrome/browser/extensions/install_verifier.h" |
35 #include "chrome/browser/extensions/installed_loader.h" | 35 #include "chrome/browser/extensions/installed_loader.h" |
36 #include "chrome/browser/extensions/pending_extension_manager.h" | 36 #include "chrome/browser/extensions/pending_extension_manager.h" |
37 #include "chrome/browser/extensions/permissions_updater.h" | 37 #include "chrome/browser/extensions/permissions_updater.h" |
38 #include "chrome/browser/extensions/shared_module_service.h" | 38 #include "chrome/browser/extensions/shared_module_service.h" |
39 #include "chrome/browser/extensions/unpacked_installer.h" | 39 #include "chrome/browser/extensions/unpacked_installer.h" |
40 #include "chrome/browser/extensions/updater/extension_cache.h" | 40 #include "chrome/browser/extensions/updater/extension_cache.h" |
41 #include "chrome/browser/extensions/updater/extension_downloader.h" | 41 #include "chrome/browser/extensions/updater/extension_downloader.h" |
42 #include "chrome/browser/extensions/updater/extension_updater.h" | 42 #include "chrome/browser/extensions/updater/extension_updater.h" |
43 #include "chrome/browser/google/google_brand.h" | |
44 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | |
43 #include "chrome/browser/profiles/profile.h" | 45 #include "chrome/browser/profiles/profile.h" |
44 #include "chrome/browser/signin/profile_identity_provider.h" | 46 #include "chrome/browser/signin/profile_identity_provider.h" |
45 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 47 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
46 #include "chrome/browser/signin/signin_manager_factory.h" | 48 #include "chrome/browser/signin/signin_manager_factory.h" |
47 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 49 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
48 #include "chrome/browser/ui/webui/favicon_source.h" | 50 #include "chrome/browser/ui/webui/favicon_source.h" |
49 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 51 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
50 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 52 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
51 #include "chrome/browser/ui/webui/theme_source.h" | 53 #include "chrome/browser/ui/webui/theme_source.h" |
52 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
53 #include "chrome/common/crash_keys.h" | 55 #include "chrome/common/crash_keys.h" |
54 #include "chrome/common/extensions/extension_constants.h" | 56 #include "chrome/common/extensions/extension_constants.h" |
55 #include "chrome/common/extensions/features/feature_channel.h" | 57 #include "chrome/common/extensions/features/feature_channel.h" |
56 #include "chrome/common/extensions/manifest_url_handler.h" | 58 #include "chrome/common/extensions/manifest_url_handler.h" |
57 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
58 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
61 #include "components/omaha_query_params/omaha_query_params.h" | |
59 #include "components/signin/core/browser/signin_manager.h" | 62 #include "components/signin/core/browser/signin_manager.h" |
60 #include "components/startup_metric_utils/startup_metric_utils.h" | 63 #include "components/startup_metric_utils/startup_metric_utils.h" |
61 #include "content/public/browser/devtools_agent_host.h" | 64 #include "content/public/browser/devtools_agent_host.h" |
62 #include "content/public/browser/notification_service.h" | 65 #include "content/public/browser/notification_service.h" |
63 #include "content/public/browser/render_process_host.h" | 66 #include "content/public/browser/render_process_host.h" |
64 #include "content/public/browser/storage_partition.h" | 67 #include "content/public/browser/storage_partition.h" |
65 #include "extensions/browser/event_router.h" | 68 #include "extensions/browser/event_router.h" |
66 #include "extensions/browser/extension_host.h" | 69 #include "extensions/browser/extension_host.h" |
67 #include "extensions/browser/extension_prefs.h" | 70 #include "extensions/browser/extension_prefs.h" |
68 #include "extensions/browser/extension_registry.h" | 71 #include "extensions/browser/extension_registry.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 scoped_ptr<ExtensionDownloader> ExtensionService::CreateExtensionDownloader( | 592 scoped_ptr<ExtensionDownloader> ExtensionService::CreateExtensionDownloader( |
590 ExtensionDownloaderDelegate* delegate) { | 593 ExtensionDownloaderDelegate* delegate) { |
591 scoped_ptr<ExtensionDownloader> downloader; | 594 scoped_ptr<ExtensionDownloader> downloader; |
592 #if defined(ENABLE_EXTENSIONS) | 595 #if defined(ENABLE_EXTENSIONS) |
593 scoped_ptr<IdentityProvider> identity_provider = | 596 scoped_ptr<IdentityProvider> identity_provider = |
594 CreateWebstoreIdentityProvider(profile_); | 597 CreateWebstoreIdentityProvider(profile_); |
595 downloader.reset(new ExtensionDownloader( | 598 downloader.reset(new ExtensionDownloader( |
596 delegate, | 599 delegate, |
597 profile_->GetRequestContext())); | 600 profile_->GetRequestContext())); |
598 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); | 601 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); |
599 #endif | 602 #if defined(GOOGLE_CHROME_BUILD) |
603 std::string brand; | |
604 google_brand::GetBrand(&brand); | |
605 if (!brand.empty() && !google_brand::IsOrganic(brand)) | |
not at google - send to devlin
2014/08/13 01:30:02
I read this as IsOrganic(bread). Yum.
| |
606 downloader->SetBrandCode(brand); | |
607 #endif // defined(GOOGLE_CHROME_BUILD) | |
608 downloader->SetManifestQueryParams( | |
609 omaha_query_params::OmahaQueryParams::Get( | |
610 omaha_query_params::OmahaQueryParams::CRX)); | |
611 downloader->EnablePingDataForDomain("google.com"); | |
612 downloader->EnableExtraUpdateMetrics( | |
613 ChromeMetricsServiceAccessor::IsMetricsReportingEnabled()); | |
614 #endif // defined(ENABLE_EXTENSIONS) | |
600 return downloader.Pass(); | 615 return downloader.Pass(); |
601 } | 616 } |
602 | 617 |
603 void ExtensionService::ReloadExtensionImpl( | 618 void ExtensionService::ReloadExtensionImpl( |
604 // "transient" because the process of reloading may cause the reference | 619 // "transient" because the process of reloading may cause the reference |
605 // to become invalid. Instead, use |extension_id|, a copy. | 620 // to become invalid. Instead, use |extension_id|, a copy. |
606 const std::string& transient_extension_id, | 621 const std::string& transient_extension_id, |
607 bool be_noisy) { | 622 bool be_noisy) { |
608 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 623 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
609 | 624 |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2362 } | 2377 } |
2363 | 2378 |
2364 void ExtensionService::OnProfileDestructionStarted() { | 2379 void ExtensionService::OnProfileDestructionStarted() { |
2365 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2380 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2366 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2381 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2367 it != ids_to_unload.end(); | 2382 it != ids_to_unload.end(); |
2368 ++it) { | 2383 ++it) { |
2369 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2384 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2370 } | 2385 } |
2371 } | 2386 } |
OLD | NEW |