Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 470433002: Fix segfault when getting network details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcheck Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 } 1367 }
1368 1368
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
1378 DCHECK_EQ(onc == NULL, onc_source == ::onc::ONC_SOURCE_NONE);
1377 bool auto_connect_recommended = 1379 bool auto_connect_recommended =
1378 auto_connect_onc_source != ::onc::ONC_SOURCE_NONE && 1380 auto_connect_onc_source != ::onc::ONC_SOURCE_NONE &&
1379 onc::IsRecommendedValue(onc, onc_path_to_auto_connect); 1381 onc::IsRecommendedValue(onc, onc_path_to_auto_connect);
1380 // |auto_connect_default_value| will contain either a recommended value 1382 // If a policy exists, |auto_connect_default_value| will contain either a
1381 // if |auto_connect_recommended| is true, or an enforced value otherwise. 1383 // recommended value (if |auto_connect_recommended| is true) or an enforced
1384 // value (if |auto_connect_recommended| is false).
1382 const base::Value* auto_connect_default_value = NULL; 1385 const base::Value* auto_connect_default_value = NULL;
1383 onc->Get(onc_path_to_auto_connect, &auto_connect_default_value); 1386 if (onc)
1387 onc->Get(onc_path_to_auto_connect, &auto_connect_default_value);
1384 1388
1385 // Autoconnect can be controlled by the GlobalNetworkConfiguration of the 1389 // Autoconnect can be controlled by the GlobalNetworkConfiguration of the
1386 // ONC policy. 1390 // ONC policy.
1387 if (auto_connect_onc_source == ::onc::ONC_SOURCE_NONE && 1391 if (auto_connect_onc_source == ::onc::ONC_SOURCE_NONE &&
1388 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect( 1392 onc::PolicyAllowsOnlyPolicyNetworksToAutoconnect(
1389 network->IsPrivate())) { 1393 network->IsPrivate())) {
1390 auto_connect_recommended = false; 1394 auto_connect_recommended = false;
1391 auto_connect_onc_source = network->IsPrivate() 1395 auto_connect_onc_source = network->IsPrivate()
1392 ? ::onc::ONC_SOURCE_USER_POLICY 1396 ? ::onc::ONC_SOURCE_USER_POLICY
1393 : ::onc::ONC_SOURCE_DEVICE_POLICY; 1397 : ::onc::ONC_SOURCE_DEVICE_POLICY;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 dictionary->SetBoolean( 1600 dictionary->SetBoolean(
1597 kTagWimaxAvailable, 1601 kTagWimaxAvailable,
1598 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax())); 1602 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax()));
1599 dictionary->SetBoolean( 1603 dictionary->SetBoolean(
1600 kTagWimaxEnabled, 1604 kTagWimaxEnabled,
1601 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())); 1605 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax()));
1602 } 1606 }
1603 1607
1604 } // namespace options 1608 } // namespace options
1605 } // namespace chromeos 1609 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698