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

Side by Side Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 8949056: This adds support for encrypted ONC import (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More Review Changes Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/cros/network_library.h" 5 #include "chrome/browser/chromeos/cros/network_library.h"
6 6
7 #include <dbus/dbus-glib.h> 7 #include <dbus/dbus-glib.h>
8 #include <dbus/dbus-gtype-specialized.h> 8 #include <dbus/dbus-gtype-specialized.h>
9 #include <glib-object.h> 9 #include <glib-object.h>
10 10
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 1761
1762 // virtual DisconnectFromNetwork implemented in derived classes. 1762 // virtual DisconnectFromNetwork implemented in derived classes.
1763 virtual void ForgetNetwork(const std::string& service_path) OVERRIDE; 1763 virtual void ForgetNetwork(const std::string& service_path) OVERRIDE;
1764 virtual void EnableEthernetNetworkDevice(bool enable) OVERRIDE; 1764 virtual void EnableEthernetNetworkDevice(bool enable) OVERRIDE;
1765 virtual void EnableWifiNetworkDevice(bool enable) OVERRIDE; 1765 virtual void EnableWifiNetworkDevice(bool enable) OVERRIDE;
1766 virtual void EnableCellularNetworkDevice(bool enable) OVERRIDE; 1766 virtual void EnableCellularNetworkDevice(bool enable) OVERRIDE;
1767 // virtual EnableOfflineMode implemented in derived classes. 1767 // virtual EnableOfflineMode implemented in derived classes.
1768 // virtual GetIPConfigs implemented in derived classes. 1768 // virtual GetIPConfigs implemented in derived classes.
1769 // virtual SetIPConfig implemented in derived classes. 1769 // virtual SetIPConfig implemented in derived classes.
1770 virtual void SwitchToPreferredNetwork() OVERRIDE; 1770 virtual void SwitchToPreferredNetwork() OVERRIDE;
1771 virtual bool LoadOncNetworks(const std::string& onc_blob, 1771 virtual bool LoadOncNetworks(const std::string& onc_blob,
kmixter1 2012/01/05 23:27:53 Where is the code that calls this with the new par
Greg Spencer (Chromium) 2012/01/05 23:41:06 chrome/browser/ui/webui/net_internals_ui.cc:1302
1772 const std::string& passcode, 1772 const std::string& passphrase,
1773 NetworkUIData::ONCSource source, 1773 NetworkUIData::ONCSource source,
1774 std::string* error) OVERRIDE; 1774 std::string* error) OVERRIDE;
1775 virtual bool SetActiveNetwork(ConnectionType type, 1775 virtual bool SetActiveNetwork(ConnectionType type,
1776 const std::string& service_path) OVERRIDE; 1776 const std::string& service_path) OVERRIDE;
1777 1777
1778 protected: 1778 protected:
1779 typedef ObserverList<NetworkObserver> NetworkObserverList; 1779 typedef ObserverList<NetworkObserver> NetworkObserverList;
1780 typedef std::map<std::string, NetworkObserverList*> NetworkObserverMap; 1780 typedef std::map<std::string, NetworkObserverList*> NetworkObserverMap;
1781 1781
1782 typedef ObserverList<NetworkDeviceObserver> NetworkDeviceObserverList; 1782 typedef ObserverList<NetworkDeviceObserver> NetworkDeviceObserverList;
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 if (!wifi->preferred()) // All preferred networks are sorted in front. 2880 if (!wifi->preferred()) // All preferred networks are sorted in front.
2881 break; 2881 break;
2882 if (wifi->auto_connect()) { 2882 if (wifi->auto_connect()) {
2883 ConnectToWifiNetwork(wifi); 2883 ConnectToWifiNetwork(wifi);
2884 break; 2884 break;
2885 } 2885 }
2886 } 2886 }
2887 } 2887 }
2888 2888
2889 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, 2889 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
2890 const std::string& passcode, 2890 const std::string& passphrase,
2891 NetworkUIData::ONCSource source, 2891 NetworkUIData::ONCSource source,
2892 std::string* error) { 2892 std::string* error) {
2893 // TODO(gspencer): Add support for decrypting onc files. crbug.com/19397 2893 OncNetworkParser parser(onc_blob, passphrase, source);
2894 OncNetworkParser parser(onc_blob, source);
2895 2894
2896 if (!parser.parse_error().empty()) { 2895 if (!parser.parse_error().empty()) {
2897 if (error) 2896 if (error)
2898 *error = parser.parse_error(); 2897 *error = parser.parse_error();
2899 return false; 2898 return false;
2900 } 2899 }
2901 2900
2902 for (int i = 0; i < parser.GetCertificatesSize(); i++) { 2901 for (int i = 0; i < parser.GetCertificatesSize(); i++) {
2903 // Insert each of the available certs into the certificate DB. 2902 // Insert each of the available certs into the certificate DB.
2904 if (parser.ParseCertificate(i).get() == NULL) { 2903 if (parser.ParseCertificate(i).get() == NULL) {
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
5483 impl = new NetworkLibraryImplStub(); 5482 impl = new NetworkLibraryImplStub();
5484 else 5483 else
5485 impl = new NetworkLibraryImplCros(); 5484 impl = new NetworkLibraryImplCros();
5486 impl->Init(); 5485 impl->Init();
5487 return impl; 5486 return impl;
5488 } 5487 }
5489 5488
5490 ///////////////////////////////////////////////////////////////////////////// 5489 /////////////////////////////////////////////////////////////////////////////
5491 5490
5492 } // namespace chromeos 5491 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698