| 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> |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 const std::string& gateway, | 1679 const std::string& gateway, |
| 1680 const std::string& name_servers, | 1680 const std::string& name_servers, |
| 1681 int dhcp_usage_mask) = 0; | 1681 int dhcp_usage_mask) = 0; |
| 1682 | 1682 |
| 1683 // This will connect to a preferred network if the currently connected | 1683 // This will connect to a preferred network if the currently connected |
| 1684 // network is not preferred. This should be called when the active profile | 1684 // network is not preferred. This should be called when the active profile |
| 1685 // changes. | 1685 // changes. |
| 1686 virtual void SwitchToPreferredNetwork() = 0; | 1686 virtual void SwitchToPreferredNetwork() = 0; |
| 1687 | 1687 |
| 1688 // Load networks from an Open Network Configuration blob. | 1688 // Load networks from an Open Network Configuration blob. |
| 1689 // If there was an error, this will return false and |error| will be set to | 1689 // If there was an error, returns false. |
| 1690 // the error message. | |
| 1691 virtual bool LoadOncNetworks(const std::string& onc_blob, | 1690 virtual bool LoadOncNetworks(const std::string& onc_blob, |
| 1692 const std::string& passcode, | 1691 const std::string& passcode, |
| 1693 onc::ONCSource source, | 1692 onc::ONCSource source, |
| 1694 bool allow_web_trust_from_policy) = 0; | 1693 bool allow_web_trust_from_policy) = 0; |
| 1695 | 1694 |
| 1696 // This sets the active network for the network type. Note: priority order | 1695 // This sets the active network for the network type. Note: priority order |
| 1697 // is unchanged (i.e. if a wifi network is set to active, but an ethernet | 1696 // is unchanged (i.e. if a wifi network is set to active, but an ethernet |
| 1698 // network is still active, active_network() will still return the ethernet | 1697 // network is still active, active_network() will still return the ethernet |
| 1699 // network). Other networks of the same type will become inactive. | 1698 // network). Other networks of the same type will become inactive. |
| 1700 // Used for testing. | 1699 // Used for testing. |
| 1701 virtual bool SetActiveNetwork(ConnectionType type, | 1700 virtual bool SetActiveNetwork(ConnectionType type, |
| 1702 const std::string& service_path) = 0; | 1701 const std::string& service_path) = 0; |
| 1703 | 1702 |
| 1704 // Factory function, creates a new instance and returns ownership. | 1703 // Factory function, creates a new instance and returns ownership. |
| 1705 // For normal usage, access the singleton via CrosLibrary::Get(). | 1704 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1706 static NetworkLibrary* GetImpl(bool stub); | 1705 static NetworkLibrary* GetImpl(bool stub); |
| 1707 }; | 1706 }; |
| 1708 | 1707 |
| 1709 } // namespace chromeos | 1708 } // namespace chromeos |
| 1710 | 1709 |
| 1711 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1710 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |