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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 typedef std::map<PropertyIndex, base::Value*> PropertyMap; | 522 typedef std::map<PropertyIndex, base::Value*> PropertyMap; |
523 | 523 |
524 // This allows NetworkParser and its subclasses access to device | 524 // This allows NetworkParser and its subclasses access to device |
525 // privates so that they can be reconstituted during parsing. The | 525 // privates so that they can be reconstituted during parsing. The |
526 // parsers only access things through the private set_ functions so | 526 // parsers only access things through the private set_ functions so |
527 // that this class can evolve without having to change all the | 527 // that this class can evolve without having to change all the |
528 // parsers. | 528 // parsers. |
529 friend class NetworkParser; | 529 friend class NetworkParser; |
530 friend class NativeNetworkParser; | 530 friend class NativeNetworkParser; |
531 friend class NativeVirtualNetworkParser; | 531 friend class NativeVirtualNetworkParser; |
532 friend class OncNetworkParser; | |
533 friend class OncWifiNetworkParser; | 532 friend class OncWifiNetworkParser; |
534 friend class OncVirtualNetworkParser; | 533 friend class OncVirtualNetworkParser; |
535 | 534 |
536 // This allows the implementation classes access to privates. | 535 // This allows the implementation classes access to privates. |
537 NETWORK_LIBRARY_IMPL_FRIENDS; | 536 NETWORK_LIBRARY_IMPL_FRIENDS; |
538 | 537 |
539 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryTest, GetUserExpandedValue); | 538 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryTest, GetUserExpandedValue); |
540 FRIEND_TEST_ALL_PREFIXES(OncNetworkParserTest, | |
541 TestLoadWifiCertificatePattern); | |
542 FRIEND_TEST_ALL_PREFIXES(OncNetworkParserTest, | |
543 TestLoadVPNCertificatePattern); | |
544 FRIEND_TEST_ALL_PREFIXES(OncNetworkParserTest, | |
545 TestNoCertificatePatternForDevicePolicy); | |
546 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryStubTest, NetworkConnectOncWifi); | 539 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryStubTest, NetworkConnectOncWifi); |
547 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryStubTest, NetworkConnectOncVPN); | 540 FRIEND_TEST_ALL_PREFIXES(NetworkLibraryStubTest, NetworkConnectOncVPN); |
548 | 541 |
549 // Use these functions at your peril. They are used by the various | 542 // Use these functions at your peril. They are used by the various |
550 // parsers to set state, and really shouldn't be used by anything else | 543 // parsers to set state, and really shouldn't be used by anything else |
551 // because they don't do the error checking and sending to the | 544 // because they don't do the error checking and sending to the |
552 // network layer that the other setters do. | 545 // network layer that the other setters do. |
553 void set_device_path(const std::string& device_path) { | 546 void set_device_path(const std::string& device_path) { |
554 device_path_ = device_path; | 547 device_path_ = device_path; |
555 } | 548 } |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 void SetServerHostname(const std::string& server_hostname); | 708 void SetServerHostname(const std::string& server_hostname); |
716 | 709 |
717 private: | 710 private: |
718 // This allows NetworkParser and its subclasses access to | 711 // This allows NetworkParser and its subclasses access to |
719 // device privates so that they can be reconstituted during parsing. | 712 // device privates so that they can be reconstituted during parsing. |
720 // The parsers only access things through the private set_ functions | 713 // The parsers only access things through the private set_ functions |
721 // so that this class can evolve without having to change all the | 714 // so that this class can evolve without having to change all the |
722 // parsers. | 715 // parsers. |
723 friend class NativeNetworkParser; | 716 friend class NativeNetworkParser; |
724 friend class NativeVirtualNetworkParser; | 717 friend class NativeVirtualNetworkParser; |
725 friend class OncNetworkParser; | |
726 friend class OncVirtualNetworkParser; | 718 friend class OncVirtualNetworkParser; |
727 | 719 |
728 // This allows the implementation classes access to privates. | 720 // This allows the implementation classes access to privates. |
729 NETWORK_LIBRARY_IMPL_FRIENDS; | 721 NETWORK_LIBRARY_IMPL_FRIENDS; |
730 | 722 |
731 FRIEND_TEST_ALL_PREFIXES(OncNetworkParserTest, TestLoadVPNCertificatePattern); | |
732 | |
733 // Use these functions at your peril. They are used by the various | 723 // Use these functions at your peril. They are used by the various |
734 // parsers to set state, and really shouldn't be used by anything else | 724 // parsers to set state, and really shouldn't be used by anything else |
735 // because they don't do the error checking and sending to the | 725 // because they don't do the error checking and sending to the |
736 // network layer that the other setters do. | 726 // network layer that the other setters do. |
737 void set_server_hostname(const std::string& server_hostname) { | 727 void set_server_hostname(const std::string& server_hostname) { |
738 server_hostname_ = server_hostname; | 728 server_hostname_ = server_hostname; |
739 } | 729 } |
740 void set_provider_type(ProviderType provider_type) { | 730 void set_provider_type(ProviderType provider_type) { |
741 provider_type_ = provider_type; | 731 provider_type_ = provider_type; |
742 } | 732 } |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 const std::string& service_path) = 0; | 1714 const std::string& service_path) = 0; |
1725 | 1715 |
1726 // Factory function, creates a new instance and returns ownership. | 1716 // Factory function, creates a new instance and returns ownership. |
1727 // For normal usage, access the singleton via CrosLibrary::Get(). | 1717 // For normal usage, access the singleton via CrosLibrary::Get(). |
1728 static NetworkLibrary* GetImpl(bool stub); | 1718 static NetworkLibrary* GetImpl(bool stub); |
1729 }; | 1719 }; |
1730 | 1720 |
1731 } // namespace chromeos | 1721 } // namespace chromeos |
1732 | 1722 |
1733 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1723 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
OLD | NEW |