Chromium Code Reviews| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 | 517 |
| 518 // Add the specific dates that were searched to display them. | 518 // Add the specific dates that were searched to display them. |
| 519 // TODO(sergiu): Put today if the start is in the future. | 519 // TODO(sergiu): Put today if the start is in the future. |
| 520 results_info.SetString( | 520 results_info.SetString( |
| 521 "queryStartTime", | 521 "queryStartTime", |
| 522 GetRelativeDateLocalized(clock_.get(), query_results_info->start_time)); | 522 GetRelativeDateLocalized(clock_.get(), query_results_info->start_time)); |
| 523 results_info.SetString( | 523 results_info.SetString( |
| 524 "queryEndTime", | 524 "queryEndTime", |
| 525 GetRelativeDateLocalized(clock_.get(), query_results_info->end_time)); | 525 GetRelativeDateLocalized(clock_.get(), query_results_info->end_time)); |
| 526 | 526 |
| 527 results_info.SetString( | |
| 528 "queryStartMonth", | |
| 529 TimeFormatMonthAndYear(query_results_info->start_time)); | |
| 530 results_info.SetString( | |
| 531 "queryStartTimeShort", | |
| 532 TimeFormatWeekdayMonthAndDay(query_results_info->start_time)); | |
| 533 results_info.SetString( | |
| 534 "queryEndTimeShort", | |
| 535 TimeFormatWeekdayMonthAndDay(query_results_info->end_time)); | |
|
jungshik at Google
2016/12/16 09:08:38
Instead of concatenating two dates, it'd be better
calamity
2016/12/19 04:12:54
But this doesn't allow for a translated word separ
| |
| 536 | |
| 527 web_ui()->CallJavascriptFunctionUnsafe("historyResult", results_info, | 537 web_ui()->CallJavascriptFunctionUnsafe("historyResult", results_info, |
| 528 results_value); | 538 results_value); |
| 529 } | 539 } |
| 530 | 540 |
| 531 void BrowsingHistoryHandler::OnRemoveVisitsComplete() { | 541 void BrowsingHistoryHandler::OnRemoveVisitsComplete() { |
| 532 web_ui()->CallJavascriptFunctionUnsafe("deleteComplete"); | 542 web_ui()->CallJavascriptFunctionUnsafe("deleteComplete"); |
| 533 } | 543 } |
| 534 | 544 |
| 535 void BrowsingHistoryHandler::OnRemoveVisitsFailed() { | 545 void BrowsingHistoryHandler::OnRemoveVisitsFailed() { |
| 536 web_ui()->CallJavascriptFunctionUnsafe("deleteFailed"); | 546 web_ui()->CallJavascriptFunctionUnsafe("deleteFailed"); |
| 537 } | 547 } |
| 538 | 548 |
| 539 void BrowsingHistoryHandler::HistoryDeleted() { | 549 void BrowsingHistoryHandler::HistoryDeleted() { |
| 540 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); | 550 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); |
| 541 } | 551 } |
| 542 | 552 |
| 543 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( | 553 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( |
| 544 bool has_other_forms, | 554 bool has_other_forms, |
| 545 bool has_synced_results) { | 555 bool has_synced_results) { |
| 546 web_ui()->CallJavascriptFunctionUnsafe( | 556 web_ui()->CallJavascriptFunctionUnsafe( |
| 547 "showNotification", base::FundamentalValue(has_synced_results), | 557 "showNotification", base::FundamentalValue(has_synced_results), |
| 548 base::FundamentalValue(has_other_forms)); | 558 base::FundamentalValue(has_other_forms)); |
| 549 } | 559 } |
| OLD | NEW |