| 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_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "content/common/notification_observer.h" | 31 #include "content/common/notification_observer.h" |
| 32 #include "content/common/notification_registrar.h" | 32 #include "content/common/notification_registrar.h" |
| 33 #include "content/common/notification_type.h" | 33 #include "content/common/notification_type.h" |
| 34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
| 35 | 35 |
| 36 class NotificationDetails; | 36 class NotificationDetails; |
| 37 class NotificationSource; | 37 class NotificationSource; |
| 38 class Profile; | 38 class Profile; |
| 39 class ProfileSyncFactory; | 39 class ProfileSyncFactory; |
| 40 class SigninManager; | 40 class SigninManager; |
| 41 class WebUI; | |
| 42 | 41 |
| 43 namespace browser_sync { | 42 namespace browser_sync { |
| 44 class BackendMigrator; | 43 class BackendMigrator; |
| 45 class ChangeProcessor; | 44 class ChangeProcessor; |
| 46 class DataTypeManager; | 45 class DataTypeManager; |
| 47 class JsFrontend; | 46 class JsFrontend; |
| 48 class SessionModelAssociator; | 47 class SessionModelAssociator; |
| 49 namespace sessions { struct SyncSessionSnapshot; } | 48 namespace sessions { struct SyncSessionSnapshot; } |
| 50 } | 49 } |
| 51 | 50 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // progress, the sync system is already authenticated, or some error | 236 // progress, the sync system is already authenticated, or some error |
| 238 // occurred preventing the action. We make it the duty of ProfileSyncService | 237 // occurred preventing the action. We make it the duty of ProfileSyncService |
| 239 // to open the dialog to easily ensure only one is ever showing. | 238 // to open the dialog to easily ensure only one is ever showing. |
| 240 virtual bool SetupInProgress() const; | 239 virtual bool SetupInProgress() const; |
| 241 bool WizardIsVisible() const { | 240 bool WizardIsVisible() const { |
| 242 return wizard_.IsVisible(); | 241 return wizard_.IsVisible(); |
| 243 } | 242 } |
| 244 | 243 |
| 245 SyncSetupWizard& get_wizard() { return wizard_; } | 244 SyncSetupWizard& get_wizard() { return wizard_; } |
| 246 | 245 |
| 247 // Shows the login screen of the Sync setup wizard. |web_ui| is the WebUI | 246 // Shows the login screen of the Sync setup wizard. |
| 248 // object for a current settings tab, NULL if one doesn't exist or the calling | 247 virtual void ShowLoginDialog(); |
| 249 // code doesn't know. | |
| 250 virtual void ShowLoginDialog(WebUI* web_ui); | |
| 251 | 248 |
| 252 // This method handles clicks on "sync error" UI, showing the appropriate | 249 // This method handles clicks on "sync error" UI, showing the appropriate |
| 253 // dialog for the error condition (relogin / enter passphrase). |web_ui| is | 250 // dialog for the error condition (relogin / enter passphrase). |
| 254 // the WebUI object for a current settings tab, NULL if one doesn't exist or | 251 virtual void ShowErrorUI(); |
| 255 // the calling code doesn't know. | |
| 256 virtual void ShowErrorUI(WebUI* web_ui); | |
| 257 | 252 |
| 258 // Shows the configure screen of the Sync setup wizard. If |sync_everything| | 253 // Shows the configure screen of the Sync setup wizard. If |sync_everything| |
| 259 // is true, shows the corresponding page in the customize screen; otherwise, | 254 // is true, shows the corresponding page in the customize screen; otherwise, |
| 260 // displays the page that gives the user the ability to select which data | 255 // displays the page that gives the user the ability to select which data |
| 261 // types to sync. |web_ui| is the WebUI object for a current settings tab, | 256 // types to sync. |
| 262 // NULL if one doesn't exist or the calling code doesn't know. | 257 void ShowConfigure(bool sync_everything); |
| 263 void ShowConfigure(WebUI* web_ui, bool sync_everything); | |
| 264 | 258 |
| 265 void PromptForExistingPassphrase(WebUI* web_ui); | 259 void PromptForExistingPassphrase(); |
| 266 | 260 |
| 267 void ShowSyncSetup(WebUI* web_ui, SyncSetupWizard::State state); | 261 void ShowSyncSetup(SyncSetupWizard::State state); |
| 268 | 262 |
| 269 // Pretty-printed strings for a given StatusSummary. | 263 // Pretty-printed strings for a given StatusSummary. |
| 270 static std::string BuildSyncStatusSummaryText( | 264 static std::string BuildSyncStatusSummaryText( |
| 271 const browser_sync::SyncBackendHost::StatusSummary& summary); | 265 const browser_sync::SyncBackendHost::StatusSummary& summary); |
| 272 | 266 |
| 273 // Returns true if the SyncBackendHost has told us it's ready to accept | 267 // Returns true if the SyncBackendHost has told us it's ready to accept |
| 274 // changes. | 268 // changes. |
| 275 // [REMARK] - it is safe to call this function only from the ui thread. | 269 // [REMARK] - it is safe to call this function only from the ui thread. |
| 276 // because the variable is not thread safe and should only be accessed from | 270 // because the variable is not thread safe and should only be accessed from |
| 277 // single thread. If we want multiple threads to access this(and there is | 271 // single thread. If we want multiple threads to access this(and there is |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // because we haven't finished initializing). Cleared when we successfully | 660 // because we haven't finished initializing). Cleared when we successfully |
| 667 // post a new encrypt task to the sync backend. | 661 // post a new encrypt task to the sync backend. |
| 668 syncable::ModelTypeSet pending_types_for_encryption_; | 662 syncable::ModelTypeSet pending_types_for_encryption_; |
| 669 | 663 |
| 670 scoped_ptr<browser_sync::BackendMigrator> migrator_; | 664 scoped_ptr<browser_sync::BackendMigrator> migrator_; |
| 671 | 665 |
| 672 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 666 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 673 }; | 667 }; |
| 674 | 668 |
| 675 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 669 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |