Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: components/browser_sync/browser/signin_confirmation_helper.h

Issue 2345843003: [Sync] Merge //components/browser_sync into one directory. (Closed)
Patch Set: Address comment + rebase. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/browser_sync/browser/signin_confirmation_helper.h
diff --git a/components/browser_sync/browser/signin_confirmation_helper.h b/components/browser_sync/browser/signin_confirmation_helper.h
deleted file mode 100644
index fd0e7d4393c82c4e2e56d49ec5aee277ca1c0f76..0000000000000000000000000000000000000000
--- a/components/browser_sync/browser/signin_confirmation_helper.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_BROWSER_SYNC_BROWSER_SIGNIN_CONFIRMATION_HELPER_
-#define COMPONENTS_BROWSER_SYNC_BROWSER_SIGNIN_CONFIRMATION_HELPER_
-
-#include <stddef.h>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/task/cancelable_task_tracker.h"
-
-namespace history {
-class HistoryService;
-class QueryResults;
-}
-
-namespace sync_driver {
-
-// Helper class for sync signin to check some asynchronous conditions. Call
-// either CheckHasHistory or CheckHasTypedUrls or both, and |return_result|
-// will be called with true if either returns true, otherwise false.
-class SigninConfirmationHelper {
- public:
- SigninConfirmationHelper(history::HistoryService* history_service,
- const base::Callback<void(bool)>& return_result);
-
- // This helper checks if there are history entries in the history service.
- void CheckHasHistory(int max_entries);
-
- // This helper checks if there are typed URLs in the history service.
- void CheckHasTypedURLs();
-
- private:
- // Deletes itself.
- ~SigninConfirmationHelper();
-
- // Callback helper function for CheckHasHistory.
- void OnHistoryQueryResults(size_t max_entries,
- history::QueryResults* results);
-
- // Posts the given result to the origin thread.
- void PostResult(bool result);
-
- // Calls |return_result_| if |result| == true or if it's the result of the
- // last pending check.
- void ReturnResult(bool result);
-
- // The task runner for the thread this object was constructed on.
- const scoped_refptr<base::SingleThreadTaskRunner> origin_thread_;
-
- // Pointer to the history service.
- history::HistoryService* history_service_;
-
- // Used for async tasks.
- base::CancelableTaskTracker task_tracker_;
-
- // Keep track of how many async requests are pending.
- int pending_requests_;
-
- // Callback to pass the result back to the caller.
- const base::Callback<void(bool)> return_result_;
-
- DISALLOW_COPY_AND_ASSIGN(SigninConfirmationHelper);
-};
-
-} // namespace sync_driver
-
-#endif // COMPONENTS_BROWSER_SYNC_BROWSER_SIGNIN_CONFIRMATION_HELPER_

Powered by Google App Engine
This is Rietveld 408576698