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

Side by Side Diff: chrome/browser/ui/android/android_about_app_info.cc

Issue 10957027: Add Application version and OS info in android about version page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed about_ui.cc and html changes Created 8 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/android/android_about_app_info.h"
6
7 #include <string>
8
9 #include "base/stringprintf.h"
10 #include "base/sys_info.h"
11
12 namespace about_android_app {
13
14 std::string GetOsInfo() {
15 std::string android_info_str;
16
17 // Append information about the OS version.
18 int32 os_major_version = 0;
19 int32 os_minor_version = 0;
20 int32 os_bugfix_version = 0;
21 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
22 &os_minor_version,
23 &os_bugfix_version);
24 base::StringAppendF(&android_info_str, "%d.%d.%d", os_major_version,
25 os_minor_version, os_bugfix_version);
26
27 // Append information about the device.
28 bool semicolon_inserted = false;
29 std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename();
30 std::string android_device_name = base::SysInfo::GetDeviceName();
31 if ("REL" == android_build_codename && android_device_name.size() > 0) {
32 android_info_str += "; " + android_device_name;
33 semicolon_inserted = true;
34 }
35
36 // Append the build ID.
37 std::string android_build_id = base::SysInfo::GetAndroidBuildID();
38 if (android_build_id.size() > 0) {
39 if (!semicolon_inserted) {
40 android_info_str += ";";
41 }
42 android_info_str += " Build/" + android_build_id;
43 }
44
45 return android_info_str;
46 }
47
48 } // namespace about_android_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698