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

Side by Side Diff: chrome/browser/ui/webui/md_history_ui.cc

Issue 1643693003: MD History: Implement search functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch_to_be_uploaded
Patch Set: Fix time-gap-separator insertion. Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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/md_history_ui.h" 5 #include "chrome/browser/ui/webui/md_history_ui.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/webui/browsing_history_handler.h" 9 #include "chrome/browser/ui/webui/browsing_history_handler.h"
10 #include "chrome/browser/ui/webui/metrics_handler.h" 10 #include "chrome/browser/ui/webui/metrics_handler.h"
(...skipping 17 matching lines...) Expand all
28 28
29 namespace { 29 namespace {
30 30
31 content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) { 31 content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
32 PrefService* prefs = profile->GetPrefs(); 32 PrefService* prefs = profile->GetPrefs();
33 33
34 content::WebUIDataSource* source = 34 content::WebUIDataSource* source =
35 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); 35 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost);
36 36
37 // Localized strings (alphabetical order). 37 // Localized strings (alphabetical order).
38 source->AddLocalizedString("cancel", IDS_CANCEL);
38 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); 39 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH);
39 source->AddLocalizedString("cancel", IDS_CANCEL);
40 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); 40 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE);
41 source->AddLocalizedString("foundSearchResults",
42 IDS_HISTORY_FOUND_SEARCH_RESULTS);
41 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); 43 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED);
42 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); 44 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE);
45 source->AddLocalizedString("noResults", IDS_HISTORY_NO_RESULTS);
46 source->AddLocalizedString("noSearchResults", IDS_HISTORY_NO_SEARCH_RESULTS);
43 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); 47 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE);
44 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); 48 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH);
49 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT);
50 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS);
45 source->AddLocalizedString("title", IDS_HISTORY_TITLE); 51 source->AddLocalizedString("title", IDS_HISTORY_TITLE);
46 52
47 bool allow_deleting_history = 53 bool allow_deleting_history =
48 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); 54 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
49 source->AddBoolean("allowDeletingHistory", allow_deleting_history); 55 source->AddBoolean("allowDeletingHistory", allow_deleting_history);
50 56
51 source->AddResourcePath("history_card.html", 57 source->AddResourcePath("history_card.html",
52 IDR_MD_HISTORY_HISTORY_CARD_HTML); 58 IDR_MD_HISTORY_HISTORY_CARD_HTML);
53 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS); 59 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS);
54 source->AddResourcePath("history_card_manager.html", 60 source->AddResourcePath("history_card_manager.html",
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); 94 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile));
89 } 95 }
90 96
91 MdHistoryUI::~MdHistoryUI() {} 97 MdHistoryUI::~MdHistoryUI() {}
92 98
93 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 99 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
94 ui::ScaleFactor scale_factor) { 100 ui::ScaleFactor scale_factor) {
95 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 101 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
96 IDR_HISTORY_FAVICON, scale_factor); 102 IDR_HISTORY_FAVICON, scale_factor);
97 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698