Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / ui / webui_login_display.h
bloba810af9dc5db3f238199012c56e9830a6fe261f2
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_
8 #include <string>
9 #include <vector>
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/chromeos/login/signin_specifics.h"
13 #include "chrome/browser/chromeos/login/ui/login_display.h"
14 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h"
15 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
16 #include "components/user_manager/user.h"
17 #include "ui/base/user_activity/user_activity_observer.h"
18 #include "ui/views/widget/widget.h"
20 namespace chromeos {
22 // WebUI-based login UI implementation.
23 class WebUILoginDisplay : public LoginDisplay,
24 public NativeWindowDelegate,
25 public SigninScreenHandlerDelegate,
26 public ui::UserActivityObserver {
27 public:
28 explicit WebUILoginDisplay(LoginDisplay::Delegate* delegate);
29 ~WebUILoginDisplay() override;
31 // LoginDisplay implementation:
32 void ClearAndEnablePassword() override;
33 void Init(const user_manager::UserList& users,
34 bool show_guest,
35 bool show_users,
36 bool show_new_user) override;
37 void OnPreferencesChanged() override;
38 void RemoveUser(const std::string& user_id) override;
39 void SetUIEnabled(bool is_enabled) override;
40 void ShowError(int error_msg_id,
41 int login_attempts,
42 HelpAppLauncher::HelpTopic help_topic_id) override;
43 void ShowErrorScreen(LoginDisplay::SigninError error_id) override;
44 void ShowGaiaPasswordChanged(const std::string& username) override;
45 void ShowPasswordChangedDialog(bool show_password_error,
46 const std::string& email) override;
47 void ShowSigninUI(const std::string& email) override;
48 void ShowWhitelistCheckFailedError() override;
50 // NativeWindowDelegate implementation:
51 gfx::NativeWindow GetNativeWindow() const override;
53 // SigninScreenHandlerDelegate implementation:
54 void CancelPasswordChangedFlow() override;
55 void ResyncUserData() override;
56 void MigrateUserData(const std::string& old_password) override;
58 void Login(const UserContext& user_context,
59 const SigninSpecifics& specifics) override;
60 bool IsSigninInProgress() const override;
61 void Signout() override;
62 void CreateAccount() override;
63 void CompleteLogin(const UserContext& user_context) override;
65 void OnSigninScreenReady() override;
66 void CancelUserAdding() override;
67 void LoadWallpaper(const std::string& username) override;
68 void LoadSigninWallpaper() override;
69 void ShowEnterpriseEnrollmentScreen() override;
70 void ShowEnableDebuggingScreen() override;
71 void ShowKioskEnableScreen() override;
72 void ShowKioskAutolaunchScreen() override;
73 void ShowWrongHWIDScreen() override;
74 void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) override;
75 virtual void ShowSigninScreenForCreds(const std::string& username,
76 const std::string& password);
77 bool IsShowGuest() const override;
78 bool IsShowUsers() const override;
79 bool IsUserSigninCompleted() const override;
80 void SetDisplayEmail(const std::string& email) override;
82 void HandleGetUsers() override;
83 void CheckUserStatus(const std::string& user_id) override;
84 const user_manager::UserList& GetUsers() const override;
85 bool IsUserWhitelisted(const std::string& user_id) override;
87 // ui::UserActivityDetector implementation:
88 void OnUserActivity(const ui::Event* event) override;
90 private:
92 // Whether to show guest login.
93 bool show_guest_;
95 // Weather to show the user pods or a GAIA sign in.
96 // Public sessions are always shown.
97 bool show_users_;
99 // Whether to show add new user.
100 bool show_new_user_;
102 // Reference to the WebUI handling layer for the login screen
103 LoginDisplayWebUIHandler* webui_handler_;
105 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay);
108 } // namespace chromeos
110 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_