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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1369 if (!onc_path_to_auto_connect.empty()) { | 1369 if (!onc_path_to_auto_connect.empty()) { |
1370 bool auto_connect = false; | 1370 bool auto_connect = false; |
1371 shill_properties.GetBooleanWithoutPathExpansion( | 1371 shill_properties.GetBooleanWithoutPathExpansion( |
1372 shill::kAutoConnectProperty, &auto_connect); | 1372 shill::kAutoConnectProperty, &auto_connect); |
1373 | 1373 |
1374 scoped_ptr<base::Value> auto_connect_value( | 1374 scoped_ptr<base::Value> auto_connect_value( |
1375 new base::FundamentalValue(auto_connect)); | 1375 new base::FundamentalValue(auto_connect)); |
1376 ::onc::ONCSource auto_connect_onc_source = onc_source; | 1376 ::onc::ONCSource auto_connect_onc_source = onc_source; |
1377 bool auto_connect_recommended = | 1377 bool auto_connect_recommended = |
1378 auto_connect_onc_source != ::onc::ONC_SOURCE_NONE && | 1378 auto_connect_onc_source != ::onc::ONC_SOURCE_NONE && |
1379 onc::IsRecommendedValue(onc, onc_path_to_auto_connect); | 1379 onc && onc::IsRecommendedValue(onc, onc_path_to_auto_connect); |
pneubeck (no reviews)
2014/08/13 02:37:14
optional nit:
strictly, this 'onc' condition shoul
michaelpg
2014/08/13 02:59:03
Done.
| |
1380 // |auto_connect_default_value| will contain either a recommended value | 1380 // If a policy exists, |auto_connect_default_value| will contain either a |
1381 // if |auto_connect_recommended| is true, or an enforced value otherwise. | 1381 // recommended value (if |auto_connect_recommended| is true) or an enforced |
1382 // value (if |auto_connect_recommended| is false). | |
1382 const base::Value* auto_connect_default_value = NULL; | 1383 const base::Value* auto_connect_default_value = NULL; |
1383 onc->Get(onc_path_to_auto_connect, &auto_connect_default_value); | 1384 if (onc) |
1385 onc->Get(onc_path_to_auto_connect, &auto_connect_default_value); | |
1384 | 1386 |
1385 // Autoconnect can be controlled by the GlobalNetworkConfiguration of the | 1387 // Autoconnect can be controlled by the GlobalNetworkConfiguration of the |
1386 // ONC policy. | 1388 // ONC policy. |
1387 if (auto_connect_onc_source == ::onc::ONC_SOURCE_NONE && | 1389 if (auto_connect_onc_source == ::onc::ONC_SOURCE_NONE && |
1388 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect( | 1390 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect( |
1389 network->IsPrivate())) { | 1391 network->IsPrivate())) { |
1390 auto_connect_recommended = false; | 1392 auto_connect_recommended = false; |
1391 auto_connect_onc_source = network->IsPrivate() | 1393 auto_connect_onc_source = network->IsPrivate() |
1392 ? ::onc::ONC_SOURCE_USER_POLICY | 1394 ? ::onc::ONC_SOURCE_USER_POLICY |
1393 : ::onc::ONC_SOURCE_DEVICE_POLICY; | 1395 : ::onc::ONC_SOURCE_DEVICE_POLICY; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1596 dictionary->SetBoolean( | 1598 dictionary->SetBoolean( |
1597 kTagWimaxAvailable, | 1599 kTagWimaxAvailable, |
1598 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax())); | 1600 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax())); |
1599 dictionary->SetBoolean( | 1601 dictionary->SetBoolean( |
1600 kTagWimaxEnabled, | 1602 kTagWimaxEnabled, |
1601 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())); | 1603 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())); |
1602 } | 1604 } |
1603 | 1605 |
1604 } // namespace options | 1606 } // namespace options |
1605 } // namespace chromeos | 1607 } // namespace chromeos |
OLD | NEW |