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_SETUP_FLOW_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Starts registration. | 67 // Starts registration. |
68 void Register(const std::string& service_name); | 68 void Register(const std::string& service_name); |
69 | 69 |
70 #if defined(ENABLE_WIFI_BOOTSTRAPPING) | 70 #if defined(ENABLE_WIFI_BOOTSTRAPPING) |
71 void SetupWifiAndRegister(const std::string& device_ssid); | 71 void SetupWifiAndRegister(const std::string& device_ssid); |
72 #endif // ENABLE_WIFI_BOOTSTRAPPING | 72 #endif // ENABLE_WIFI_BOOTSTRAPPING |
73 | 73 |
74 // PrivetV3Session::Delegate implementation. | 74 // PrivetV3Session::Delegate implementation. |
75 virtual void OnSetupConfirmationNeeded( | 75 virtual void OnSetupConfirmationNeeded( |
76 const std::string& confirmation_code) OVERRIDE; | 76 const std::string& confirmation_code, |
77 virtual void OnSessionEstablished() OVERRIDE; | 77 extensions::api::gcd_private::ConfirmationType confirmation_type) |
78 virtual void OnCannotEstablishSession() OVERRIDE; | 78 OVERRIDE; |
| 79 virtual void OnSessionStatus( |
| 80 extensions::api::gcd_private::Status status) OVERRIDE; |
79 | 81 |
80 void OnSetupError(); | 82 void OnSetupError(); |
81 void OnDeviceRegistered(); | 83 void OnDeviceRegistered(); |
82 | 84 |
83 const std::string& service_name() const { return service_name_; } | 85 const std::string& service_name() const { return service_name_; } |
84 | 86 |
85 private: | 87 private: |
86 void OnTicketCreated(const std::string& ticket_id, | 88 void OnTicketCreated(const std::string& ticket_id, |
87 const std::string& device_id); | 89 const std::string& device_id); |
88 void OnPrivetClientCreated(scoped_ptr<PrivetHTTPClient> privet_http_client); | 90 void OnPrivetClientCreated(scoped_ptr<PrivetHTTPClient> privet_http_client); |
89 void OnCodeConfirmed(bool success); | 91 void OnCodeConfirmed(const std::string& code, bool success); |
90 | 92 |
91 Delegate* delegate_; | 93 Delegate* delegate_; |
92 std::string service_name_; | 94 std::string service_name_; |
93 std::string device_id_; | 95 std::string device_id_; |
94 scoped_ptr<GCDApiFlow> ticket_request_; | 96 scoped_ptr<GCDApiFlow> ticket_request_; |
95 scoped_ptr<PrivetV3Session> session_; | 97 scoped_ptr<PrivetV3Session> session_; |
96 scoped_ptr<PrivetV3Session::Request> setup_request_; | 98 scoped_ptr<PrivetV3Session::Request> setup_request_; |
97 base::WeakPtrFactory<PrivetV3SetupFlow> weak_ptr_factory_; | 99 base::WeakPtrFactory<PrivetV3SetupFlow> weak_ptr_factory_; |
98 | 100 |
99 DISALLOW_COPY_AND_ASSIGN(PrivetV3SetupFlow); | 101 DISALLOW_COPY_AND_ASSIGN(PrivetV3SetupFlow); |
100 }; | 102 }; |
101 | 103 |
102 } // namespace local_discovery | 104 } // namespace local_discovery |
103 | 105 |
104 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ | 106 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ |
OLD | NEW |