| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_WIZARD_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/screen_observer.h" | 12 #include "chrome/browser/chromeos/login/screen_observer.h" |
| 13 #include "chrome/browser/chromeos/login/string_fetcher.h" |
| 13 #include "chrome/browser/chromeos/login/view_screen.h" | 14 #include "chrome/browser/chromeos/login/view_screen.h" |
| 14 #include "chrome/browser/chromeos/login/wizard_screen.h" | 15 #include "chrome/browser/chromeos/login/wizard_screen.h" |
| 15 #include "testing/gtest/include/gtest/gtest_prod.h" | 16 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 16 | 17 |
| 17 class PrefService; | 18 class PrefService; |
| 18 class WizardContentsView; | 19 class WizardContentsView; |
| 19 class WizardScreen; | 20 class WizardScreen; |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| 22 class AccountScreen; | 23 class AccountScreen; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 46 public: | 47 public: |
| 47 WizardController(); | 48 WizardController(); |
| 48 ~WizardController(); | 49 ~WizardController(); |
| 49 | 50 |
| 50 // Returns the default wizard controller if it has been created. | 51 // Returns the default wizard controller if it has been created. |
| 51 static WizardController* default_controller() { | 52 static WizardController* default_controller() { |
| 52 return default_controller_; | 53 return default_controller_; |
| 53 } | 54 } |
| 54 | 55 |
| 55 // Returns OOBE completion status. | 56 // Returns OOBE completion status. |
| 56 static bool IsOobeComplete(); | 57 static bool IsOobeCompleted(); |
| 58 |
| 59 // Returns device registration completion status, i.e. second part of OOBE. |
| 60 static bool IsDeviceRegistered(); |
| 57 | 61 |
| 58 // Shows the first screen defined by |first_screen_name| or by default | 62 // Shows the first screen defined by |first_screen_name| or by default |
| 59 // if the parameter is empty. |screen_bounds| are used to calculate position | 63 // if the parameter is empty. |screen_bounds| are used to calculate position |
| 60 // of the wizard screen. | 64 // of the wizard screen. |
| 61 void Init(const std::string& first_screen_name, | 65 void Init(const std::string& first_screen_name, |
| 62 const gfx::Rect& screen_bounds); | 66 const gfx::Rect& screen_bounds); |
| 63 | 67 |
| 64 // Returns the view that contains all the other views. | 68 // Returns the view that contains all the other views. |
| 65 views::View* contents() { return contents_; } | 69 views::View* contents() { return contents_; } |
| 66 | 70 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // of the document object. | 110 // of the document object. |
| 107 void SetCustomization( | 111 void SetCustomization( |
| 108 const chromeos::StartupCustomizationDocument* customization); | 112 const chromeos::StartupCustomizationDocument* customization); |
| 109 | 113 |
| 110 // Returns partner startup customization document owned by WizardController. | 114 // Returns partner startup customization document owned by WizardController. |
| 111 const chromeos::StartupCustomizationDocument* GetCustomization() const; | 115 const chromeos::StartupCustomizationDocument* GetCustomization() const; |
| 112 | 116 |
| 113 // Registers OOBE preferences. | 117 // Registers OOBE preferences. |
| 114 static void RegisterPrefs(PrefService* local_state); | 118 static void RegisterPrefs(PrefService* local_state); |
| 115 | 119 |
| 120 // Applies partner services customizations. |
| 121 void ApplyPartnerServicesCustomizations(); |
| 122 |
| 116 static const char kNetworkScreenName[]; | 123 static const char kNetworkScreenName[]; |
| 117 static const char kLoginScreenName[]; | 124 static const char kLoginScreenName[]; |
| 118 static const char kAccountScreenName[]; | 125 static const char kAccountScreenName[]; |
| 119 static const char kUpdateScreenName[]; | 126 static const char kUpdateScreenName[]; |
| 120 static const char kUserImageScreenName[]; | 127 static const char kUserImageScreenName[]; |
| 121 static const char kRegistrationScreenName[]; | 128 static const char kRegistrationScreenName[]; |
| 122 static const char kOutOfBoxScreenName[]; | 129 static const char kOutOfBoxScreenName[]; |
| 123 static const char kTestNoScreenName[]; | 130 static const char kTestNoScreenName[]; |
| 124 static const char kEulaScreenName[]; | 131 static const char kEulaScreenName[]; |
| 125 | 132 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 virtual views::View* GetWizardView(); | 164 virtual views::View* GetWizardView(); |
| 158 virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen); | 165 virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen); |
| 159 | 166 |
| 160 // Determines which screen to show first by the parameter, shows it and | 167 // Determines which screen to show first by the parameter, shows it and |
| 161 // sets it as the current one. | 168 // sets it as the current one. |
| 162 void ShowFirstScreen(const std::string& first_screen_name); | 169 void ShowFirstScreen(const std::string& first_screen_name); |
| 163 | 170 |
| 164 // Marks OOBE process as completed. | 171 // Marks OOBE process as completed. |
| 165 void MarkOobeCompleted(); | 172 void MarkOobeCompleted(); |
| 166 | 173 |
| 174 // Marks device registered. i.e. second part of OOBE is completed. |
| 175 void MarkDeviceRegistered(); |
| 176 |
| 167 // Widget we're showing in. | 177 // Widget we're showing in. |
| 168 views::Widget* widget_; | 178 views::Widget* widget_; |
| 169 | 179 |
| 170 // Used to render the background. | 180 // Used to render the background. |
| 171 views::Widget* background_widget_; | 181 views::Widget* background_widget_; |
| 172 chromeos::BackgroundView* background_view_; | 182 chromeos::BackgroundView* background_view_; |
| 173 | 183 |
| 174 // Contents view. | 184 // Contents view. |
| 175 views::View* contents_; | 185 views::View* contents_; |
| 176 | 186 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 198 | 208 |
| 199 // NULL by default - controller itself is observer. Mock could be assigned. | 209 // NULL by default - controller itself is observer. Mock could be assigned. |
| 200 ScreenObserver* observer_; | 210 ScreenObserver* observer_; |
| 201 | 211 |
| 202 // Default WizardController. | 212 // Default WizardController. |
| 203 static WizardController* default_controller_; | 213 static WizardController* default_controller_; |
| 204 | 214 |
| 205 // Partner startup customizations. | 215 // Partner startup customizations. |
| 206 scoped_ptr<const chromeos::StartupCustomizationDocument> customization_; | 216 scoped_ptr<const chromeos::StartupCustomizationDocument> customization_; |
| 207 | 217 |
| 218 // Partner services manifest fetcher. |
| 219 scoped_ptr<StringFetcher> services_manifest_fetcher_; |
| 220 |
| 208 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowErrorNetwork); | 221 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowErrorNetwork); |
| 209 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowErrorUpdate); | 222 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowErrorUpdate); |
| 210 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, | 223 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, |
| 211 ControlFlowLanguageOnLogin); | 224 ControlFlowLanguageOnLogin); |
| 212 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, | 225 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, |
| 213 ControlFlowLanguageOnNetwork); | 226 ControlFlowLanguageOnNetwork); |
| 214 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); | 227 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, ControlFlowMain); |
| 215 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); | 228 FRIEND_TEST_ALL_PREFIXES(WizardControllerTest, SwitchLanguage); |
| 216 friend class WizardControllerFlowTest; | 229 friend class WizardControllerFlowTest; |
| 217 | 230 |
| 218 DISALLOW_COPY_AND_ASSIGN(WizardController); | 231 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 219 }; | 232 }; |
| 220 | 233 |
| 221 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 234 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |