1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_REMOTING_SETUP_FLOW_REGISTER_STEP_H_ 6 #define CHROME_BROWSER_REMOTING_SETUP_FLOW_REGISTER_STEP_H_ 7 8 #include "chrome/browser/remoting/directory_add_request.h" 9 #include "chrome/browser/remoting/setup_flow.h" 10 #include "chrome/common/net/gaia/gaia_auth_consumer.h" 11 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" 12 13 namespace remoting { 14 15 // Implementation of host registration step for remoting setup flow. 16 class SetupFlowRegisterStep : public SetupFlowStepBase { 17 public: 18 SetupFlowRegisterStep(); 19 virtual ~SetupFlowRegisterStep(); 20 21 // SetupFlowStep implementation. 22 virtual void HandleMessage(const std::string& message, 23 const Value* arg); 24 virtual void Cancel(); 25 26 protected: 27 virtual void DoStart(); 28 29 // This methods is called when are sure remoting is enabled. 30 void SetRemotingEnabled(); 31 void OnRequestDone(DirectoryAddRequest::Result result, 32 const std::string& error_message); 33 34 private: 35 scoped_ptr<DirectoryAddRequest> request_; 36 37 DISALLOW_COPY_AND_ASSIGN(SetupFlowRegisterStep); 38 }; 39 40 class SetupFlowRegisterErrorStep : public SetupFlowErrorStepBase { 41 public: 42 SetupFlowRegisterErrorStep(); 43 virtual ~SetupFlowRegisterErrorStep(); 44 45 protected: 46 virtual string16 GetErrorMessage(); 47 virtual void Retry(); 48 49 private: 50 DISALLOW_COPY_AND_ASSIGN(SetupFlowRegisterErrorStep); 51 }; 52 53 } // namespace remoting 54 55 #endif // CHROME_BROWSER_REMOTING_SETUP_FLOW_REGISTER_STEP_H_ 56