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

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

Issue 2318643003: MD History: truncate title to 300 chars in C++ instead of JS (Closed)
Patch Set: more !android Created 4 years, 3 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/ui/webui/browsing_history_handler.h
diff --git a/chrome/browser/ui/webui/browsing_history_handler.h b/chrome/browser/ui/webui/browsing_history_handler.h
index 74ce76a903ce9dcd8a98dc24edbb643c65a39560..5e6924989571e793398a72f5faecd83e067a9e5b 100644
--- a/chrome/browser/ui/webui/browsing_history_handler.h
+++ b/chrome/browser/ui/webui/browsing_history_handler.h
@@ -70,13 +70,15 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
virtual ~HistoryEntry();
// Formats this entry's URL and title and adds them to |result|.
- void SetUrlAndTitle(base::DictionaryValue* result) const;
+ void SetUrlAndTitle(base::DictionaryValue* result,
+ bool limit_title_length) const;
// Converts the entry to a DictionaryValue to be owned by the caller.
std::unique_ptr<base::DictionaryValue> ToValue(
bookmarks::BookmarkModel* bookmark_model,
SupervisedUserService* supervised_user_service,
- const ProfileSyncService* sync_service) const;
+ const ProfileSyncService* sync_service,
+ bool limit_title_length) const;
// Comparison function for sorting HistoryEntries from newest to oldest.
static bool SortByTimeDescending(
@@ -135,6 +137,13 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
static void MergeDuplicateResults(
std::vector<BrowsingHistoryHandler::HistoryEntry>* results);
+ protected:
+ // Callback from the history system when a history query has completed.
+ // Exposed for testing.
+ void QueryComplete(const base::string16& search_text,
+ const history::QueryOptions& options,
+ history::QueryResults* results);
+
private:
// The range for which to return results:
// - ALLTIME: allows access to all the results in a paginated way.
@@ -158,11 +167,6 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// not been received in time.
void WebHistoryTimeout();
- // Callback from the history system when a history query has completed.
- void QueryComplete(const base::string16& search_text,
- const history::QueryOptions& options,
- history::QueryResults* results);
-
// Callback from the WebHistoryService when a query has completed.
void WebHistoryQueryComplete(const base::string16& search_text,
const history::QueryOptions& options,
« no previous file with comments | « chrome/browser/ui/find_bar/find_bar_host_browsertest.cc ('k') | chrome/browser/ui/webui/browsing_history_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698