| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const NetworkProfile* GetProfileForPath( | 50 const NetworkProfile* GetProfileForPath( |
| 51 const std::string& profile_path) const; | 51 const std::string& profile_path) const; |
| 52 const NetworkProfile* GetProfileForUserhash( | 52 const NetworkProfile* GetProfileForUserhash( |
| 53 const std::string& userhash) const; | 53 const std::string& userhash) const; |
| 54 | 54 |
| 55 // Returns the first profile entry with a non-empty userhash. | 55 // Returns the first profile entry with a non-empty userhash. |
| 56 // TODO(stevenjb): Replace with GetProfileForUserhash() with the correct | 56 // TODO(stevenjb): Replace with GetProfileForUserhash() with the correct |
| 57 // userhash. | 57 // userhash. |
| 58 const NetworkProfile* GetDefaultUserProfile() const; | 58 const NetworkProfile* GetDefaultUserProfile() const; |
| 59 | 59 |
| 60 static const char kSharedProfilePath[]; | 60 static std::string GetSharedProfilePath(); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 friend class ClientCertResolverTest; | 63 friend class ClientCertResolverTest; |
| 64 friend class NetworkHandler; | 64 friend class NetworkHandler; |
| 65 NetworkProfileHandler(); | 65 NetworkProfileHandler(); |
| 66 | 66 |
| 67 // Add ShillManagerClient property observer and request initial list. | 67 // Add ShillManagerClient property observer and request initial list. |
| 68 // Sets |network_state_handler_| for triggering Manager updates (can be NULL). | 68 // Sets |network_state_handler_| for triggering Manager updates (can be NULL). |
| 69 void Init(NetworkStateHandler* network_state_handler); | 69 void Init(NetworkStateHandler* network_state_handler); |
| 70 | 70 |
| 71 void AddProfile(const NetworkProfile& profile); | 71 void AddProfile(const NetworkProfile& profile); |
| 72 void RemoveProfile(const std::string& profile_path); | 72 void RemoveProfile(const std::string& profile_path); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 NetworkStateHandler* network_state_handler_; | 75 NetworkStateHandler* network_state_handler_; |
| 76 ProfileList profiles_; | 76 ProfileList profiles_; |
| 77 ObserverList<NetworkProfileObserver> observers_; | 77 ObserverList<NetworkProfileObserver> observers_; |
| 78 | 78 |
| 79 // For Shill client callbacks | 79 // For Shill client callbacks |
| 80 base::WeakPtrFactory<NetworkProfileHandler> weak_ptr_factory_; | 80 base::WeakPtrFactory<NetworkProfileHandler> weak_ptr_factory_; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(NetworkProfileHandler); | 83 DISALLOW_COPY_AND_ASSIGN(NetworkProfileHandler); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace chromeos | 86 } // namespace chromeos |
| 87 | 87 |
| 88 #endif // CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ | 88 #endif // CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ |
| OLD | NEW |