| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" |
| 12 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 18 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
| 17 #include "chrome/browser/chromeos/login/login_display.h" | 19 #include "chrome/browser/chromeos/login/login_display.h" |
| 18 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 20 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
| 19 #include "chrome/browser/chromeos/login/user_manager.h" | 21 #include "chrome/browser/chromeos/login/user_manager.h" |
| 20 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 22 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 21 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 23 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 231 |
| 230 void set_kiosk_enable_flow_aborted_callback_for_test( | 232 void set_kiosk_enable_flow_aborted_callback_for_test( |
| 231 const base::Closure& callback) { | 233 const base::Closure& callback) { |
| 232 kiosk_enable_flow_aborted_callback_for_test_ = callback; | 234 kiosk_enable_flow_aborted_callback_for_test_ = callback; |
| 233 } | 235 } |
| 234 | 236 |
| 235 // From WallpaperManager::Observer | 237 // From WallpaperManager::Observer |
| 236 virtual void OnWallpaperAnimationFinished(const std::string& email) OVERRIDE; | 238 virtual void OnWallpaperAnimationFinished(const std::string& email) OVERRIDE; |
| 237 | 239 |
| 238 private: | 240 private: |
| 241 class AuthenticatedUserEmailRetriever; |
| 242 |
| 239 enum UIState { | 243 enum UIState { |
| 240 UI_STATE_UNKNOWN = 0, | 244 UI_STATE_UNKNOWN = 0, |
| 241 UI_STATE_GAIA_SIGNIN, | 245 UI_STATE_GAIA_SIGNIN, |
| 242 UI_STATE_ACCOUNT_PICKER, | 246 UI_STATE_ACCOUNT_PICKER, |
| 243 }; | 247 }; |
| 244 | 248 |
| 245 typedef base::hash_set<std::string> WebUIObservers; | 249 typedef base::hash_set<std::string> WebUIObservers; |
| 246 | 250 |
| 247 friend class ReportDnsCacheClearedOnUIThread; | 251 friend class ReportDnsCacheClearedOnUIThread; |
| 248 friend class LocallyManagedUserCreationScreenHandler; | 252 friend class LocallyManagedUserCreationScreenHandler; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 void HandleResyncUserData(); | 360 void HandleResyncUserData(); |
| 357 void HandleLoginUIStateChanged(const std::string& source, bool new_value); | 361 void HandleLoginUIStateChanged(const std::string& source, bool new_value); |
| 358 void HandleUnlockOnLoginSuccess(); | 362 void HandleUnlockOnLoginSuccess(); |
| 359 void HandleLoginScreenUpdate(); | 363 void HandleLoginScreenUpdate(); |
| 360 void HandleShowLoadingTimeoutError(); | 364 void HandleShowLoadingTimeoutError(); |
| 361 void HandleUpdateOfflineLogin(bool offline_login_active); | 365 void HandleUpdateOfflineLogin(bool offline_login_active); |
| 362 void HandleShowLocallyManagedUserCreationScreen(); | 366 void HandleShowLocallyManagedUserCreationScreen(); |
| 363 void HandleFocusPod(const std::string& user_id); | 367 void HandleFocusPod(const std::string& user_id); |
| 364 void HandleLaunchKioskApp(const std::string& app_id); | 368 void HandleLaunchKioskApp(const std::string& app_id); |
| 365 void HandleCustomButtonClicked(const std::string& username); | 369 void HandleCustomButtonClicked(const std::string& username); |
| 370 void HandleRetrieveAuthenticatedUserEmail(double attempt_token); |
| 366 | 371 |
| 367 // Fills |user_dict| with information about |user|. | 372 // Fills |user_dict| with information about |user|. |
| 368 static void FillUserDictionary(User* user, | 373 static void FillUserDictionary(User* user, |
| 369 bool is_owner, | 374 bool is_owner, |
| 370 base::DictionaryValue* user_dict); | 375 base::DictionaryValue* user_dict); |
| 371 | 376 |
| 372 // Sends user list to account picker. | 377 // Sends user list to account picker. |
| 373 void SendUserList(bool animated); | 378 void SendUserList(bool animated); |
| 374 | 379 |
| 375 // Kick off cookie / local storage cleanup. | 380 // Kick off cookie / local storage cleanup. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 517 |
| 513 base::Closure kiosk_enable_flow_aborted_callback_for_test_; | 518 base::Closure kiosk_enable_flow_aborted_callback_for_test_; |
| 514 | 519 |
| 515 // Map of callbacks run when the custom button on a user pod is clicked. | 520 // Map of callbacks run when the custom button on a user pod is clicked. |
| 516 std::map<std::string, base::Closure> user_pod_button_callback_map_; | 521 std::map<std::string, base::Closure> user_pod_button_callback_map_; |
| 517 | 522 |
| 518 // Non-owning ptr. | 523 // Non-owning ptr. |
| 519 // TODO (ygorshenin@): remove this dependency. | 524 // TODO (ygorshenin@): remove this dependency. |
| 520 GaiaScreenHandler* gaia_screen_handler_; | 525 GaiaScreenHandler* gaia_screen_handler_; |
| 521 | 526 |
| 527 // Helper that retrieves the authenticated user's e-mail address. |
| 528 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; |
| 529 |
| 522 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 530 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 523 }; | 531 }; |
| 524 | 532 |
| 525 } // namespace chromeos | 533 } // namespace chromeos |
| 526 | 534 |
| 527 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 535 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |