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

Unified Diff: chrome/browser/ui/webui/browsing_history_handler.cc

Issue 1654703002: Revert of MD History: Add basic material design history cards and history items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « chrome/browser/resources/md_history/history_item.js ('k') | ui/webui/resources/js/cr/ui/position_util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9747f162515802805283d16a4bbd6901426cd5dc..fbcdc981cd8b46c3676f316b8d8ec66d234b545e 100644
--- a/chrome/browser/ui/webui/browsing_history_handler.cc
+++ b/chrome/browser/ui/webui/browsing_history_handler.cc
@@ -234,17 +234,10 @@
// the monthly view.
result->SetString("dateShort", base::TimeFormatShortDate(time));
- base::string16 snippet_string;
- base::string16 date_relative_day;
- base::string16 date_time_of_day;
- bool is_blocked_visit = false;
- int host_filtering_behavior = -1;
-
// Only pass in the strings we need (search results need a shortdate
- // and snippet, browse results need day and time information). Makes sure that
- // values of result are never undefined
+ // and snippet, browse results need day and time information).
if (is_search_result) {
- snippet_string = snippet;
+ result->SetString("snippet", snippet);
} else {
base::Time midnight = base::Time::Now().LocalMidnight();
base::string16 date_str = ui::TimeFormat::RelativeDate(time, &midnight);
@@ -256,9 +249,10 @@
date_str,
base::TimeFormatFriendlyDate(time));
}
- date_relative_day = date_str;
- date_time_of_day = base::TimeFormatTimeOfDay(time);
- }
+ result->SetString("dateRelativeDay", date_str);
+ result->SetString("dateTimeOfDay", base::TimeFormatTimeOfDay(time));
+ }
+ result->SetBoolean("starred", bookmark_model->IsBookmarked(url));
std::string device_name;
std::string device_type;
@@ -273,17 +267,11 @@
supervised_user_service->GetURLFilterForUIThread();
int filtering_behavior =
url_filter->GetFilteringBehaviorForURL(url.GetWithEmptyPath());
- is_blocked_visit = blocked_visit;
- host_filtering_behavior = filtering_behavior;
+ result->SetInteger("hostFilteringBehavior", filtering_behavior);
+
+ result->SetBoolean("blockedVisit", blocked_visit);
}
#endif
-
- 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", host_filtering_behavior);
- result->SetBoolean("blockedVisit", is_blocked_visit);
return result;
}
@@ -378,10 +366,6 @@
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(
@@ -395,6 +379,9 @@
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);
}
}
« no previous file with comments | « chrome/browser/resources/md_history/history_item.js ('k') | ui/webui/resources/js/cr/ui/position_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698