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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 23526016: Autoconnect policy for CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
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/net_internals/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 !list->GetString(1, &passcode)) { 1545 !list->GetString(1, &passcode)) {
1546 NOTREACHED(); 1546 NOTREACHED();
1547 } 1547 }
1548 1548
1549 std::string error; 1549 std::string error;
1550 const chromeos::User* user = chromeos::UserManager::Get()->GetActiveUser(); 1550 const chromeos::User* user = chromeos::UserManager::Get()->GetActiveUser();
1551 if (user) { 1551 if (user) {
1552 onc::ONCSource onc_source = onc::ONC_SOURCE_USER_IMPORT; 1552 onc::ONCSource onc_source = onc::ONC_SOURCE_USER_IMPORT;
1553 1553
1554 base::ListValue network_configs; 1554 base::ListValue network_configs;
1555 base::DictionaryValue global_network_config;
1555 base::ListValue certificates; 1556 base::ListValue certificates;
1556 if (!chromeos::onc::ParseAndValidateOncForImport( 1557 if (!chromeos::onc::ParseAndValidateOncForImport(onc_blob,
1557 onc_blob, onc_source, passcode, &network_configs, &certificates)) { 1558 onc_source,
1559 passcode,
1560 &network_configs,
1561 &global_network_config,
1562 &certificates)) {
1558 error = "Errors occurred during the ONC parsing. "; 1563 error = "Errors occurred during the ONC parsing. ";
1559 } 1564 }
1560 1565
1561 chromeos::onc::CertificateImporterImpl cert_importer; 1566 chromeos::onc::CertificateImporterImpl cert_importer;
1562 if (!cert_importer.ImportCertificates(certificates, onc_source, NULL)) 1567 if (!cert_importer.ImportCertificates(certificates, onc_source, NULL))
1563 error += "Some certificates couldn't be imported. "; 1568 error += "Some certificates couldn't be imported. ";
1564 1569
1565 std::string network_error; 1570 std::string network_error;
1566 chromeos::onc::ImportNetworksForUser(user, network_configs, &network_error); 1571 chromeos::onc::ImportNetworksForUser(user, network_configs, &network_error);
1567 if (!network_error.empty()) 1572 if (!network_error.empty())
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 } 1876 }
1872 1877
1873 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1878 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1874 : WebUIController(web_ui) { 1879 : WebUIController(web_ui) {
1875 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1880 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1876 1881
1877 // Set up the chrome://net-internals/ source. 1882 // Set up the chrome://net-internals/ source.
1878 Profile* profile = Profile::FromWebUI(web_ui); 1883 Profile* profile = Profile::FromWebUI(web_ui);
1879 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1884 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1880 } 1885 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698