Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: chrome/browser/local_discovery/privetv3_setup_flow.h

Issue 383023002: Partial setup flow with unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/privetv3_setup_flow.h
diff --git a/chrome/browser/local_discovery/privetv3_setup_flow.h b/chrome/browser/local_discovery/privetv3_setup_flow.h
index 614a221ebef02b479d63643330de7d2bde2ed451..e039fa4d6046364ae87c2699e5d78814928bb656 100644
--- a/chrome/browser/local_discovery/privetv3_setup_flow.h
+++ b/chrome/browser/local_discovery/privetv3_setup_flow.h
@@ -11,11 +11,12 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/local_discovery/gcd_api_flow.h"
#include "chrome/browser/local_discovery/privet_http.h"
+#include "chrome/browser/local_discovery/privetv3_session.h"
namespace local_discovery {
// Provides complete flow for Privet v3 device setup.
-class PrivetV3SetupFlow {
+class PrivetV3SetupFlow : public PrivetV3Session::Delegate {
public:
// Delegate to be implemented by client code.
class Delegate {
@@ -61,7 +62,7 @@ class PrivetV3SetupFlow {
};
explicit PrivetV3SetupFlow(Delegate* delegate);
- ~PrivetV3SetupFlow();
+ virtual ~PrivetV3SetupFlow();
// Starts registration.
void Register(const std::string& service_name);
@@ -70,9 +71,25 @@ class PrivetV3SetupFlow {
void SetupWifiAndRegister(const std::string& device_ssid);
#endif // ENABLE_WIFI_BOOTSTRAPPING
+ // PrivetV3Session::Delegate implementation.
+ virtual void OnSetupConfirmationNeeded(
+ const std::string& confirmation_code) OVERRIDE;
+ virtual void OnSessionEstablished() OVERRIDE;
+ virtual void OnCannotEstablishSession() OVERRIDE;
+
+ void OnSetupError();
+ void OnDeviceRegistered();
+
private:
+ void OnTicketCreated(const std::string& ticket_id);
+ void OnPrivetClientCreated(scoped_ptr<PrivetHTTPClient> privet_http_client);
+ void OnCodeConfirmed(bool success);
+
Delegate* delegate_;
std::string service_name_;
+ scoped_ptr<GCDApiFlow> ticket_request_;
+ scoped_ptr<PrivetV3Session> session_;
+ scoped_ptr<PrivetV3Session::Request> setup_request_;
base::WeakPtrFactory<PrivetV3SetupFlow> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PrivetV3SetupFlow);
« no previous file with comments | « chrome/browser/local_discovery/privetv3_session_unittest.cc ('k') | chrome/browser/local_discovery/privetv3_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698