OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/updater/chrome_extension_downloader_factory.
h" | 5 #include "chrome/browser/extensions/updater/chrome_extension_downloader_factory.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
8 | 9 |
9 #include "chrome/browser/google/google_brand.h" | 10 #include "chrome/browser/google/google_brand.h" |
10 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
13 #include "chrome/browser/signin/signin_manager_factory.h" | 14 #include "chrome/browser/signin/signin_manager_factory.h" |
14 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 15 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
15 #include "components/signin/core/browser/profile_identity_provider.h" | 16 #include "components/signin/core/browser/profile_identity_provider.h" |
16 #include "components/signin/core/browser/signin_manager.h" | 17 #include "components/signin/core/browser/signin_manager.h" |
17 #include "components/update_client/update_query_params.h" | 18 #include "components/update_client/update_query_params.h" |
(...skipping 14 matching lines...) Expand all Loading... |
32 std::string brand; | 33 std::string brand; |
33 google_brand::GetBrand(&brand); | 34 google_brand::GetBrand(&brand); |
34 if (!brand.empty() && !google_brand::IsOrganic(brand)) | 35 if (!brand.empty() && !google_brand::IsOrganic(brand)) |
35 downloader->set_brand_code(brand); | 36 downloader->set_brand_code(brand); |
36 #endif // defined(GOOGLE_CHROME_BUILD) | 37 #endif // defined(GOOGLE_CHROME_BUILD) |
37 downloader->set_manifest_query_params( | 38 downloader->set_manifest_query_params( |
38 UpdateQueryParams::Get(UpdateQueryParams::CRX)); | 39 UpdateQueryParams::Get(UpdateQueryParams::CRX)); |
39 downloader->set_ping_enabled_domain("google.com"); | 40 downloader->set_ping_enabled_domain("google.com"); |
40 downloader->set_enable_extra_update_metrics( | 41 downloader->set_enable_extra_update_metrics( |
41 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); | 42 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()); |
42 return downloader.Pass(); | 43 return downloader; |
43 } | 44 } |
44 | 45 |
45 scoped_ptr<ExtensionDownloader> | 46 scoped_ptr<ExtensionDownloader> |
46 ChromeExtensionDownloaderFactory::CreateForProfile( | 47 ChromeExtensionDownloaderFactory::CreateForProfile( |
47 Profile* profile, | 48 Profile* profile, |
48 ExtensionDownloaderDelegate* delegate) { | 49 ExtensionDownloaderDelegate* delegate) { |
49 scoped_ptr<IdentityProvider> identity_provider(new ProfileIdentityProvider( | 50 scoped_ptr<IdentityProvider> identity_provider(new ProfileIdentityProvider( |
50 SigninManagerFactory::GetForProfile(profile), | 51 SigninManagerFactory::GetForProfile(profile), |
51 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 52 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
52 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile))); | 53 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile))); |
53 scoped_ptr<ExtensionDownloader> downloader = | 54 scoped_ptr<ExtensionDownloader> downloader = |
54 CreateForRequestContext(profile->GetRequestContext(), delegate); | 55 CreateForRequestContext(profile->GetRequestContext(), delegate); |
55 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); | 56 downloader->SetWebstoreIdentityProvider(std::move(identity_provider)); |
56 return downloader.Pass(); | 57 return downloader; |
57 } | 58 } |
OLD | NEW |