| 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 = |
| 107 network->type() == shill::kTypeCellular; | 107 network && network->IsConnectedState() && |
| 108 (network->type() == shill::kTypeCellular || |
| 109 network->tethering_state() == shill::kTetheringConfirmedState); |
| 108 | 110 |
| 109 if (help_utils_chromeos::IsUpdateOverCellularAllowed( | 111 if (help_utils_chromeos::IsUpdateOverCellularAllowed( |
| 110 true /* interactive */)) { | 112 true /* interactive */)) { |
| 111 return cellular | 113 return cellular |
| 112 ? l10n_util::GetStringUTF16( | 114 ? l10n_util::GetStringUTF16( |
| 113 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED_NOT_AUTOMATIC) | 115 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED_NOT_AUTOMATIC) |
| 114 : l10n_util::GetStringUTF16( | 116 : l10n_util::GetStringUTF16( |
| 115 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); | 117 IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED); |
| 116 } else { | 118 } else { |
| 117 return l10n_util::GetStringUTF16( | 119 return l10n_util::GetStringUTF16( |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 label_dir_path.AppendASCII(kRegulatoryLabelImageFilename).MaybeAsASCII(); | 688 label_dir_path.AppendASCII(kRegulatoryLabelImageFilename).MaybeAsASCII(); |
| 687 std::string url = | 689 std::string url = |
| 688 std::string("chrome://") + chrome::kChromeOSAssetHost + "/" + image_path; | 690 std::string("chrome://") + chrome::kChromeOSAssetHost + "/" + image_path; |
| 689 regulatory_info->SetString("url", url); | 691 regulatory_info->SetString("url", url); |
| 690 | 692 |
| 691 ResolveJavascriptCallback(base::Value(callback_id), *regulatory_info); | 693 ResolveJavascriptCallback(base::Value(callback_id), *regulatory_info); |
| 692 } | 694 } |
| 693 #endif // defined(OS_CHROMEOS) | 695 #endif // defined(OS_CHROMEOS) |
| 694 | 696 |
| 695 } // namespace settings | 697 } // namespace settings |
| OLD | NEW |