Home | History | Annotate | Download | only in managed
      1 // Copyright (c) 2012 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_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_FLOW_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_FLOW_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "base/strings/string16.h"
     11 #include "chrome/browser/chromeos/login/user_flow.h"
     12 
     13 class Profile;
     14 
     15 namespace chromeos {
     16 
     17 // UserFlow implementation for creating new locally managed user.
     18 class LocallyManagedUserCreationFlow : public ExtendedUserFlow {
     19  public:
     20   explicit LocallyManagedUserCreationFlow(const std::string& manager_id);
     21   virtual ~LocallyManagedUserCreationFlow();
     22 
     23   virtual bool ShouldShowSettings() OVERRIDE;
     24   virtual bool ShouldLaunchBrowser() OVERRIDE;
     25   virtual bool ShouldSkipPostLoginScreens() OVERRIDE;
     26   virtual bool HandleLoginFailure(const LoginFailure& failure) OVERRIDE;
     27   virtual bool HandlePasswordChangeDetected() OVERRIDE;
     28   virtual void HandleOAuthTokenStatusChange(User::OAuthTokenStatus status)
     29       OVERRIDE;
     30   virtual void LaunchExtraSteps(Profile* profile) OVERRIDE;
     31  private:
     32   // Display name for user being created.
     33   string16 name_;
     34   // Password for user being created.
     35   std::string password_;
     36 
     37   // Indicates if manager OAuth2 token has been validated.
     38   bool token_validated_;
     39 
     40   // Indicates if manager was successfully authenticated against
     41   // local cryptohome.
     42   bool logged_in_;
     43 
     44   Profile* manager_profile_;
     45 
     46   DISALLOW_COPY_AND_ASSIGN(LocallyManagedUserCreationFlow);
     47 };
     48 
     49 }  // namespace chromeos
     50 
     51 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_FLOW_H_
     52