| 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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "base/timer.h" | 18 #include "base/timer.h" |
| 19 #include "base/values.h" | 19 #include "base/values.h" |
| 20 #include "chrome/browser/chromeos/cros/network_constants.h" | 20 #include "chrome/browser/chromeos/cros/network_constants.h" |
| 21 #include "chromeos/network/network_ip_config.h" | 21 #include "chromeos/network/network_ip_config.h" |
| 22 #include "chromeos/network/network_ui_data.h" | 22 #include "chromeos/network/network_ui_data.h" |
| 23 #include "chromeos/network/network_util.h" | 23 #include "chromeos/network/network_util.h" |
| 24 #include "chromeos/network/onc/onc_constants.h" | 24 #include "chromeos/network/onc/onc_constants.h" |
| 25 #include "net/cert/x509_certificate.h" | |
| 26 | 25 |
| 27 namespace chromeos { | 26 namespace chromeos { |
| 28 | 27 |
| 29 class NetworkDeviceParser; | 28 class NetworkDeviceParser; |
| 30 class NetworkParser; | 29 class NetworkParser; |
| 31 class CertificatePattern; | 30 class CertificatePattern; |
| 32 | 31 |
| 33 // This is the list of all implementation classes that are allowed | 32 // This is the list of all implementation classes that are allowed |
| 34 // access to the internals of the network library classes. | 33 // access to the internals of the network library classes. |
| 35 #define NETWORK_LIBRARY_IMPL_FRIENDS \ | 34 #define NETWORK_LIBRARY_IMPL_FRIENDS \ |
| (...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 NetworkServicePropertiesCallback; | 1712 NetworkServicePropertiesCallback; |
| 1714 virtual void RequestNetworkServiceProperties( | 1713 virtual void RequestNetworkServiceProperties( |
| 1715 const std::string& service_path, | 1714 const std::string& service_path, |
| 1716 const NetworkServicePropertiesCallback& callback) = 0; | 1715 const NetworkServicePropertiesCallback& callback) = 0; |
| 1717 | 1716 |
| 1718 // This will connect to a preferred network if the currently connected | 1717 // This will connect to a preferred network if the currently connected |
| 1719 // network is not preferred. This should be called when the active profile | 1718 // network is not preferred. This should be called when the active profile |
| 1720 // changes. | 1719 // changes. |
| 1721 virtual void SwitchToPreferredNetwork() = 0; | 1720 virtual void SwitchToPreferredNetwork() = 0; |
| 1722 | 1721 |
| 1723 // Load networks from an Open Network Configuration blob. | 1722 // Load networks from an NetworkConfigurations list of ONC. |
| 1724 // If there was an error, returns false. | 1723 virtual void LoadOncNetworks(const base::ListValue& network_configs, |
| 1725 virtual bool LoadOncNetworks( | 1724 onc::ONCSource source) = 0; |
| 1726 const std::string& onc_blob, | |
| 1727 const std::string& passcode, | |
| 1728 onc::ONCSource source, | |
| 1729 net::CertificateList* onc_trusted_certificates) = 0; | |
| 1730 | 1725 |
| 1731 // This sets the active network for the network type. Note: priority order | 1726 // This sets the active network for the network type. Note: priority order |
| 1732 // is unchanged (i.e. if a wifi network is set to active, but an ethernet | 1727 // is unchanged (i.e. if a wifi network is set to active, but an ethernet |
| 1733 // network is still active, active_network() will still return the ethernet | 1728 // network is still active, active_network() will still return the ethernet |
| 1734 // network). Other networks of the same type will become inactive. | 1729 // network). Other networks of the same type will become inactive. |
| 1735 // Used for testing. | 1730 // Used for testing. |
| 1736 virtual bool SetActiveNetwork(ConnectionType type, | 1731 virtual bool SetActiveNetwork(ConnectionType type, |
| 1737 const std::string& service_path) = 0; | 1732 const std::string& service_path) = 0; |
| 1738 | 1733 |
| 1739 // Factory function, creates a new instance and returns ownership. | 1734 // Factory function, creates a new instance and returns ownership. |
| 1740 // For normal usage, access the singleton via CrosLibrary::Get(). | 1735 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1741 static NetworkLibrary* GetImpl(bool stub); | 1736 static NetworkLibrary* GetImpl(bool stub); |
| 1742 }; | 1737 }; |
| 1743 | 1738 |
| 1744 } // namespace chromeos | 1739 } // namespace chromeos |
| 1745 | 1740 |
| 1746 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1741 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |