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 #if defined(OS_LINUX) | 10 #if defined(TOOLKIT_GTK) |
11 typedef struct _GtkWidget GtkWidget; | 11 typedef struct _GtkWidget GtkWidget; |
12 typedef struct _GtkWindow GtkWindow; | 12 typedef struct _GtkWindow GtkWindow; |
13 #else | 13 #else |
14 class SyncSetupFlowContainer; | 14 class SyncSetupFlowContainer; |
15 #endif | 15 #endif |
16 | 16 |
17 class ProfileSyncService; | 17 class ProfileSyncService; |
18 | 18 |
19 class SyncSetupWizard { | 19 class SyncSetupWizard { |
20 public: | 20 public: |
(...skipping 25 matching lines...) Expand all Loading... |
46 // new dialog starting at |advance_state|. If the wizard has never ran | 46 // new dialog starting at |advance_state|. If the wizard has never ran |
47 // through to completion, it will always attempt to do so. Otherwise, e.g | 47 // through to completion, it will always attempt to do so. Otherwise, e.g |
48 // for a transient auth failure, it will just run as far as is necessary | 48 // for a transient auth failure, it will just run as far as is necessary |
49 // based on |advance_state| (so for auth failure, up to GAIA_SUCCESS). | 49 // based on |advance_state| (so for auth failure, up to GAIA_SUCCESS). |
50 void Step(State advance_state); | 50 void Step(State advance_state); |
51 | 51 |
52 // Whether or not a dialog is currently showing. Useful to determine | 52 // Whether or not a dialog is currently showing. Useful to determine |
53 // if various buttons in the UI should be enabled or disabled. | 53 // if various buttons in the UI should be enabled or disabled. |
54 bool IsVisible() const; | 54 bool IsVisible() const; |
55 | 55 |
56 #if defined(OS_LINUX) | 56 #if defined(TOOLKIT_GTK) |
57 void set_visible(bool visible) { visible_ = visible; } | 57 void set_visible(bool visible) { visible_ = visible; } |
58 #endif | 58 #endif |
59 | 59 |
60 private: | 60 private: |
61 // If we just need to pop open an individual dialog, say to collect | 61 // If we just need to pop open an individual dialog, say to collect |
62 // gaia credentials in the event of a steady-state auth failure, this is | 62 // gaia credentials in the event of a steady-state auth failure, this is |
63 // a "discrete" run (as in not a continuous wizard flow). This returns | 63 // a "discrete" run (as in not a continuous wizard flow). This returns |
64 // the end state to pass to Run for a given |start_state|. | 64 // the end state to pass to Run for a given |start_state|. |
65 static State GetEndStateForDiscreteRun(State start_state); | 65 static State GetEndStateForDiscreteRun(State start_state); |
66 | 66 |
67 // Helper to return whether |state| warrants starting a new flow. | 67 // Helper to return whether |state| warrants starting a new flow. |
68 static bool IsTerminalState(State state); | 68 static bool IsTerminalState(State state); |
69 | 69 |
70 ProfileSyncService* service_; | 70 ProfileSyncService* service_; |
71 | 71 |
72 #if defined(OS_LINUX) | 72 #if defined(TOOLKIT_GTK) |
73 bool visible_; | 73 bool visible_; |
74 #else | 74 #else |
75 // The use of ShowHtmlDialog and SyncSetupFlowContainer is disabled on Linux | 75 // The use of ShowHtmlDialog and SyncSetupFlowContainer is disabled on Linux |
76 // until BrowserShowHtmlDialog() is implemented. | 76 // until BrowserShowHtmlDialog() is implemented. |
77 // See: http://code.google.com/p/chromium/issues/detail?id=25260 | 77 // See: http://code.google.com/p/chromium/issues/detail?id=25260 |
78 SyncSetupFlowContainer* flow_container_; | 78 SyncSetupFlowContainer* flow_container_; |
79 #endif | 79 #endif |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); | 81 DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard); |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ | 84 #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_ |
OLD | NEW |