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

Unified Diff: chrome/browser/dom_ui/history_ui.cc

Issue 43054: Stop history search going on beyond the start of history.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
Index: chrome/browser/dom_ui/history_ui.cc
===================================================================
--- chrome/browser/dom_ui/history_ui.cc (revision 11260)
+++ chrome/browser/dom_ui/history_ui.cc (working copy)
@@ -76,6 +76,10 @@
localized_strings.SetString(L"deletedaywarning",
l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING));
+ localized_strings.SetString(L"textdirection",
+ (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ?
+ L"rtl" : L"ltr");
+
static const StringPiece history_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_HISTORY_HTML));
@@ -101,9 +105,9 @@
dom_ui_->RegisterMessageCallback("getHistory",
NewCallback(this, &BrowsingHistoryHandler::HandleGetHistory));
dom_ui_->RegisterMessageCallback("searchHistory",
- NewCallback(this, &BrowsingHistoryHandler::HandleSearchHistory));
+ NewCallback(this, &BrowsingHistoryHandler::HandleSearchHistory));
dom_ui_->RegisterMessageCallback("deleteDay",
- NewCallback(this, &BrowsingHistoryHandler::HandleDeleteDay));
+ NewCallback(this, &BrowsingHistoryHandler::HandleDeleteDay));
// Create our favicon data source.
g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
@@ -143,6 +147,9 @@
options.end_time = Time::Now().LocalMidnight();
options.end_time -= TimeDelta::FromDays(day - 1);
+ // As we're querying per-day, we can turn entry repeats off.
+ options.most_recent_visit_only = true;
+
// Need to remember the query string for our results.
search_text_ = std::wstring();
@@ -259,8 +266,11 @@
results_value.Append(page_value);
}
- StringValue temp(search_text_);
- dom_ui_->CallJavascriptFunction(L"historyResult", temp, results_value);
+ DictionaryValue info_value;
+ info_value.SetString(L"term", search_text_);
+ info_value.SetBoolean(L"finished", results->reached_beginning());
+
+ dom_ui_->CallJavascriptFunction(L"historyResult", info_value, results_value);
}
void BrowsingHistoryHandler::ExtractSearchHistoryArguments(const Value* value,
@@ -342,8 +352,8 @@
return;
}
- // Some URLs were deleted from history. Reload the most visited list.
- HandleGetHistory(NULL);
+ // Some URLs were deleted from history. Reload the list.
+ dom_ui_->CallJavascriptFunction(L"historyDeleted");
}
////////////////////////////////////////////////////////////////////////////////
@@ -377,7 +387,7 @@
// static
const GURL HistoryUI::GetHistoryURLWithSearchText(
- const std::wstring& text) {
- return GURL(GetBaseURL().spec() + "#q=" +
+ const std::wstring& text) {
+ return GURL(GetBaseURL().spec() + "#q=" +
EscapeQueryParamValue(WideToUTF8(text)));
}

Powered by Google App Engine
This is Rietveld 408576698