OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 void Start(); | 40 void Start(); |
41 | 41 |
42 // Stops listening/listing, keeps the data. | 42 // Stops listening/listing, keeps the data. |
43 void Stop(); | 43 void Stop(); |
44 | 44 |
45 const DeviceDescription* GetDeviceDescription(const std::string& name); | 45 const DeviceDescription* GetDeviceDescription(const std::string& name); |
46 | 46 |
47 // PrivetDeviceLister::Delegate implementation. | 47 // PrivetDeviceLister::Delegate implementation. |
48 virtual void DeviceChanged(bool added, | 48 virtual void DeviceChanged(bool added, |
49 const std::string& name, | 49 const std::string& name, |
50 const DeviceDescription& description) OVERRIDE; | 50 const DeviceDescription& description) override; |
51 virtual void DeviceRemoved(const std::string& name) OVERRIDE; | 51 virtual void DeviceRemoved(const std::string& name) override; |
52 virtual void DeviceCacheFlushed() OVERRIDE; | 52 virtual void DeviceCacheFlushed() override; |
53 | 53 |
54 private: | 54 private: |
55 struct DeviceContext; | 55 struct DeviceContext; |
56 | 56 |
57 typedef std::map<std::string, linked_ptr<DeviceContext> > DeviceContextMap; | 57 typedef std::map<std::string, linked_ptr<DeviceContext> > DeviceContextMap; |
58 | 58 |
59 void OnPrivetInfoDone(DeviceContext* context, | 59 void OnPrivetInfoDone(DeviceContext* context, |
60 const std::string& name, | 60 const std::string& name, |
61 const base::DictionaryValue* json_value); | 61 const base::DictionaryValue* json_value); |
62 | 62 |
63 void OnPrivetResolved(const std::string& name, | 63 void OnPrivetResolved(const std::string& name, |
64 scoped_ptr<PrivetHTTPClient> http_client); | 64 scoped_ptr<PrivetHTTPClient> http_client); |
65 | 65 |
66 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory_; | 66 scoped_ptr<PrivetHTTPAsynchronousFactory> privet_http_factory_; |
67 DeviceContextMap device_contexts_; | 67 DeviceContextMap device_contexts_; |
68 Delegate* delegate_; | 68 Delegate* delegate_; |
69 | 69 |
70 scoped_ptr<PrivetDeviceLister> privet_lister_; | 70 scoped_ptr<PrivetDeviceLister> privet_lister_; |
71 }; | 71 }; |
72 | 72 |
73 } // namespace local_discovery | 73 } // namespace local_discovery |
74 | 74 |
75 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ | 75 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_LOCAL_PRINTER_LISTER_H_ |
OLD | NEW |