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

Unified Diff: ios/chrome/browser/ui/history/history_service_facade.mm

Issue 2589313002: [ios] Wait for sync query to return before displaying history (Closed)
Patch Set: Use item types! Created 4 years 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
« no previous file with comments | « ios/chrome/browser/ui/history/history_service_facade.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/history/history_service_facade.mm
diff --git a/ios/chrome/browser/ui/history/history_service_facade.mm b/ios/chrome/browser/ui/history/history_service_facade.mm
index 7f68582219adde88b4956dd3ab221d4cbb0fcc58..caea37d78662c536d2a16a022ec1f0de45fc2868 100644
--- a/ios/chrome/browser/ui/history/history_service_facade.mm
+++ b/ios/chrome/browser/ui/history/history_service_facade.mm
@@ -78,6 +78,7 @@ HistoryServiceFacade::QueryResult::QueryResult()
query_start_time(base::string16()),
query_end_time(base::string16()),
finished(false),
+ sync_returned(false),
has_synced_results(false),
sync_finished(false),
entries(std::vector<history::HistoryEntry>()) {}
@@ -140,18 +141,6 @@ void HistoryServiceFacade::QueryHistory(const base::string16& search_text,
query_results_.clear();
results_info_value_ = QueryResult();
- // Query local history.
- history::HistoryService* history_service =
- ios::HistoryServiceFactory::GetForBrowserState(
- browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
- if (history_service) {
- history_service->QueryHistory(
- search_text, options,
- base::Bind(&HistoryServiceFacade::QueryComplete, base::Unretained(this),
- search_text, options),
- &query_task_tracker_);
- }
-
// Query synced history.
history::WebHistoryService* web_history =
ios::WebHistoryServiceFactory::GetForBrowserState(browser_state_);
@@ -167,6 +156,18 @@ void HistoryServiceFacade::QueryHistory(const base::string16& search_text,
FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds),
this, &HistoryServiceFacade::WebHistoryTimeout);
}
+
+ // Query local history.
+ history::HistoryService* history_service =
+ ios::HistoryServiceFactory::GetForBrowserState(
+ browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
+ if (history_service) {
+ history_service->QueryHistory(
+ search_text, options,
+ base::Bind(&HistoryServiceFacade::QueryComplete, base::Unretained(this),
+ search_text, options),
+ &query_task_tracker_);
+ }
}
void HistoryServiceFacade::RemoveHistoryEntries(
@@ -374,6 +375,7 @@ void HistoryServiceFacade::WebHistoryQueryComplete(
}
results_info_value_.has_synced_results = results_value != NULL;
+ results_info_value_.sync_returned = true;
if (results_value) {
std::string continuation_token;
results_value->GetString("continuation_token", &continuation_token);
« no previous file with comments | « ios/chrome/browser/ui/history/history_service_facade.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698