Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: chrome/browser/extensions/updater/chrome_extension_downloader_factory.cc

Issue 803313003: Rename omaha_client and similar tokens to update_client in all contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: rebase to master Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
8
7 #include "chrome/browser/google/google_brand.h" 9 #include "chrome/browser/google/google_brand.h"
8 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 10 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
9 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/profile_identity_provider.h" 12 #include "chrome/browser/signin/profile_identity_provider.h"
11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
12 #include "chrome/browser/signin/signin_manager_factory.h" 14 #include "chrome/browser/signin/signin_manager_factory.h"
13 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 15 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
14 #include "components/omaha_client/omaha_query_params.h"
15 #include "components/signin/core/browser/signin_manager.h" 16 #include "components/signin/core/browser/signin_manager.h"
17 #include "components/update_client/update_query_params.h"
16 #include "extensions/browser/updater/extension_downloader.h" 18 #include "extensions/browser/updater/extension_downloader.h"
17 #include "google_apis/gaia/identity_provider.h" 19 #include "google_apis/gaia/identity_provider.h"
18 20
19 using extensions::ExtensionDownloader; 21 using extensions::ExtensionDownloader;
20 using extensions::ExtensionDownloaderDelegate; 22 using extensions::ExtensionDownloaderDelegate;
21 using omaha_client::OmahaQueryParams; 23 using update_client::UpdateQueryParams;
22 24
23 scoped_ptr<ExtensionDownloader> 25 scoped_ptr<ExtensionDownloader>
24 ChromeExtensionDownloaderFactory::CreateForRequestContext( 26 ChromeExtensionDownloaderFactory::CreateForRequestContext(
25 net::URLRequestContextGetter* request_context, 27 net::URLRequestContextGetter* request_context,
26 ExtensionDownloaderDelegate* delegate) { 28 ExtensionDownloaderDelegate* delegate) {
27 scoped_ptr<ExtensionDownloader> downloader( 29 scoped_ptr<ExtensionDownloader> downloader(
28 new ExtensionDownloader(delegate, request_context)); 30 new ExtensionDownloader(delegate, request_context));
29 #if defined(GOOGLE_CHROME_BUILD) 31 #if defined(GOOGLE_CHROME_BUILD)
30 std::string brand; 32 std::string brand;
31 google_brand::GetBrand(&brand); 33 google_brand::GetBrand(&brand);
32 if (!brand.empty() && !google_brand::IsOrganic(brand)) 34 if (!brand.empty() && !google_brand::IsOrganic(brand))
33 downloader->set_brand_code(brand); 35 downloader->set_brand_code(brand);
34 #endif // defined(GOOGLE_CHROME_BUILD) 36 #endif // defined(GOOGLE_CHROME_BUILD)
35 downloader->set_manifest_query_params( 37 downloader->set_manifest_query_params(
36 OmahaQueryParams::Get(OmahaQueryParams::CRX)); 38 UpdateQueryParams::Get(UpdateQueryParams::CRX));
37 downloader->set_ping_enabled_domain("google.com"); 39 downloader->set_ping_enabled_domain("google.com");
38 downloader->set_enable_extra_update_metrics( 40 downloader->set_enable_extra_update_metrics(
39 ChromeMetricsServiceAccessor::IsMetricsReportingEnabled()); 41 ChromeMetricsServiceAccessor::IsMetricsReportingEnabled());
40 return downloader.Pass(); 42 return downloader.Pass();
41 } 43 }
42 44
43 scoped_ptr<ExtensionDownloader> 45 scoped_ptr<ExtensionDownloader>
44 ChromeExtensionDownloaderFactory::CreateForProfile( 46 ChromeExtensionDownloaderFactory::CreateForProfile(
45 Profile* profile, 47 Profile* profile,
46 ExtensionDownloaderDelegate* delegate) { 48 ExtensionDownloaderDelegate* delegate) {
47 scoped_ptr<IdentityProvider> identity_provider(new ProfileIdentityProvider( 49 scoped_ptr<IdentityProvider> identity_provider(new ProfileIdentityProvider(
48 SigninManagerFactory::GetForProfile(profile), 50 SigninManagerFactory::GetForProfile(profile),
49 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 51 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
50 LoginUIServiceFactory::GetForProfile(profile))); 52 LoginUIServiceFactory::GetForProfile(profile)));
51 scoped_ptr<ExtensionDownloader> downloader = 53 scoped_ptr<ExtensionDownloader> downloader =
52 CreateForRequestContext(profile->GetRequestContext(), delegate); 54 CreateForRequestContext(profile->GetRequestContext(), delegate);
53 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); 55 downloader->SetWebstoreIdentityProvider(identity_provider.Pass());
54 return downloader.Pass(); 56 return downloader.Pass();
55 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698