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

Side by Side Diff: chrome/installer/util/google_chrome_distribution.cc

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more, Windows-only Created 8 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines specific implementation of BrowserDistribution class for 5 // This file defines specific implementation of BrowserDistribution class for
6 // Google Chrome. 6 // Google Chrome.
7 7
8 #include "chrome/installer/util/google_chrome_distribution.h" 8 #include "chrome/installer/util/google_chrome_distribution.h"
9 9
10 #include <vector> 10 #include <vector>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 GoogleChromeDistribution::GoogleChromeDistribution() 292 GoogleChromeDistribution::GoogleChromeDistribution()
293 : BrowserDistribution(CHROME_BROWSER), 293 : BrowserDistribution(CHROME_BROWSER),
294 product_guid_(kChromeGuid) { 294 product_guid_(kChromeGuid) {
295 } 295 }
296 296
297 // The functions below are not used by the 64-bit Windows binary - 297 // The functions below are not used by the 64-bit Windows binary -
298 // see the comment in google_chrome_distribution_dummy.cc 298 // see the comment in google_chrome_distribution_dummy.cc
299 #ifndef _WIN64 299 #ifndef _WIN64
300 bool GoogleChromeDistribution::BuildUninstallMetricsString( 300 bool GoogleChromeDistribution::BuildUninstallMetricsString(
301 DictionaryValue* uninstall_metrics_dict, string16* metrics) { 301 const DictionaryValue* uninstall_metrics_dict, string16* metrics) {
302 DCHECK(NULL != metrics); 302 DCHECK(NULL != metrics);
303 bool has_values = false; 303 bool has_values = false;
304 304
305 for (DictionaryValue::key_iterator iter(uninstall_metrics_dict->begin_keys()); 305 for (DictionaryValue::key_iterator iter(uninstall_metrics_dict->begin_keys());
306 iter != uninstall_metrics_dict->end_keys(); ++iter) { 306 iter != uninstall_metrics_dict->end_keys(); ++iter) {
307 has_values = true; 307 has_values = true;
308 metrics->append(L"&"); 308 metrics->append(L"&");
309 metrics->append(UTF8ToWide(*iter)); 309 metrics->append(UTF8ToWide(*iter));
310 metrics->append(L"="); 310 metrics->append(L"=");
311 311
(...skipping 28 matching lines...) Expand all
340 string16* uninstall_metrics_string) { 340 string16* uninstall_metrics_string) {
341 // Make sure that the user wants us reporting metrics. If not, don't 341 // Make sure that the user wants us reporting metrics. If not, don't
342 // add our uninstall metrics. 342 // add our uninstall metrics.
343 bool metrics_reporting_enabled = false; 343 bool metrics_reporting_enabled = false;
344 if (!root.GetBoolean(prefs::kMetricsReportingEnabled, 344 if (!root.GetBoolean(prefs::kMetricsReportingEnabled,
345 &metrics_reporting_enabled) || 345 &metrics_reporting_enabled) ||
346 !metrics_reporting_enabled) { 346 !metrics_reporting_enabled) {
347 return false; 347 return false;
348 } 348 }
349 349
350 DictionaryValue* uninstall_metrics_dict; 350 const DictionaryValue* uninstall_metrics_dict;
351 if (!root.HasKey(installer::kUninstallMetricsName) || 351 if (!root.HasKey(installer::kUninstallMetricsName) ||
352 !root.GetDictionary(installer::kUninstallMetricsName, 352 !root.GetDictionary(installer::kUninstallMetricsName,
353 &uninstall_metrics_dict)) { 353 &uninstall_metrics_dict)) {
354 return false; 354 return false;
355 } 355 }
356 356
357 if (!BuildUninstallMetricsString(uninstall_metrics_dict, 357 if (!BuildUninstallMetricsString(uninstall_metrics_dict,
358 uninstall_metrics_string)) { 358 uninstall_metrics_string)) {
359 return false; 359 return false;
360 } 360 }
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 // we waited for chrome to exit so the uninstall would not detect chrome 862 // we waited for chrome to exit so the uninstall would not detect chrome
863 // running. 863 // running.
864 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( 864 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch(
865 installer::switches::kSystemLevelToast); 865 installer::switches::kSystemLevelToast);
866 866
867 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, 867 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast,
868 GetType())); 868 GetType()));
869 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); 869 base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
870 } 870 }
871 #endif 871 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698