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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 76 const std::string& confirmation_code, |
77 extensions::api::gcd_private::ConfirmationType confirmation_type) | 77 extensions::api::gcd_private::ConfirmationType confirmation_type) |
78 OVERRIDE; | 78 override; |
79 virtual void OnSessionStatus( | 79 virtual void OnSessionStatus( |
80 extensions::api::gcd_private::Status status) OVERRIDE; | 80 extensions::api::gcd_private::Status status) override; |
81 | 81 |
82 void OnSetupError(); | 82 void OnSetupError(); |
83 void OnDeviceRegistered(); | 83 void OnDeviceRegistered(); |
84 | 84 |
85 const std::string& service_name() const { return service_name_; } | 85 const std::string& service_name() const { return service_name_; } |
86 | 86 |
87 private: | 87 private: |
88 void OnTicketCreated(const std::string& ticket_id, | 88 void OnTicketCreated(const std::string& ticket_id, |
89 const std::string& device_id); | 89 const std::string& device_id); |
90 void OnPrivetClientCreated(scoped_ptr<PrivetHTTPClient> privet_http_client); | 90 void OnPrivetClientCreated(scoped_ptr<PrivetHTTPClient> privet_http_client); |
91 void OnCodeConfirmed(const std::string& code, bool success); | 91 void OnCodeConfirmed(const std::string& code, bool success); |
92 | 92 |
93 Delegate* delegate_; | 93 Delegate* delegate_; |
94 std::string service_name_; | 94 std::string service_name_; |
95 std::string device_id_; | 95 std::string device_id_; |
96 scoped_ptr<GCDApiFlow> ticket_request_; | 96 scoped_ptr<GCDApiFlow> ticket_request_; |
97 scoped_ptr<PrivetV3Session> session_; | 97 scoped_ptr<PrivetV3Session> session_; |
98 scoped_ptr<PrivetV3Session::Request> setup_request_; | 98 scoped_ptr<PrivetV3Session::Request> setup_request_; |
99 base::WeakPtrFactory<PrivetV3SetupFlow> weak_ptr_factory_; | 99 base::WeakPtrFactory<PrivetV3SetupFlow> weak_ptr_factory_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(PrivetV3SetupFlow); | 101 DISALLOW_COPY_AND_ASSIGN(PrivetV3SetupFlow); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace local_discovery | 104 } // namespace local_discovery |
105 | 105 |
106 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ | 106 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_SETUP_FLOW_H_ |
OLD | NEW |