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

Side by Side Diff: chrome/install_static/install_util.cc

Issue 2282143002: [install_static] GetCollectStatsConsentImpl() not returning true early (Closed)
Patch Set: Update with latest trunk. Created 4 years, 3 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 | no next file » | 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/install_static/install_util.h" 5 #include "chrome/install_static/install_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <assert.h> 8 #include <assert.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <iostream> 10 #include <iostream>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 std::wstring GetChromeInstallRegistryPath() { 245 std::wstring GetChromeInstallRegistryPath() {
246 std::wstring registry_path = L"Software\\"; 246 std::wstring registry_path = L"Software\\";
247 registry_path += GetChromeInstallSubDirectory(); 247 registry_path += GetChromeInstallSubDirectory();
248 return registry_path; 248 return registry_path;
249 } 249 }
250 250
251 bool GetCollectStatsConsentImpl(const std::wstring& exe_path) { 251 bool GetCollectStatsConsentImpl(const std::wstring& exe_path) {
252 bool enabled = true; 252 bool enabled = true;
253 bool controlled_by_policy = ReportingIsEnforcedByPolicy(&enabled);
254 253
255 if (controlled_by_policy && !enabled) 254 if (ReportingIsEnforcedByPolicy(&enabled))
256 return false; 255 return enabled;
257 256
258 bool system_install = IsSystemInstall(exe_path.c_str()); 257 bool system_install = IsSystemInstall(exe_path.c_str());
259 std::wstring app_guid; 258 std::wstring app_guid;
260 259
261 if (IsSxSChrome(exe_path.c_str())) { 260 if (IsSxSChrome(exe_path.c_str())) {
262 app_guid = kAppGuidCanary; 261 app_guid = kAppGuidCanary;
263 } else { 262 } else {
264 app_guid = IsMultiInstall(system_install) ? kAppGuidGoogleBinaries 263 app_guid = IsMultiInstall(system_install) ? kAppGuidGoogleBinaries
265 : kAppGuidGoogleChrome; 264 : kAppGuidGoogleChrome;
266 } 265 }
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 switch_value_end_offset = command_line_copy.length(); 888 switch_value_end_offset = command_line_copy.length();
890 889
891 std::string switch_value = command_line_copy.substr( 890 std::string switch_value = command_line_copy.substr(
892 switch_value_start_offset, 891 switch_value_start_offset,
893 switch_value_end_offset - (switch_offset + switch_token.length())); 892 switch_value_end_offset - (switch_offset + switch_token.length()));
894 TrimT<std::string>(&switch_value); 893 TrimT<std::string>(&switch_value);
895 return switch_value; 894 return switch_value;
896 } 895 }
897 896
898 } // namespace install_static 897 } // namespace install_static
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698