OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 const FilePath& file_path, | 308 const FilePath& file_path, |
309 std::wstring* uninstall_metrics_string) { | 309 std::wstring* uninstall_metrics_string) { |
310 JSONFileValueSerializer json_serializer(file_path); | 310 JSONFileValueSerializer json_serializer(file_path); |
311 | 311 |
312 std::string json_error_string; | 312 std::string json_error_string; |
313 scoped_ptr<Value> root(json_serializer.Deserialize(NULL, NULL)); | 313 scoped_ptr<Value> root(json_serializer.Deserialize(NULL, NULL)); |
314 if (!root.get()) | 314 if (!root.get()) |
315 return false; | 315 return false; |
316 | 316 |
317 // Preferences should always have a dictionary root. | 317 // Preferences should always have a dictionary root. |
318 if (!root->IsType(Value::TYPE_DICTIONARY)) | 318 if (!root->IsDictionary()) |
319 return false; | 319 return false; |
320 | 320 |
321 return ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()), | 321 return ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()), |
322 uninstall_metrics_string); | 322 uninstall_metrics_string); |
323 } | 323 } |
324 | 324 |
325 bool GoogleChromeDistribution::ExtractUninstallMetrics( | 325 bool GoogleChromeDistribution::ExtractUninstallMetrics( |
326 const DictionaryValue& root, std::wstring* uninstall_metrics_string) { | 326 const DictionaryValue& root, std::wstring* uninstall_metrics_string) { |
327 // Make sure that the user wants us reporting metrics. If not, don't | 327 // Make sure that the user wants us reporting metrics. If not, don't |
328 // add our uninstall metrics. | 328 // add our uninstall metrics. |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 // we waited for chrome to exit so the uninstall would not detect chrome | 801 // we waited for chrome to exit so the uninstall would not detect chrome |
802 // running. | 802 // running. |
803 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( | 803 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( |
804 installer::switches::kSystemLevelToast); | 804 installer::switches::kSystemLevelToast); |
805 | 805 |
806 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, | 806 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, |
807 GetType())); | 807 GetType())); |
808 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 808 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
809 } | 809 } |
810 #endif | 810 #endif |
OLD | NEW |