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

Side by Side Diff: chrome/browser/ui/webui/help/help_utils.cc

Issue 449623003: Integrate About page into Settings for Chrome OS settings in a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/ui/webui/help/help_utils_chromeos.h" 5 #include "chrome/browser/ui/webui/help/help_utils.h"
6
7 #include <algorithm>
8 6
9 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/chrome_version_info.h"
11
12 #if defined(OS_CHROMEOS)
Dan Beam 2014/08/13 02:50:46 i doesn't make a ton of sense to me to rename from
michaelpg 2014/08/13 08:12:11 ok. This might as well go in help_utils_chromes an
11 #include "chrome/browser/chromeos/settings/cros_settings.h" 13 #include "chrome/browser/chromeos/settings/cros_settings.h"
12 #include "chromeos/network/network_type_pattern.h" 14 #include "chromeos/network/network_type_pattern.h"
13 #include "chromeos/settings/cros_settings_names.h" 15 #include "chromeos/settings/cros_settings_names.h"
14 #include "grit/chromium_strings.h" 16 #include "grit/chromium_strings.h"
15 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
16 #include "third_party/cros_system_api/dbus/service_constants.h" 18 #include "third_party/cros_system_api/dbus/service_constants.h"
17 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
20 #endif
18 21
22 #if defined(OS_CHROMEOS)
19 namespace { 23 namespace {
20 24
21 const bool kDefaultUpdateOverCellularAllowed = false; 25 const bool kDefaultUpdateOverCellularAllowed = false;
22 26
23 } // namespace 27 } // namespace
28 #endif
24 29
25 namespace help_utils_chromeos { 30 namespace help_utils {
26 31
32 base::string16 BuildBrowserVersionString() {
33 chrome::VersionInfo version_info;
34 DCHECK(version_info.is_valid());
35
36 std::string browser_version = version_info.Version();
37 std::string version_modifier =
38 chrome::VersionInfo::GetVersionStringModifier();
39 if (!version_modifier.empty())
40 browser_version += " " + version_modifier;
41
42 #if !defined(GOOGLE_CHROME_BUILD)
43 browser_version += " (";
44 browser_version += version_info.LastChange();
45 browser_version += ")";
46 #endif
47
48 #if defined(ARCH_CPU_64_BITS)
49 browser_version += " (64-bit)";
50 #endif
51
52 return base::UTF8ToUTF16(browser_version);
53 }
54
55 #if defined(OS_CHROMEOS)
27 bool IsUpdateOverCellularAllowed() { 56 bool IsUpdateOverCellularAllowed() {
28 chromeos::CrosSettings* settings = chromeos::CrosSettings::Get(); 57 chromeos::CrosSettings* settings = chromeos::CrosSettings::Get();
29 if (!settings) 58 if (!settings)
30 return kDefaultUpdateOverCellularAllowed; 59 return kDefaultUpdateOverCellularAllowed;
31 60
32 const base::Value* raw_types_value = 61 const base::Value* raw_types_value =
33 settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate); 62 settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate);
34 if (!raw_types_value) 63 if (!raw_types_value)
35 return kDefaultUpdateOverCellularAllowed; 64 return kDefaultUpdateOverCellularAllowed;
36 const base::ListValue* types_value; 65 const base::ListValue* types_value;
(...skipping 19 matching lines...) Expand all
56 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIMAX); 85 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIMAX);
57 if (type == shill::kTypeBluetooth) 86 if (type == shill::kTypeBluetooth)
58 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH); 87 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH);
59 if (type == shill::kTypeCellular) 88 if (type == shill::kTypeCellular)
60 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR); 89 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR);
61 if (type == shill::kTypeVPN) 90 if (type == shill::kTypeVPN)
62 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN); 91 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN);
63 NOTREACHED(); 92 NOTREACHED();
64 return base::string16(); 93 return base::string16();
65 } 94 }
95 #endif // OS_CHROMEOS
66 96
67 } // namespace help_utils_chromeos 97 } // namespace help_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698