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

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

Issue 1956893004: Don't send extension info for non-webstore extensions during update check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "chrome/browser/google/google_brand.h" 12 #include "chrome/browser/google/google_brand.h"
13 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
14 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
16 #include "chrome/browser/signin/signin_manager_factory.h" 15 #include "chrome/browser/signin/signin_manager_factory.h"
17 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
18 #include "components/signin/core/browser/profile_identity_provider.h" 17 #include "components/signin/core/browser/profile_identity_provider.h"
19 #include "components/signin/core/browser/signin_manager.h" 18 #include "components/signin/core/browser/signin_manager.h"
20 #include "components/update_client/update_query_params.h" 19 #include "components/update_client/update_query_params.h"
21 #include "extensions/browser/updater/extension_downloader.h" 20 #include "extensions/browser/updater/extension_downloader.h"
22 #include "google_apis/gaia/identity_provider.h" 21 #include "google_apis/gaia/identity_provider.h"
23 22
(...skipping 19 matching lines...) Expand all
43 #endif // defined(GOOGLE_CHROME_BUILD) 42 #endif // defined(GOOGLE_CHROME_BUILD)
44 std::string manifest_query_params = 43 std::string manifest_query_params =
45 UpdateQueryParams::Get(UpdateQueryParams::CRX); 44 UpdateQueryParams::Get(UpdateQueryParams::CRX);
46 base::CommandLine* command_line = 45 base::CommandLine* command_line =
47 base::CommandLine::ForCurrentProcess(); 46 base::CommandLine::ForCurrentProcess();
48 if (command_line->HasSwitch(kTestRequestParam)) { 47 if (command_line->HasSwitch(kTestRequestParam)) {
49 manifest_query_params += "&testrequest=1"; 48 manifest_query_params += "&testrequest=1";
50 } 49 }
51 downloader->set_manifest_query_params(manifest_query_params); 50 downloader->set_manifest_query_params(manifest_query_params);
52 downloader->set_ping_enabled_domain("google.com"); 51 downloader->set_ping_enabled_domain("google.com");
53 downloader->set_enable_extra_update_metrics(
54 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled());
55 return downloader; 52 return downloader;
56 } 53 }
57 54
58 std::unique_ptr<ExtensionDownloader> 55 std::unique_ptr<ExtensionDownloader>
59 ChromeExtensionDownloaderFactory::CreateForProfile( 56 ChromeExtensionDownloaderFactory::CreateForProfile(
60 Profile* profile, 57 Profile* profile,
61 ExtensionDownloaderDelegate* delegate) { 58 ExtensionDownloaderDelegate* delegate) {
62 std::unique_ptr<IdentityProvider> identity_provider( 59 std::unique_ptr<IdentityProvider> identity_provider(
63 new ProfileIdentityProvider( 60 new ProfileIdentityProvider(
64 SigninManagerFactory::GetForProfile(profile), 61 SigninManagerFactory::GetForProfile(profile),
65 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 62 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
66 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile))); 63 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile)));
67 std::unique_ptr<ExtensionDownloader> downloader = 64 std::unique_ptr<ExtensionDownloader> downloader =
68 CreateForRequestContext(profile->GetRequestContext(), delegate); 65 CreateForRequestContext(profile->GetRequestContext(), delegate);
69 downloader->SetWebstoreIdentityProvider(std::move(identity_provider)); 66 downloader->SetWebstoreIdentityProvider(std::move(identity_provider));
70 return downloader; 67 return downloader;
71 } 68 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698