| OLD | NEW |
| 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) |
| 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 Loading... |
| 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 |
| OLD | NEW |