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

Side by Side Diff: base/sys_info_chromeos.cc

Issue 7104076: Revert 88440 - Change Chrome OS version numbers to Platform versions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/browser_about_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 if (std::string::npos == version_key_index) { 88 if (std::string::npos == version_key_index) {
89 return; 89 return;
90 } 90 }
91 91
92 size_t start_index = lsb_release.find_first_of('=', version_key_index); 92 size_t start_index = lsb_release.find_first_of('=', version_key_index);
93 start_index++; // Move past '='. 93 start_index++; // Move past '='.
94 size_t length = lsb_release.find_first_of('\n', start_index) - start_index; 94 size_t length = lsb_release.find_first_of('\n', start_index) - start_index;
95 std::string version = lsb_release.substr(start_index, length); 95 std::string version = lsb_release.substr(start_index, length);
96 StringTokenizer tokenizer(version, "."); 96 StringTokenizer tokenizer(version, ".");
97 // TODO(rkc): Ignore the 0. here; fix this once we move Chrome OS version 97 for (int i = 0; i < 3 && tokenizer.GetNext(); i++) {
98 // numbers from the 0.xx.yyy.zz format to the xx.yyy.zz format. 98 if (0 == i) {
99 // Refer to http://code.google.com/p/chromium-os/issues/detail?id=15789
100 for (int i = 0; i < 4 && tokenizer.GetNext(); i++) {
101 if (1 == i) {
102 StringToInt(tokenizer.token_begin(), 99 StringToInt(tokenizer.token_begin(),
103 tokenizer.token_end(), 100 tokenizer.token_end(),
104 major_version); 101 major_version);
105 *minor_version = *bugfix_version = 0; 102 *minor_version = *bugfix_version = 0;
106 } else if (2 == i) { 103 } else if (1 == i) {
107 StringToInt(tokenizer.token_begin(), 104 StringToInt(tokenizer.token_begin(),
108 tokenizer.token_end(), 105 tokenizer.token_end(),
109 minor_version); 106 minor_version);
110 } else { // 3 == i 107 } else { // 2 == i
111 StringToInt(tokenizer.token_begin(), 108 StringToInt(tokenizer.token_begin(),
112 tokenizer.token_end(), 109 tokenizer.token_end(),
113 bugfix_version); 110 bugfix_version);
114 } 111 }
115 } 112 }
116 } 113 }
117 114
118 } // namespace base 115 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_about_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698