| 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_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chrome/browser/chromeos/settings/cros_settings.h" | 14 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 14 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 16 #include "chromeos/chromeos_switches.h" |
| 15 #include "chromeos/network/network_type_pattern.h" | 17 #include "chromeos/network/network_type_pattern.h" |
| 16 #include "chromeos/settings/cros_settings_names.h" | 18 #include "chromeos/settings/cros_settings_names.h" |
| 17 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 22 const bool kDefaultUpdateOverCellularAllowed = false; | 24 const bool kDefaultUpdateOverCellularAllowed = false; |
| 23 | 25 |
| 24 } // namespace | 26 } // namespace |
| 25 | 27 |
| 26 namespace help_utils_chromeos { | 28 namespace help_utils_chromeos { |
| 27 | 29 |
| 28 bool IsUpdateOverCellularAllowed() { | 30 bool IsUpdateOverCellularAllowed() { |
| 31 // Devices with a hard-coded policy to allow cellular roaming implicitly also |
| 32 // allow updates over cellular; see http://crbug.com/640721. |
| 33 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 34 chromeos::switches::kAllowDataRoamingByDefault)) |
| 35 return true; |
| 36 |
| 29 chromeos::CrosSettings* settings = chromeos::CrosSettings::Get(); | 37 chromeos::CrosSettings* settings = chromeos::CrosSettings::Get(); |
| 30 if (!settings) | 38 if (!settings) |
| 31 return kDefaultUpdateOverCellularAllowed; | 39 return kDefaultUpdateOverCellularAllowed; |
| 32 | 40 |
| 33 const base::Value* raw_types_value = | 41 const base::Value* raw_types_value = |
| 34 settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate); | 42 settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate); |
| 35 if (!raw_types_value) | 43 if (!raw_types_value) |
| 36 return kDefaultUpdateOverCellularAllowed; | 44 return kDefaultUpdateOverCellularAllowed; |
| 37 const base::ListValue* types_value; | 45 const base::ListValue* types_value; |
| 38 CHECK(raw_types_value->GetAsList(&types_value)); | 46 CHECK(raw_types_value->GetAsList(&types_value)); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 59 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH); | 67 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH); |
| 60 if (type == shill::kTypeCellular) | 68 if (type == shill::kTypeCellular) |
| 61 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR); | 69 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR); |
| 62 if (type == shill::kTypeVPN) | 70 if (type == shill::kTypeVPN) |
| 63 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN); | 71 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN); |
| 64 NOTREACHED(); | 72 NOTREACHED(); |
| 65 return base::string16(); | 73 return base::string16(); |
| 66 } | 74 } |
| 67 | 75 |
| 68 } // namespace help_utils_chromeos | 76 } // namespace help_utils_chromeos |
| OLD | NEW |