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

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

Issue 1120006: detect preferences errors (Closed)
Patch Set: changes from review Created 10 years, 8 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <windows.h> 10 #include <windows.h>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 return has_values; 186 return has_values;
187 } 187 }
188 188
189 bool GoogleChromeDistribution::ExtractUninstallMetricsFromFile( 189 bool GoogleChromeDistribution::ExtractUninstallMetricsFromFile(
190 const std::wstring& file_path, std::wstring* uninstall_metrics_string) { 190 const std::wstring& file_path, std::wstring* uninstall_metrics_string) {
191 191
192 JSONFileValueSerializer json_serializer(FilePath::FromWStringHack(file_path)); 192 JSONFileValueSerializer json_serializer(FilePath::FromWStringHack(file_path));
193 193
194 std::string json_error_string; 194 std::string json_error_string;
195 scoped_ptr<Value> root(json_serializer.Deserialize(NULL)); 195 scoped_ptr<Value> root(json_serializer.Deserialize(NULL, NULL));
196 if (!root.get()) 196 if (!root.get())
197 return false; 197 return false;
198 198
199 // Preferences should always have a dictionary root. 199 // Preferences should always have a dictionary root.
200 if (!root->IsType(Value::TYPE_DICTIONARY)) 200 if (!root->IsType(Value::TYPE_DICTIONARY))
201 return false; 201 return false;
202 202
203 return ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()), 203 return ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()),
204 uninstall_metrics_string); 204 uninstall_metrics_string);
205 } 205 }
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor)); 582 GoogleUpdateSettings::SetClient(GetExperimentGroup(outcome, flavor));
583 if (outcome != kToastExpUninstallGroup) 583 if (outcome != kToastExpUninstallGroup)
584 return; 584 return;
585 // The user wants to uninstall. This is a best effort operation. Note that 585 // The user wants to uninstall. This is a best effort operation. Note that
586 // we waited for chrome to exit so the uninstall would not detect chrome 586 // we waited for chrome to exit so the uninstall would not detect chrome
587 // running. 587 // running.
588 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(system_install), 588 base::LaunchApp(InstallUtil::GetChromeUninstallCmd(system_install),
589 false, false, NULL); 589 false, false, NULL);
590 } 590 }
591 #endif 591 #endif
OLDNEW
« no previous file with comments | « chrome/common/json_value_serializer_unittest.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698