| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ |
| 6 #define COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ | 6 #define COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/task/cancelable_task_tracker.h" | 12 #include "base/task/cancelable_task_tracker.h" |
| 13 | 13 |
| 14 namespace history { | 14 namespace history { |
| 15 class HistoryService; | 15 class HistoryService; |
| 16 class QueryResults; | 16 class QueryResults; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace sync_driver { | 19 namespace browser_sync { |
| 20 | 20 |
| 21 // Helper class for sync signin to check some asynchronous conditions. Call | 21 // Helper class for sync signin to check some asynchronous conditions. Call |
| 22 // either CheckHasHistory or CheckHasTypedUrls or both, and |return_result| | 22 // either CheckHasHistory or CheckHasTypedUrls or both, and |return_result| |
| 23 // will be called with true if either returns true, otherwise false. | 23 // will be called with true if either returns true, otherwise false. |
| 24 class SigninConfirmationHelper { | 24 class SigninConfirmationHelper { |
| 25 public: | 25 public: |
| 26 SigninConfirmationHelper(history::HistoryService* history_service, | 26 SigninConfirmationHelper(history::HistoryService* history_service, |
| 27 const base::Callback<void(bool)>& return_result); | 27 const base::Callback<void(bool)>& return_result); |
| 28 | 28 |
| 29 // This helper checks if there are history entries in the history service. | 29 // This helper checks if there are history entries in the history service. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 | 58 |
| 59 // Keep track of how many async requests are pending. | 59 // Keep track of how many async requests are pending. |
| 60 int pending_requests_; | 60 int pending_requests_; |
| 61 | 61 |
| 62 // Callback to pass the result back to the caller. | 62 // Callback to pass the result back to the caller. |
| 63 const base::Callback<void(bool)> return_result_; | 63 const base::Callback<void(bool)> return_result_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(SigninConfirmationHelper); | 65 DISALLOW_COPY_AND_ASSIGN(SigninConfirmationHelper); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace sync_driver | 68 } // namespace browser_sync |
| 69 | 69 |
| 70 #endif // COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ | 70 #endif // COMPONENTS_BROWSER_SYNC_SIGNIN_CONFIRMATION_HELPER_H_ |
| OLD | NEW |