OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/backup_rollback_controller.h" | 5 #include "chrome/browser/sync/backup_rollback_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" | 10 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 weak_ptr_factory_(this) { | 34 weak_ptr_factory_(this) { |
35 } | 35 } |
36 | 36 |
37 BackupRollbackController::~BackupRollbackController() { | 37 BackupRollbackController::~BackupRollbackController() { |
38 } | 38 } |
39 | 39 |
40 void BackupRollbackController::Start(base::TimeDelta delay) { | 40 void BackupRollbackController::Start(base::TimeDelta delay) { |
41 if (!IsBackupEnabled()) | 41 if (!IsBackupEnabled()) |
42 return; | 42 return; |
43 | 43 |
44 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 44 if (CommandLine::ForCurrentProcess()->HasSwitch( |
45 switches::kSyncEnableRollback)) { | 45 switches::kSyncDisableRollback)) { |
46 sync_prefs_->SetRemainingRollbackTries(0); | 46 sync_prefs_->SetRemainingRollbackTries(0); |
47 } | 47 } |
48 | 48 |
49 if (delay == base::TimeDelta()) { | 49 if (delay == base::TimeDelta()) { |
50 TryStart(); | 50 TryStart(); |
51 } else { | 51 } else { |
52 base::MessageLoop::current()->PostDelayedTask( | 52 base::MessageLoop::current()->PostDelayedTask( |
53 FROM_HERE, | 53 FROM_HERE, |
54 base::Bind(&BackupRollbackController::TryStart, | 54 base::Bind(&BackupRollbackController::TryStart, |
55 weak_ptr_factory_.GetWeakPtr()), | 55 weak_ptr_factory_.GetWeakPtr()), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 group_name == kSyncBackupFinchDisabled) { | 97 group_name == kSyncBackupFinchDisabled) { |
98 return false; | 98 return false; |
99 } | 99 } |
100 return true; | 100 return true; |
101 #else | 101 #else |
102 return false; | 102 return false; |
103 #endif | 103 #endif |
104 } | 104 } |
105 | 105 |
106 } // namespace browser_sync | 106 } // namespace browser_sync |
OLD | NEW |