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

Side by Side Diff: chrome/browser/chromeos/login/lock/webui_screen_locker.h

Issue 2830933002: cros: Use SessionController for lock starting code (Closed)
Patch Set: update comment Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "ash/wm/lock_state_observer.h" 13 #include "ash/wm/lock_state_observer.h"
James Cook 2017/04/19 23:13:12 Is this still needed?
xiyuan 2017/04/20 18:23:59 Nope. Removed.
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/chromeos/login/signin_screen_controller.h" 17 #include "chrome/browser/chromeos/login/signin_screen_controller.h"
18 #include "chrome/browser/chromeos/login/signin_specifics.h" 18 #include "chrome/browser/chromeos/login/signin_specifics.h"
19 #include "chrome/browser/chromeos/login/ui/lock_window.h" 19 #include "chrome/browser/chromeos/login/ui/lock_window.h"
20 #include "chrome/browser/chromeos/login/ui/login_display.h" 20 #include "chrome/browser/chromeos/login/ui/login_display.h"
21 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 21 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
22 #include "chromeos/dbus/power_manager_client.h" 22 #include "chromeos/dbus/power_manager_client.h"
23 #include "content/public/browser/web_contents_observer.h" 23 #include "content/public/browser/web_contents_observer.h"
(...skipping 14 matching lines...) Expand all
38 class NetworkStateHelper; 38 class NetworkStateHelper;
39 } 39 }
40 40
41 namespace test { 41 namespace test {
42 class WebUIScreenLockerTester; 42 class WebUIScreenLockerTester;
43 } 43 }
44 44
45 // Displays a WebUI lock screen based on the Oobe account picker screen. 45 // Displays a WebUI lock screen based on the Oobe account picker screen.
46 class WebUIScreenLocker : public WebUILoginView, 46 class WebUIScreenLocker : public WebUILoginView,
47 public LoginDisplay::Delegate, 47 public LoginDisplay::Delegate,
48 public ash::LockStateObserver,
49 public views::WidgetObserver, 48 public views::WidgetObserver,
50 public PowerManagerClient::Observer, 49 public PowerManagerClient::Observer,
51 public display::DisplayObserver, 50 public display::DisplayObserver,
52 public content::WebContentsObserver { 51 public content::WebContentsObserver {
53 public: 52 public:
54 // Request lock screen preload when the user is idle. Does nothing if 53 // Request lock screen preload when the user is idle. Does nothing if
55 // preloading is disabled or if the preload hueristics return false. 54 // preloading is disabled or if the preload hueristics return false.
56 static void RequestPreload(); 55 static void RequestPreload();
57 56
58 explicit WebUIScreenLocker(ScreenLocker* screen_locker); 57 explicit WebUIScreenLocker(ScreenLocker* screen_locker);
(...skipping 22 matching lines...) Expand all
81 // Called when the webui lock screen is ready. This gets invoked by a 80 // Called when the webui lock screen is ready. This gets invoked by a
82 // chrome.send from the embedded webui. 81 // chrome.send from the embedded webui.
83 void OnLockWebUIReady(); 82 void OnLockWebUIReady();
84 83
85 // Called when webui lock screen wallpaper is loaded and displayed. 84 // Called when webui lock screen wallpaper is loaded and displayed.
86 void OnLockBackgroundDisplayed(); 85 void OnLockBackgroundDisplayed();
87 86
88 // Called when the webui header bar becomes visible. 87 // Called when the webui header bar becomes visible.
89 void OnHeaderBarVisible(); 88 void OnHeaderBarVisible();
90 89
90 // Called by ScreenLocker to notify that ash lock animation finishes.
91 void OnLockAnimationFinished();
92
91 private: 93 private:
92 friend class test::WebUIScreenLockerTester; 94 friend class test::WebUIScreenLockerTester;
93 95
94 // Returns true if the lock screen should be preloaded. 96 // Returns true if the lock screen should be preloaded.
95 static bool ShouldPreloadLockScreen(); 97 static bool ShouldPreloadLockScreen();
96 // Helper function that creates and preloads a views::WebView. 98 // Helper function that creates and preloads a views::WebView.
97 static std::unique_ptr<views::WebView> DoPreload(Profile* profile); 99 static std::unique_ptr<views::WebView> DoPreload(Profile* profile);
98 100
99 // LoginDisplay::Delegate: 101 // LoginDisplay::Delegate:
100 void CancelPasswordChangedFlow() override; 102 void CancelPasswordChangedFlow() override;
(...skipping 11 matching lines...) Expand all
112 void OnStartKioskAutolaunchScreen() override; 114 void OnStartKioskAutolaunchScreen() override;
113 void ShowWrongHWIDScreen() override; 115 void ShowWrongHWIDScreen() override;
114 void ResetAutoLoginTimer() override; 116 void ResetAutoLoginTimer() override;
115 void ResyncUserData() override; 117 void ResyncUserData() override;
116 void SetDisplayEmail(const std::string& email) override; 118 void SetDisplayEmail(const std::string& email) override;
117 void SetDisplayAndGivenName(const std::string& display_name, 119 void SetDisplayAndGivenName(const std::string& display_name,
118 const std::string& given_name) override; 120 const std::string& given_name) override;
119 void Signout() override; 121 void Signout() override;
120 bool IsUserWhitelisted(const AccountId& account_id) override; 122 bool IsUserWhitelisted(const AccountId& account_id) override;
121 123
122 // LockStateObserver:
123 void OnLockStateEvent(ash::LockStateObserver::EventType event) override;
124
125 // WidgetObserver: 124 // WidgetObserver:
126 void OnWidgetDestroying(views::Widget* widget) override; 125 void OnWidgetDestroying(views::Widget* widget) override;
127 126
128 // PowerManagerClient::Observer: 127 // PowerManagerClient::Observer:
129 void SuspendImminent() override; 128 void SuspendImminent() override;
130 void SuspendDone(const base::TimeDelta& sleep_duration) override; 129 void SuspendDone(const base::TimeDelta& sleep_duration) override;
131 void LidEventReceived(PowerManagerClient::LidState state, 130 void LidEventReceived(PowerManagerClient::LidState state,
132 const base::TimeTicks& time) override; 131 const base::TimeTicks& time) override;
133 132
134 // content::WebContentsObserver: 133 // content::WebContentsObserver:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 std::unique_ptr<login::NetworkStateHelper> network_state_helper_; 181 std::unique_ptr<login::NetworkStateHelper> network_state_helper_;
183 182
184 base::WeakPtrFactory<WebUIScreenLocker> weak_factory_; 183 base::WeakPtrFactory<WebUIScreenLocker> weak_factory_;
185 184
186 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLocker); 185 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLocker);
187 }; 186 };
188 187
189 } // namespace chromeos 188 } // namespace chromeos
190 189
191 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_ 190 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WEBUI_SCREEN_LOCKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698