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

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

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 std::wstring GoogleChromeDistribution::GetDistributionData(HKEY root_key) { 442 std::wstring GoogleChromeDistribution::GetDistributionData(HKEY root_key) {
443 std::wstring sub_key(google_update::kRegPathClientState); 443 std::wstring sub_key(google_update::kRegPathClientState);
444 sub_key.append(L"\\"); 444 sub_key.append(L"\\");
445 sub_key.append(product_guid()); 445 sub_key.append(product_guid());
446 446
447 base::win::RegKey client_state_key(root_key, sub_key.c_str(), KEY_READ); 447 base::win::RegKey client_state_key(root_key, sub_key.c_str(), KEY_READ);
448 std::wstring result; 448 std::wstring result;
449 std::wstring brand_value; 449 std::wstring brand_value;
450 if (client_state_key.ReadValue(google_update::kRegRLZBrandField, 450 if (client_state_key.ReadValue(google_update::kRegRLZBrandField,
451 &brand_value)) { 451 &brand_value) == ERROR_SUCCESS) {
452 result = google_update::kRegRLZBrandField; 452 result = google_update::kRegRLZBrandField;
453 result.append(L"="); 453 result.append(L"=");
454 result.append(brand_value); 454 result.append(brand_value);
455 result.append(L"&"); 455 result.append(L"&");
456 } 456 }
457 457
458 std::wstring client_value; 458 std::wstring client_value;
459 if (client_state_key.ReadValue(google_update::kRegClientField, 459 if (client_state_key.ReadValue(google_update::kRegClientField,
460 &client_value)) { 460 &client_value) == ERROR_SUCCESS) {
461 result.append(google_update::kRegClientField); 461 result.append(google_update::kRegClientField);
462 result.append(L"="); 462 result.append(L"=");
463 result.append(client_value); 463 result.append(client_value);
464 result.append(L"&"); 464 result.append(L"&");
465 } 465 }
466 466
467 std::wstring ap_value; 467 std::wstring ap_value;
468 // If we fail to read the ap key, send up "&ap=" anyway to indicate 468 // If we fail to read the ap key, send up "&ap=" anyway to indicate
469 // that this was probably a stable channel release. 469 // that this was probably a stable channel release.
470 client_state_key.ReadValue(google_update::kRegApField, &ap_value); 470 client_state_key.ReadValue(google_update::kRegApField, &ap_value);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 base::LaunchApp(cmd, false, false, NULL); 688 base::LaunchApp(cmd, false, false, NULL);
689 } 689 }
690 #endif 690 #endif
691 691
692 bool GoogleChromeDistribution::SetChannelFlags( 692 bool GoogleChromeDistribution::SetChannelFlags(
693 bool set, 693 bool set,
694 installer::ChannelInfo* channel_info) { 694 installer::ChannelInfo* channel_info) {
695 DCHECK(channel_info); 695 DCHECK(channel_info);
696 return channel_info->SetChrome(set); 696 return channel_info->SetChrome(set);
697 } 697 }
OLDNEW
« no previous file with comments | « chrome/installer/util/delete_reg_value_work_item_unittest.cc ('k') | chrome/installer/util/google_update_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698