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

Side by Side Diff: chrome/browser/chromeos/login/screens/error_screen.h

Issue 254263004: Revert of Removed dependency on the UI from the NetworkPortalDetector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_SCREENS_ERROR_SCREEN_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/observer_list.h"
12 #include "chrome/browser/chromeos/login/login_performer.h" 13 #include "chrome/browser/chromeos/login/login_performer.h"
13 #include "chrome/browser/chromeos/login/oobe_display.h" 14 #include "chrome/browser/chromeos/login/oobe_display.h"
14 #include "chrome/browser/chromeos/login/screens/error_screen_actor_delegate.h" 15 #include "chrome/browser/chromeos/login/screens/error_screen_actor_delegate.h"
15 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" 16 #include "chrome/browser/chromeos/login/screens/wizard_screen.h"
16 #include "chrome/browser/chromeos/settings/device_settings_service.h" 17 #include "chrome/browser/chromeos/settings/device_settings_service.h"
17 18
18 namespace chromeos { 19 namespace chromeos {
19 20
20 class ScreenObserver; 21 class ScreenObserver;
21 22
22 // Controller for the error screen. 23 // Controller for the error screen.
23 class ErrorScreen : public WizardScreen, 24 class ErrorScreen : public WizardScreen,
24 public ErrorScreenActorDelegate, 25 public ErrorScreenActorDelegate,
25 public LoginPerformer::Delegate { 26 public LoginPerformer::Delegate {
26 public: 27 public:
28 class Observer {
29 public:
30 virtual ~Observer() {}
31 virtual void OnErrorScreenShow() = 0;
32 virtual void OnErrorScreenHide() = 0;
33 };
34
27 enum UIState { 35 enum UIState {
28 UI_STATE_UNKNOWN = 0, 36 UI_STATE_UNKNOWN = 0,
29 UI_STATE_UPDATE, 37 UI_STATE_UPDATE,
30 UI_STATE_SIGNIN, 38 UI_STATE_SIGNIN,
31 UI_STATE_LOCALLY_MANAGED, 39 UI_STATE_LOCALLY_MANAGED,
32 UI_STATE_KIOSK_MODE, 40 UI_STATE_KIOSK_MODE,
33 UI_STATE_LOCAL_STATE_ERROR, 41 UI_STATE_LOCAL_STATE_ERROR,
34 UI_STATE_AUTO_ENROLLMENT_ERROR, 42 UI_STATE_AUTO_ENROLLMENT_ERROR,
35 }; 43 };
36 44
37 enum ErrorState { 45 enum ErrorState {
38 ERROR_STATE_UNKNOWN = 0, 46 ERROR_STATE_UNKNOWN = 0,
39 ERROR_STATE_PORTAL, 47 ERROR_STATE_PORTAL,
40 ERROR_STATE_OFFLINE, 48 ERROR_STATE_OFFLINE,
41 ERROR_STATE_PROXY, 49 ERROR_STATE_PROXY,
42 ERROR_STATE_AUTH_EXT_TIMEOUT, 50 ERROR_STATE_AUTH_EXT_TIMEOUT,
43 ERROR_STATE_KIOSK_ONLINE 51 ERROR_STATE_KIOSK_ONLINE
44 }; 52 };
45 53
46 ErrorScreen(ScreenObserver* screen_observer, ErrorScreenActor* actor); 54 ErrorScreen(ScreenObserver* screen_observer, ErrorScreenActor* actor);
47 virtual ~ErrorScreen(); 55 virtual ~ErrorScreen();
48 56
57 void AddObserver(Observer* observer);
58 void RemoveObserver(Observer* observer);
59
49 // WizardScreen implementation. 60 // WizardScreen implementation.
50 virtual void PrepareToShow() OVERRIDE; 61 virtual void PrepareToShow() OVERRIDE;
51 virtual void Show() OVERRIDE; 62 virtual void Show() OVERRIDE;
52 virtual void Hide() OVERRIDE; 63 virtual void Hide() OVERRIDE;
53 virtual std::string GetName() const OVERRIDE; 64 virtual std::string GetName() const OVERRIDE;
54 65
55 // ErrorScreenActorDelegate implementation: 66 // ErrorScreenActorDelegate implementation:
56 virtual void OnErrorShow() OVERRIDE; 67 virtual void OnErrorShow() OVERRIDE;
57 virtual void OnErrorHide() OVERRIDE; 68 virtual void OnErrorHide() OVERRIDE;
58 virtual void OnLaunchOobeGuestSession() OVERRIDE; 69 virtual void OnLaunchOobeGuestSession() OVERRIDE;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 private: 110 private:
100 // Handles the response of an ownership check and starts the guest session if 111 // Handles the response of an ownership check and starts the guest session if
101 // applicable. 112 // applicable.
102 void StartGuestSessionAfterOwnershipCheck( 113 void StartGuestSessionAfterOwnershipCheck(
103 DeviceSettingsService::OwnershipStatus ownership_status); 114 DeviceSettingsService::OwnershipStatus ownership_status);
104 115
105 ErrorScreenActor* actor_; 116 ErrorScreenActor* actor_;
106 117
107 OobeDisplay::Screen parent_screen_; 118 OobeDisplay::Screen parent_screen_;
108 119
120 base::WeakPtrFactory<ErrorScreen> weak_factory_;
121
122 ObserverList<Observer> observers_;
123
109 scoped_ptr<LoginPerformer> guest_login_performer_; 124 scoped_ptr<LoginPerformer> guest_login_performer_;
110 125
111 base::WeakPtrFactory<ErrorScreen> weak_factory_;
112
113 DISALLOW_COPY_AND_ASSIGN(ErrorScreen); 126 DISALLOW_COPY_AND_ASSIGN(ErrorScreen);
114 }; 127 };
115 128
116 } // namespace chromeos 129 } // namespace chromeos
117 130
118 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_H_ 131 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698