Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/about_handler.h" | 5 #include "chrome/browser/ui/webui/settings/about_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 const std::string label_text; | 96 const std::string label_text; |
| 97 const std::string image_url; | 97 const std::string image_url; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // Returns message that informs user that for update it's better to | 100 // Returns message that informs user that for update it's better to |
| 101 // connect to a network of one of the allowed types. | 101 // connect to a network of one of the allowed types. |
| 102 base::string16 GetAllowedConnectionTypesMessage() { | 102 base::string16 GetAllowedConnectionTypesMessage() { |
| 103 const chromeos::NetworkState* network = chromeos::NetworkHandler::Get() | 103 const chromeos::NetworkState* network = chromeos::NetworkHandler::Get() |
| 104 ->network_state_handler() | 104 ->network_state_handler() |
| 105 ->DefaultNetwork(); | 105 ->DefaultNetwork(); |
| 106 const bool cellular = network && network->IsConnectedState() && | 106 const bool cellular = |
|
stevenjb
2017/06/01 20:03:00
nit: we should rename this mobile_data. (We can le
weidongg
2017/06/01 20:41:00
Done.
| |
| 107 network->type() == shill::kTypeCellular; | 107 network && network->IsConnectedState() && network->IsUsingMobileData(); |
| 108 | 108 |
| 109 if (help_utils_chromeos::IsUpdateOverCellularAllowed( | 109 if (help_utils_chromeos::IsUpdateOverCellularAllowed( |
| 110 true /* interactive */)) { | 110 true /* interactive */)) { |
| 111 return cellular | 111 return cellular |
| 112 ? l10n_util::GetStringUTF16( | 112 ? l10n_util::GetStringUTF16( |
| 113 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED_NOT_AUTOMATIC) | 113 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED_NOT_AUTOMATIC) |
| 114 : l10n_util::GetStringUTF16( | 114 : l10n_util::GetStringUTF16( |
| 115 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); | 115 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); |
| 116 } else { | 116 } else { |
| 117 return l10n_util::GetStringUTF16( | 117 return l10n_util::GetStringUTF16( |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 label_dir_path.AppendASCII(kRegulatoryLabelImageFilename).MaybeAsASCII(); | 686 label_dir_path.AppendASCII(kRegulatoryLabelImageFilename).MaybeAsASCII(); |
| 687 std::string url = | 687 std::string url = |
| 688 std::string("chrome://") + chrome::kChromeOSAssetHost + "/" + image_path; | 688 std::string("chrome://") + chrome::kChromeOSAssetHost + "/" + image_path; |
| 689 regulatory_info->SetString("url", url); | 689 regulatory_info->SetString("url", url); |
| 690 | 690 |
| 691 ResolveJavascriptCallback(base::Value(callback_id), *regulatory_info); | 691 ResolveJavascriptCallback(base::Value(callback_id), *regulatory_info); |
| 692 } | 692 } |
| 693 #endif // defined(OS_CHROMEOS) | 693 #endif // defined(OS_CHROMEOS) |
| 694 | 694 |
| 695 } // namespace settings | 695 } // namespace settings |
| OLD | NEW |