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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // new dialog starting at |advance_state|. If the wizard has never run | 59 // new dialog starting at |advance_state|. If the wizard has never run |
60 // through to completion, it will always attempt to do so. Otherwise, e.g | 60 // through to completion, it will always attempt to do so. Otherwise, e.g |
61 // for a transient auth failure, it will just run as far as is necessary | 61 // for a transient auth failure, it will just run as far as is necessary |
62 // based on |advance_state| (so for auth failure, up to GAIA_SUCCESS). | 62 // based on |advance_state| (so for auth failure, up to GAIA_SUCCESS). |
63 void Step(State advance_state); | 63 void Step(State advance_state); |
64 | 64 |
65 // Whether or not a dialog is currently showing. Useful to determine | 65 // Whether or not a dialog is currently showing. Useful to determine |
66 // if various buttons in the UI should be enabled or disabled. | 66 // if various buttons in the UI should be enabled or disabled. |
67 bool IsVisible() const; | 67 bool IsVisible() const; |
68 | 68 |
| 69 // Returns true iff Sync is using OAuth-based authentication. See also |
| 70 // GetLoginState(). |
| 71 static bool IsUsingOAuth(); |
| 72 |
69 // Returns either GAIA_LOGIN or OAUTH_LOGIN depending on which | 73 // Returns either GAIA_LOGIN or OAUTH_LOGIN depending on which |
70 // authentication scheme is in force. | 74 // authentication scheme is in force. |
71 static State GetLoginState(); | 75 static State GetLoginState(); |
72 | 76 |
73 // Focus the dialog if it is already open. Does nothing if the dialog is | 77 // Focus the dialog if it is already open. Does nothing if the dialog is |
74 // not visible. | 78 // not visible. |
75 void Focus(); | 79 void Focus(); |
76 | 80 |
77 // Attaches |handler| to the flow contained in |flow_container_|. Returns NULL | 81 // Attaches |handler| to the flow contained in |flow_container_|. Returns NULL |
78 // if the flow does not exist or if an existing handler is already attached to | 82 // if the flow does not exist or if an existing handler is already attached to |
79 // the flow. | 83 // the flow. |
80 SyncSetupFlow* AttachSyncSetupHandler(SyncSetupFlowHandler* handler); | 84 SyncSetupFlow* AttachSyncSetupHandler(SyncSetupFlowHandler* handler); |
81 | 85 |
82 private: | 86 private: |
83 ProfileSyncService* service_; | 87 ProfileSyncService* service_; |
84 | 88 |
85 SyncSetupFlowContainer* flow_container_; | 89 SyncSetupFlowContainer* flow_container_; |
86 | 90 |
87 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); | 91 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); |
88 }; | 92 }; |
89 | 93 |
90 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ | 94 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ |
OLD | NEW |