1 // Copyright 2018 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_SCREENS_PIN_SETUP_SCREEN_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_PIN_SETUP_SCREEN_H_ 7 8 #include <string> 9 10 #include "base/callback.h" 11 #include "base/macros.h" 12 #include "chrome/browser/chromeos/login/screens/base_screen.h" 13 14 namespace chromeos { 15 16 class PinSetupScreenView; 17 18 class PinSetupScreen : public BaseScreen { 19 public: 20 enum class Result { NEXT, NOT_APPLICABLE }; 21 22 static std::string GetResultString(Result result); 23 static bool ShouldSkip(); 24 25 using ScreenExitCallback = base::RepeatingCallback<void(Result result)>; 26 PinSetupScreen(PinSetupScreenView* view, 27 const ScreenExitCallback& exit_callback); 28 ~PinSetupScreen() override; 29 set_exit_callback_for_testing(const ScreenExitCallback & exit_callback)30 void set_exit_callback_for_testing(const ScreenExitCallback& exit_callback) { 31 exit_callback_ = exit_callback; 32 } 33 get_exit_callback_for_testing()34 const ScreenExitCallback& get_exit_callback_for_testing() { 35 return exit_callback_; 36 } 37 38 protected: 39 // BaseScreen: 40 bool MaybeSkip(WizardContext* context) override; 41 void ShowImpl() override; 42 void HideImpl() override; 43 void OnUserAction(const std::string& action_id) override; 44 45 private: 46 PinSetupScreenView* const view_; 47 ScreenExitCallback exit_callback_; 48 49 DISALLOW_COPY_AND_ASSIGN(PinSetupScreen); 50 }; 51 52 } // namespace chromeos 53 54 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_PIN_SETUP_SCREEN_H_ 55