| 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 #include "chrome/browser/ui/webui/browsing_history_handler.h" | 5 #include "chrome/browser/ui/webui/browsing_history_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 base::UTF16ToASCII(favicon::GetFallbackIconText(entry->url))); | 187 base::UTF16ToASCII(favicon::GetFallbackIconText(entry->url))); |
| 188 | 188 |
| 189 result->SetDouble("time", entry->time.ToJsTime()); | 189 result->SetDouble("time", entry->time.ToJsTime()); |
| 190 | 190 |
| 191 // Pass the timestamps in a list. | 191 // Pass the timestamps in a list. |
| 192 std::unique_ptr<base::ListValue> timestamps(new base::ListValue); | 192 std::unique_ptr<base::ListValue> timestamps(new base::ListValue); |
| 193 for (std::set<int64_t>::const_iterator it = entry->all_timestamps.begin(); | 193 for (std::set<int64_t>::const_iterator it = entry->all_timestamps.begin(); |
| 194 it != entry->all_timestamps.end(); ++it) { | 194 it != entry->all_timestamps.end(); ++it) { |
| 195 timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime()); | 195 timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime()); |
| 196 } | 196 } |
| 197 result->Set("allTimestamps", timestamps.release()); | 197 result->Set("allTimestamps", std::move(timestamps)); |
| 198 | 198 |
| 199 // Always pass the short date since it is needed both in the search and in | 199 // Always pass the short date since it is needed both in the search and in |
| 200 // the monthly view. | 200 // the monthly view. |
| 201 result->SetString("dateShort", base::TimeFormatShortDate(entry->time)); | 201 result->SetString("dateShort", base::TimeFormatShortDate(entry->time)); |
| 202 | 202 |
| 203 base::string16 snippet_string; | 203 base::string16 snippet_string; |
| 204 base::string16 date_relative_day; | 204 base::string16 date_relative_day; |
| 205 base::string16 date_time_of_day; | 205 base::string16 date_time_of_day; |
| 206 bool is_blocked_visit = false; | 206 bool is_blocked_visit = false; |
| 207 int host_filtering_behavior = -1; | 207 int host_filtering_behavior = -1; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); | 551 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); |
| 552 } | 552 } |
| 553 | 553 |
| 554 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( | 554 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( |
| 555 bool has_other_forms, | 555 bool has_other_forms, |
| 556 bool has_synced_results) { | 556 bool has_synced_results) { |
| 557 web_ui()->CallJavascriptFunctionUnsafe("showNotification", | 557 web_ui()->CallJavascriptFunctionUnsafe("showNotification", |
| 558 base::Value(has_synced_results), | 558 base::Value(has_synced_results), |
| 559 base::Value(has_other_forms)); | 559 base::Value(has_other_forms)); |
| 560 } | 560 } |
| OLD | NEW |