| 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 #include "chrome/browser/sync/sync_setup_flow.h" | 5 #include "chrome/browser/sync/sync_setup_flow.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // We don't own flow_handler_ anymore, but it sticks around until at least | 559 // We don't own flow_handler_ anymore, but it sticks around until at least |
| 560 // right after OnDialogClosed() is called (and this object is destroyed). | 560 // right after OnDialogClosed() is called (and this object is destroyed). |
| 561 owns_flow_handler_ = false; | 561 owns_flow_handler_ = false; |
| 562 } | 562 } |
| 563 | 563 |
| 564 // Returns true if the flow should advance to |state| based on |current_state_|. | 564 // Returns true if the flow should advance to |state| based on |current_state_|. |
| 565 bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) { | 565 bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) { |
| 566 switch (state) { | 566 switch (state) { |
| 567 case SyncSetupWizard::GAIA_LOGIN: | 567 case SyncSetupWizard::GAIA_LOGIN: |
| 568 return current_state_ == SyncSetupWizard::FATAL_ERROR || | 568 return current_state_ == SyncSetupWizard::FATAL_ERROR || |
| 569 current_state_ == SyncSetupWizard::GAIA_LOGIN; | 569 current_state_ == SyncSetupWizard::GAIA_LOGIN || |
| 570 current_state_ == SyncSetupWizard::SETTING_UP; |
| 570 case SyncSetupWizard::GAIA_SUCCESS: | 571 case SyncSetupWizard::GAIA_SUCCESS: |
| 571 return current_state_ == SyncSetupWizard::GAIA_LOGIN; | 572 return current_state_ == SyncSetupWizard::GAIA_LOGIN; |
| 572 case SyncSetupWizard::CONFIGURE: | 573 case SyncSetupWizard::CONFIGURE: |
| 573 return current_state_ == SyncSetupWizard::GAIA_SUCCESS; | 574 return current_state_ == SyncSetupWizard::GAIA_SUCCESS; |
| 574 case SyncSetupWizard::ENTER_PASSPHRASE: | 575 case SyncSetupWizard::ENTER_PASSPHRASE: |
| 575 return current_state_ == SyncSetupWizard::CONFIGURE || | 576 return current_state_ == SyncSetupWizard::CONFIGURE || |
| 576 current_state_ == SyncSetupWizard::SETTING_UP; | 577 current_state_ == SyncSetupWizard::SETTING_UP; |
| 577 case SyncSetupWizard::PASSPHRASE_MIGRATION: | 578 case SyncSetupWizard::PASSPHRASE_MIGRATION: |
| 578 return current_state_ == SyncSetupWizard::GAIA_LOGIN; | 579 return current_state_ == SyncSetupWizard::GAIA_LOGIN; |
| 579 case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR: | 580 case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR: |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 DisablePasswordSync(service_); | 778 DisablePasswordSync(service_); |
| 778 } else if (option == "google") { | 779 } else if (option == "google") { |
| 779 // Implicit passphrase already set up. | 780 // Implicit passphrase already set up. |
| 780 Advance(SyncSetupWizard::DONE); | 781 Advance(SyncSetupWizard::DONE); |
| 781 } | 782 } |
| 782 } | 783 } |
| 783 | 784 |
| 784 void SyncSetupFlow::OnGoToDashboard() { | 785 void SyncSetupFlow::OnGoToDashboard() { |
| 785 BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); | 786 BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); |
| 786 } | 787 } |
| OLD | NEW |