| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FLOW_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Fills |args| with "user" and "error" arguments by querying |service|. | 54 // Fills |args| with "user" and "error" arguments by querying |service|. |
| 55 static void GetArgsForGaiaLogin( | 55 static void GetArgsForGaiaLogin( |
| 56 const ProfileSyncService* service, | 56 const ProfileSyncService* service, |
| 57 DictionaryValue* args); | 57 DictionaryValue* args); |
| 58 | 58 |
| 59 // Fills |args| for the configure screen (Choose Data Types/Encryption) | 59 // Fills |args| for the configure screen (Choose Data Types/Encryption) |
| 60 static void GetArgsForConfigure( | 60 static void GetArgsForConfigure( |
| 61 ProfileSyncService* service, | 61 ProfileSyncService* service, |
| 62 DictionaryValue* args); | 62 DictionaryValue* args); |
| 63 | 63 |
| 64 // Fills |args| for the enter passphrase screen. | |
| 65 static void GetArgsForEnterPassphrase( | |
| 66 bool tried_creating_explicit_passphrase, | |
| 67 bool tried_setting_explicit_passphrase, | |
| 68 DictionaryValue* args); | |
| 69 | |
| 70 void AttachSyncSetupHandler(SyncSetupFlowHandler* handler); | 64 void AttachSyncSetupHandler(SyncSetupFlowHandler* handler); |
| 71 | 65 |
| 72 // Triggers a state machine transition to advance_state. | 66 // Triggers a state machine transition to advance_state. |
| 73 void Advance(SyncSetupWizard::State advance_state); | 67 void Advance(SyncSetupWizard::State advance_state); |
| 74 | 68 |
| 75 // Focuses the dialog. This is useful in cases where the dialog has been | 69 // Focuses the dialog. This is useful in cases where the dialog has been |
| 76 // obscured by a browser window. | 70 // obscured by a browser window. |
| 77 void Focus(); | 71 void Focus(); |
| 78 | 72 |
| 79 void OnUserSubmittedAuth(const std::string& username, | 73 void OnUserSubmittedAuth(const std::string& username, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 99 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, ChooseDataTypesSetsPrefs); | 93 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, ChooseDataTypesSetsPrefs); |
| 100 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DialogCancelled); | 94 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DialogCancelled); |
| 101 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, InvalidTransitions); | 95 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, InvalidTransitions); |
| 102 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, FullSuccessfulRunSetsPref); | 96 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, FullSuccessfulRunSetsPref); |
| 103 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, AbortedByPendingClear); | 97 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, AbortedByPendingClear); |
| 104 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DiscreteRunGaiaLogin); | 98 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DiscreteRunGaiaLogin); |
| 105 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DiscreteRunChooseDataTypes); | 99 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DiscreteRunChooseDataTypes); |
| 106 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, | 100 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, |
| 107 DiscreteRunChooseDataTypesAbortedByPendingClear); | 101 DiscreteRunChooseDataTypesAbortedByPendingClear); |
| 108 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, EnterPassphraseRequired); | 102 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, EnterPassphraseRequired); |
| 103 FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, NonFatalError); |
| 109 | 104 |
| 110 // Use static Run method to get an instance. | 105 // Use static Run method to get an instance. |
| 111 SyncSetupFlow(SyncSetupWizard::State start_state, | 106 SyncSetupFlow(SyncSetupWizard::State start_state, |
| 112 SyncSetupWizard::State end_state, | 107 SyncSetupWizard::State end_state, |
| 113 const std::string& args, | 108 const std::string& args, |
| 114 SyncSetupFlowContainer* container, | 109 SyncSetupFlowContainer* container, |
| 115 ProfileSyncService* service); | 110 ProfileSyncService* service); |
| 116 | 111 |
| 117 // Returns true if |this| should transition its state machine to |state| | 112 // Returns true if |this| should transition its state machine to |state| |
| 118 // based on |current_state_|, or false if that would be nonsense or is | 113 // based on |current_state_|, or false if that would be nonsense or is |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 151 } |
| 157 | 152 |
| 158 SyncSetupFlow* get_flow() { return flow_; } | 153 SyncSetupFlow* get_flow() { return flow_; } |
| 159 private: | 154 private: |
| 160 SyncSetupFlow* flow_; | 155 SyncSetupFlow* flow_; |
| 161 | 156 |
| 162 DISALLOW_COPY_AND_ASSIGN(SyncSetupFlowContainer); | 157 DISALLOW_COPY_AND_ASSIGN(SyncSetupFlowContainer); |
| 163 }; | 158 }; |
| 164 | 159 |
| 165 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ | 160 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ |
| OLD | NEW |