| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PRIVETV3_SESSION_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SESSION_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SESSION_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SESSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Manages secure communication between browser and local Privet device. | 32 // Manages secure communication between browser and local Privet device. |
| 33 class PrivetV3Session { | 33 class PrivetV3Session { |
| 34 private: | 34 private: |
| 35 class FetcherDelegate; | 35 class FetcherDelegate; |
| 36 | 36 |
| 37 public: | 37 public: |
| 38 typedef extensions::api::gcd_private::PairingType PairingType; | 38 typedef extensions::api::gcd_private::PairingType PairingType; |
| 39 typedef extensions::api::gcd_private::Status Result; | 39 typedef extensions::api::gcd_private::Status Result; |
| 40 | 40 |
| 41 typedef base::Callback< | 41 typedef base::Callback< |
| 42 void(Result result, const std::vector<PairingType>& types)> InitCallback; | 42 void(Result result, const base::DictionaryValue& response)> InitCallback; |
| 43 | 43 |
| 44 typedef base::Callback<void(Result result)> ResultCallback; | 44 typedef base::Callback<void(Result result)> ResultCallback; |
| 45 typedef base::Callback<void(Result result, | 45 typedef base::Callback<void(Result result, |
| 46 const base::DictionaryValue& response)> | 46 const base::DictionaryValue& response)> |
| 47 MessageCallback; | 47 MessageCallback; |
| 48 | 48 |
| 49 explicit PrivetV3Session(scoped_ptr<PrivetHTTPClient> client); | 49 explicit PrivetV3Session(scoped_ptr<PrivetHTTPClient> client); |
| 50 ~PrivetV3Session(); | 50 ~PrivetV3Session(); |
| 51 | 51 |
| 52 // Initializes session. Queries /privet/info and returns supported pairing | 52 // Initializes session. Queries /privet/info and returns supported pairing |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Intercepts POST requests. Used by tests only. | 117 // Intercepts POST requests. Used by tests only. |
| 118 base::Callback<void(const base::DictionaryValue&)> on_post_data_; | 118 base::Callback<void(const base::DictionaryValue&)> on_post_data_; |
| 119 | 119 |
| 120 base::WeakPtrFactory<PrivetV3Session> weak_ptr_factory_; | 120 base::WeakPtrFactory<PrivetV3Session> weak_ptr_factory_; |
| 121 DISALLOW_COPY_AND_ASSIGN(PrivetV3Session); | 121 DISALLOW_COPY_AND_ASSIGN(PrivetV3Session); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace local_discovery | 124 } // namespace local_discovery |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SESSION_H_ | 126 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SESSION_H_ |
| OLD | NEW |