| Index: chrome/browser/ui/webui/browsing_history_handler.cc
|
| diff --git a/chrome/browser/ui/webui/browsing_history_handler.cc b/chrome/browser/ui/webui/browsing_history_handler.cc
|
| index fbcdc981cd8b46c3676f316b8d8ec66d234b545e..7ff6ee9d04f47939cde92bb6d47038edc7755365 100644
|
| --- a/chrome/browser/ui/webui/browsing_history_handler.cc
|
| +++ b/chrome/browser/ui/webui/browsing_history_handler.cc
|
| @@ -234,10 +234,15 @@ scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue(
|
| // the monthly view.
|
| result->SetString("dateShort", base::TimeFormatShortDate(time));
|
|
|
| + base::string16 snippet_string;
|
| + base::string16 date_relative_day;
|
| + base::string16 date_time_of_day;
|
| +
|
| // Only pass in the strings we need (search results need a shortdate
|
| - // and snippet, browse results need day and time information).
|
| + // and snippet, browse results need day and time information). Makes sure that
|
| + // values of result are never undefined
|
| if (is_search_result) {
|
| - result->SetString("snippet", snippet);
|
| + snippet_string = snippet;
|
| } else {
|
| base::Time midnight = base::Time::Now().LocalMidnight();
|
| base::string16 date_str = ui::TimeFormat::RelativeDate(time, &midnight);
|
| @@ -249,10 +254,16 @@ scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue(
|
| date_str,
|
| base::TimeFormatFriendlyDate(time));
|
| }
|
| - result->SetString("dateRelativeDay", date_str);
|
| - result->SetString("dateTimeOfDay", base::TimeFormatTimeOfDay(time));
|
| + date_relative_day = date_str;
|
| + date_time_of_day = base::TimeFormatTimeOfDay(time);
|
| }
|
| +
|
| + result->SetString("dateTimeOfDay", date_time_of_day);
|
| + result->SetString("dateRelativeDay", date_relative_day);
|
| + result->SetString("snippet", snippet_string);
|
| result->SetBoolean("starred", bookmark_model->IsBookmarked(url));
|
| + result->SetInteger("hostFilteringBehavior", -1);
|
| + result->SetBoolean("blockedVisit", false);
|
|
|
| std::string device_name;
|
| std::string device_type;
|
| @@ -366,6 +377,10 @@ void BrowsingHistoryHandler::QueryHistory(
|
|
|
| history::WebHistoryService* web_history =
|
| WebHistoryServiceFactory::GetForProfile(profile);
|
| +
|
| + // Set this to false until the results actually arrive.
|
| + results_info_value_.SetBoolean("hasSyncedResults", false);
|
| +
|
| if (web_history) {
|
| web_history_query_results_.clear();
|
| web_history_request_ = web_history->QueryHistory(
|
| @@ -379,9 +394,6 @@ void BrowsingHistoryHandler::QueryHistory(
|
| web_history_timer_.Start(
|
| FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds),
|
| this, &BrowsingHistoryHandler::WebHistoryTimeout);
|
| -
|
| - // Set this to false until the results actually arrive.
|
| - results_info_value_.SetBoolean("hasSyncedResults", false);
|
| }
|
| }
|
|
|
|
|