| 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_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PARSER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PARSER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/browser/chromeos/cros/enum_mapper.h" | 11 #include "chrome/browser/chromeos/cros/enum_mapper.h" |
| 12 #include "chrome/browser/chromeos/cros/network_library.h" | 12 #include "chrome/browser/chromeos/cros/network_library.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 class Value; | 16 class Value; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 class NetworkDevice; | 21 class NetworkDevice; |
| 22 | 22 |
| 23 // This takes a Value of a particular form, and maps the keys in the | 23 // This takes a Value of a particular form, and maps the keys in the dictionary |
| 24 // dictionary to a NetworkDevice object to initialize it properly. | 24 // to a NetworkDevice object to initialize it properly. Subclasses of this can |
| 25 // Subclasses of this can then customize its methods to parse either | 25 // then customize its methods to parse either Shill data or network setup |
| 26 // libcros (flimflam) data or network setup information obtained from | 26 // information obtained from policy or setup file import depending on the |
| 27 // policy or setup file import depending on the EnumMapper supplied. | 27 // EnumMapper supplied. |
| 28 class NetworkDeviceParser { | 28 class NetworkDeviceParser { |
| 29 public: | 29 public: |
| 30 virtual ~NetworkDeviceParser(); | 30 virtual ~NetworkDeviceParser(); |
| 31 | 31 |
| 32 virtual NetworkDevice* CreateDeviceFromInfo( | 32 virtual NetworkDevice* CreateDeviceFromInfo( |
| 33 const std::string& device_path, | 33 const std::string& device_path, |
| 34 const base::DictionaryValue& info); | 34 const base::DictionaryValue& info); |
| 35 virtual bool UpdateDeviceFromInfo(const base::DictionaryValue& info, | 35 virtual bool UpdateDeviceFromInfo(const base::DictionaryValue& info, |
| 36 NetworkDevice* device); | 36 NetworkDevice* device); |
| 37 virtual bool UpdateStatus(const std::string& key, | 37 virtual bool UpdateStatus(const std::string& key, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 const EnumMapper<PropertyIndex>* mapper_; | 120 const EnumMapper<PropertyIndex>* mapper_; |
| 121 DISALLOW_COPY_AND_ASSIGN(NetworkParser); | 121 DISALLOW_COPY_AND_ASSIGN(NetworkParser); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace chromeos | 124 } // namespace chromeos |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PARSER_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_PARSER_H_ |
| OLD | NEW |