| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SYNC_SYNC_SETUP_WIZARD_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ |
| 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 class SyncSetupFlowContainer; | 10 class SyncSetupFlowContainer; |
| 11 | 11 |
| 12 class ProfileSyncService; | 12 class ProfileSyncService; |
| 13 | 13 |
| 14 class SyncSetupWizard { | 14 class SyncSetupWizard { |
| 15 public: | 15 public: |
| 16 enum State { | 16 enum State { |
| 17 // Show the Google Account login UI. | 17 // Show the Google Account login UI. |
| 18 GAIA_LOGIN = 0, | 18 GAIA_LOGIN = 0, |
| 19 // A login attempt succeeded. This will wait for an explicit transition | 19 // A login attempt succeeded. Depending on initial conditions, this may |
| 20 // (via Step) to the next state. | 20 // cause a transition to DONE, or to wait for an explicit transition (via |
| 21 // Step) to the next state. |
| 21 GAIA_SUCCESS, | 22 GAIA_SUCCESS, |
| 22 // Show the screen that lets you click either "Keep everything synced" or | |
| 23 // "Choose which data types to sync", and checkboxes for each data type. | |
| 24 CHOOSE_DATA_TYPES, | |
| 25 // Show the screen that lets you create a passphrase (if you've never set | |
| 26 // one up before). | |
| 27 CREATE_PASSPHRASE, | |
| 28 // Show the screen that lets you enter the passphrase (if you've set one up | |
| 29 // on another machine). | |
| 30 ENTER_PASSPHRASE, | |
| 31 // Show the screen that lets you reset your passphrase (if you forgot it). | |
| 32 RESET_PASSPHRASE, | |
| 33 // The panic switch. Something went terribly wrong during setup and we | 23 // The panic switch. Something went terribly wrong during setup and we |
| 34 // can't recover. | 24 // can't recover. |
| 35 FATAL_ERROR, | 25 FATAL_ERROR, |
| 36 // A final state for when setup completes and it is possible it is the | 26 // A final state for when setup completes and it is possible it is the |
| 37 // user's first time (globally speaking) as the cloud doesn't have any | 27 // user's first time (globally speaking) as the cloud doesn't have any |
| 38 // bookmarks. We show additional info in this case to explain setting up | 28 // bookmarks. We show additional info in this case to explain setting up |
| 39 // more computers. | 29 // more computers. |
| 40 DONE_FIRST_TIME, | 30 DONE_FIRST_TIME, |
| 41 // A catch-all done case for any setup process. | 31 // A catch-all done case for any setup process. |
| 42 DONE | 32 DONE |
| (...skipping 22 matching lines...) Expand all Loading... |
| 65 // gaia credentials in the event of a steady-state auth failure, this is | 55 // gaia credentials in the event of a steady-state auth failure, this is |
| 66 // a "discrete" run (as in not a continuous wizard flow). This returns | 56 // a "discrete" run (as in not a continuous wizard flow). This returns |
| 67 // the end state to pass to Run for a given |start_state|. | 57 // the end state to pass to Run for a given |start_state|. |
| 68 static State GetEndStateForDiscreteRun(State start_state); | 58 static State GetEndStateForDiscreteRun(State start_state); |
| 69 | 59 |
| 70 // Helper to return whether |state| warrants starting a new flow. | 60 // Helper to return whether |state| warrants starting a new flow. |
| 71 static bool IsTerminalState(State state); | 61 static bool IsTerminalState(State state); |
| 72 | 62 |
| 73 ProfileSyncService* service_; | 63 ProfileSyncService* service_; |
| 74 | 64 |
| 65 // The use of ShowHtmlDialog and SyncSetupFlowContainer is disabled on Linux |
| 66 // until BrowserShowHtmlDialog() is implemented. |
| 67 // See: http://code.google.com/p/chromium/issues/detail?id=25260 |
| 75 SyncSetupFlowContainer* flow_container_; | 68 SyncSetupFlowContainer* flow_container_; |
| 76 | 69 |
| 77 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); | 70 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); |
| 78 }; | 71 }; |
| 79 | 72 |
| 80 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ | 73 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ |
| OLD | NEW |