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

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

Issue 1607403004: MD History: Display synced tabs history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@second_patch
Patch Set: Changed switching between pages & addressed comments 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("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH);
40 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); 41 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE);
41 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); 42 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED);
42 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); 43 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE);
44 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE);
45 source->AddLocalizedString("openAll", IDS_HISTORY_OTHER_SESSIONS_OPEN_ALL);
43 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); 46 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE);
47 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE);
48 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH);
44 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); 49 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH);
45 source->AddLocalizedString("title", IDS_HISTORY_TITLE); 50 source->AddLocalizedString("title", IDS_HISTORY_TITLE);
46 51
47 bool allow_deleting_history = 52 bool allow_deleting_history =
48 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); 53 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
49 source->AddBoolean("allowDeletingHistory", allow_deleting_history); 54 source->AddBoolean("allowDeletingHistory", allow_deleting_history);
50 55
51 source->AddResourcePath("history_card.html", 56 source->AddResourcePath("history_card.html",
52 IDR_MD_HISTORY_HISTORY_CARD_HTML); 57 IDR_MD_HISTORY_HISTORY_CARD_HTML);
53 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS); 58 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS);
54 source->AddResourcePath("history_card_manager.html", 59 source->AddResourcePath("history_card_manager.html",
55 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_HTML); 60 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_HTML);
56 source->AddResourcePath("history_card_manager.js", 61 source->AddResourcePath("history_card_manager.js",
57 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_JS); 62 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_JS);
58 source->AddResourcePath("history_item.html", 63 source->AddResourcePath("history_item.html",
59 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 64 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
60 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 65 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
61 source->AddResourcePath("history_toolbar.html", 66 source->AddResourcePath("history_toolbar.html",
62 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 67 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
63 source->AddResourcePath("history_toolbar.js", 68 source->AddResourcePath("history_toolbar.js",
64 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 69 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
65 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); 70 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS);
71 source->AddResourcePath("shared_style.html",
72 IDR_MD_HISTORY_SHARED_STYLE_HTML);
73 source->AddResourcePath("side_bar.html", IDR_MD_HISTORY_SIDE_BAR_HTML);
74 source->AddResourcePath("side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS);
75 source->AddResourcePath("synced_device_card.html",
76 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_HTML);
77 source->AddResourcePath("synced_device_card.js",
78 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_JS);
79 source->AddResourcePath("synced_device_manager.html",
80 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_HTML);
81 source->AddResourcePath("synced_device_manager.js",
82 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_JS);
66 83
67 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); 84 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML);
68 source->SetJsonPath("strings.js"); 85 source->SetJsonPath("strings.js");
69 86
70 return source; 87 return source;
71 } 88 }
72 89
73 } // namespace 90 } // namespace
74 91
75 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { 92 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
(...skipping 12 matching lines...) Expand all
88 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); 105 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile));
89 } 106 }
90 107
91 MdHistoryUI::~MdHistoryUI() {} 108 MdHistoryUI::~MdHistoryUI() {}
92 109
93 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 110 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
94 ui::ScaleFactor scale_factor) { 111 ui::ScaleFactor scale_factor) {
95 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 112 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
96 IDR_HISTORY_FAVICON, scale_factor); 113 IDR_HISTORY_FAVICON, scale_factor);
97 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698