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

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

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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) 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 #include "chrome/installer/util/google_update_settings.h" 5 #include "chrome/installer/util/google_update_settings.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 RegKey clientstate; 670 RegKey clientstate;
671 if (clientstate.Open(root_key, clientstate_reg_path.c_str(), 671 if (clientstate.Open(root_key, clientstate_reg_path.c_str(),
672 KEY_QUERY_VALUE) == ERROR_SUCCESS) { 672 KEY_QUERY_VALUE) == ERROR_SUCCESS) {
673 base::string16 version; 673 base::string16 version;
674 DWORD dword_value; 674 DWORD dword_value;
675 if ((clientstate.ReadValueDW(google_update::kRegLastCheckSuccessField, 675 if ((clientstate.ReadValueDW(google_update::kRegLastCheckSuccessField,
676 &dword_value) == ERROR_SUCCESS) && 676 &dword_value) == ERROR_SUCCESS) &&
677 (clientstate.ReadValue(google_update::kRegVersionField, 677 (clientstate.ReadValue(google_update::kRegVersionField,
678 &version) == ERROR_SUCCESS)) { 678 &version) == ERROR_SUCCESS)) {
679 product_found = true; 679 product_found = true;
680 data->version = WideToASCII(version); 680 data->version = base::UTF16ToASCII(version);
681 data->last_success = base::Time::FromTimeT(dword_value); 681 data->last_success = base::Time::FromTimeT(dword_value);
682 data->last_result = 0; 682 data->last_result = 0;
683 data->last_error_code = 0; 683 data->last_error_code = 0;
684 data->last_extra_code = 0; 684 data->last_extra_code = 0;
685 685
686 if (clientstate.ReadValueDW(google_update::kRegLastInstallerResultField, 686 if (clientstate.ReadValueDW(google_update::kRegLastInstallerResultField,
687 &dword_value) == ERROR_SUCCESS) { 687 &dword_value) == ERROR_SUCCESS) {
688 // Google Update convention is that if an installer writes an result 688 // Google Update convention is that if an installer writes an result
689 // code that is invalid, it is clamped to an exit code result. 689 // code that is invalid, it is clamped to an exit code result.
690 const DWORD kMaxValidInstallResult = 4; // INSTALLER_RESULT_EXIT_CODE 690 const DWORD kMaxValidInstallResult = 4; // INSTALLER_RESULT_EXIT_CODE
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 } 768 }
769 769
770 // If the key or value was not present, return the empty string. 770 // If the key or value was not present, return the empty string.
771 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { 771 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) {
772 experiment_labels->clear(); 772 experiment_labels->clear();
773 return true; 773 return true;
774 } 774 }
775 775
776 return result == ERROR_SUCCESS; 776 return result == ERROR_SUCCESS;
777 } 777 }
OLDNEW
« no previous file with comments | « chrome/installer/test/alternate_version_generator.cc ('k') | chrome/installer/util/install_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698