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

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

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/common/web_resource/web_resource_unpacker.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698