| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const base::Value& value) OVERRIDE; | 45 const base::Value& value) OVERRIDE; |
| 46 | 46 |
| 47 void GetProfilePropertiesCallback(const std::string& profile_path, | 47 void GetProfilePropertiesCallback(const std::string& profile_path, |
| 48 const base::DictionaryValue& properties); | 48 const base::DictionaryValue& properties); |
| 49 | 49 |
| 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. |
| 56 // TODO(stevenjb): Replace with GetProfileForUserhash() with the correct |
| 57 // userhash. |
| 58 const NetworkProfile* GetDefaultUserProfile() const; |
| 59 |
| 55 static const char kSharedProfilePath[]; | 60 static const char kSharedProfilePath[]; |
| 56 | 61 |
| 57 protected: | 62 protected: |
| 58 friend class NetworkHandler; | 63 friend class NetworkHandler; |
| 59 NetworkProfileHandler(); | 64 NetworkProfileHandler(); |
| 60 | 65 |
| 61 // Add ShillManagerClient property observer and request initial list. | 66 // Add ShillManagerClient property observer and request initial list. |
| 62 // Sets |network_state_handler_| for triggering Manager updates (can be NULL). | 67 // Sets |network_state_handler_| for triggering Manager updates (can be NULL). |
| 63 void Init(NetworkStateHandler* network_state_handler); | 68 void Init(NetworkStateHandler* network_state_handler); |
| 64 | 69 |
| 65 void AddProfile(const NetworkProfile& profile); | 70 void AddProfile(const NetworkProfile& profile); |
| 66 void RemoveProfile(const std::string& profile_path); | 71 void RemoveProfile(const std::string& profile_path); |
| 67 | 72 |
| 68 private: | 73 private: |
| 69 NetworkStateHandler* network_state_handler_; | 74 NetworkStateHandler* network_state_handler_; |
| 70 ProfileList profiles_; | 75 ProfileList profiles_; |
| 71 ObserverList<NetworkProfileObserver> observers_; | 76 ObserverList<NetworkProfileObserver> observers_; |
| 72 | 77 |
| 73 // For Shill client callbacks | 78 // For Shill client callbacks |
| 74 base::WeakPtrFactory<NetworkProfileHandler> weak_ptr_factory_; | 79 base::WeakPtrFactory<NetworkProfileHandler> weak_ptr_factory_; |
| 75 | 80 |
| 76 private: | 81 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(NetworkProfileHandler); | 82 DISALLOW_COPY_AND_ASSIGN(NetworkProfileHandler); |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 } // namespace chromeos | 85 } // namespace chromeos |
| 81 | 86 |
| 82 #endif // CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ | 87 #endif // CHROMEOS_NETWORK_NETWORK_PROFILE_HANDLER_H_ |
| OLD | NEW |