| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/chromeos/internet_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 296 |
| 297 bool HasPolicyForFavorite(const FavoriteState* favorite, | 297 bool HasPolicyForFavorite(const FavoriteState* favorite, |
| 298 const PrefService* profile_prefs) { | 298 const PrefService* profile_prefs) { |
| 299 return onc::HasPolicyForFavoriteNetwork( | 299 return onc::HasPolicyForFavoriteNetwork( |
| 300 profile_prefs, g_browser_process->local_state(), *favorite); | 300 profile_prefs, g_browser_process->local_state(), *favorite); |
| 301 } | 301 } |
| 302 | 302 |
| 303 bool HasPolicyForNetwork(const NetworkState* network, | 303 bool HasPolicyForNetwork(const NetworkState* network, |
| 304 const PrefService* profile_prefs) { | 304 const PrefService* profile_prefs) { |
| 305 const FavoriteState* favorite = | 305 const FavoriteState* favorite = |
| 306 NetworkHandler::Get()->network_state_handler()->GetFavoriteState( | 306 NetworkHandler::Get() |
| 307 network->path()); | 307 ->network_state_handler() |
| 308 ->GetFavoriteStateFromServicePath(network->path(), |
| 309 true /* configured_only */); |
| 308 if (!favorite) | 310 if (!favorite) |
| 309 return false; | 311 return false; |
| 310 return HasPolicyForFavorite(favorite, profile_prefs); | 312 return HasPolicyForFavorite(favorite, profile_prefs); |
| 311 } | 313 } |
| 312 | 314 |
| 313 void SetCommonNetworkInfo(const ManagedState* state, | 315 void SetCommonNetworkInfo(const ManagedState* state, |
| 314 const gfx::ImageSkia& icon, | 316 const gfx::ImageSkia& icon, |
| 315 ui::ScaleFactor icon_scale_factor, | 317 ui::ScaleFactor icon_scale_factor, |
| 316 base::DictionaryValue* network_info) { | 318 base::DictionaryValue* network_info) { |
| 317 gfx::ImageSkiaRep image_rep = | 319 gfx::ImageSkiaRep image_rep = |
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 dictionary->SetBoolean( | 1821 dictionary->SetBoolean( |
| 1820 kTagWimaxAvailable, | 1822 kTagWimaxAvailable, |
| 1821 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax())); | 1823 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax())); |
| 1822 dictionary->SetBoolean( | 1824 dictionary->SetBoolean( |
| 1823 kTagWimaxEnabled, | 1825 kTagWimaxEnabled, |
| 1824 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())); | 1826 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())); |
| 1825 } | 1827 } |
| 1826 | 1828 |
| 1827 } // namespace options | 1829 } // namespace options |
| 1828 } // namespace chromeos | 1830 } // namespace chromeos |
| OLD | NEW |