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

Side by Side Diff: base/sys_info_chromeos.cc

Issue 7108019: Change Chrome OS version numbers to Platform versions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated header for 2011 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 for (int i = 0; i < 3 && tokenizer.GetNext(); i++) { 97 // TODO(rkc): Ignore the 0. here; fix this once we move Chrome OS version
98 if (0 == i) { 98 // numbers from the 0.xx.yyy.zz format to the xx.yyy.zz format.
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) {
99 StringToInt(tokenizer.token_begin(), 102 StringToInt(tokenizer.token_begin(),
100 tokenizer.token_end(), 103 tokenizer.token_end(),
101 major_version); 104 major_version);
102 *minor_version = *bugfix_version = 0; 105 *minor_version = *bugfix_version = 0;
103 } else if (1 == i) { 106 } else if (2 == i) {
104 StringToInt(tokenizer.token_begin(), 107 StringToInt(tokenizer.token_begin(),
105 tokenizer.token_end(), 108 tokenizer.token_end(),
106 minor_version); 109 minor_version);
107 } else { // 2 == i 110 } else { // 3 == i
108 StringToInt(tokenizer.token_begin(), 111 StringToInt(tokenizer.token_begin(),
109 tokenizer.token_end(), 112 tokenizer.token_end(),
110 bugfix_version); 113 bugfix_version);
111 } 114 }
112 } 115 }
113 } 116 }
114 117
115 } // namespace base 118 } // 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