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

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

Issue 1928243002: MD History: Only load needed paper-icon-buttons instead of whole set of icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change cr_search_field icons Created 4 years, 7 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/foreign_session_handler.h" 10 #include "chrome/browser/ui/webui/foreign_session_handler.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT); 54 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT);
55 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS); 55 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS);
56 source->AddLocalizedString("title", IDS_HISTORY_TITLE); 56 source->AddLocalizedString("title", IDS_HISTORY_TITLE);
57 57
58 bool allow_deleting_history = 58 bool allow_deleting_history =
59 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); 59 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
60 source->AddBoolean("allowDeletingHistory", allow_deleting_history); 60 source->AddBoolean("allowDeletingHistory", allow_deleting_history);
61 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML); 61 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML);
62 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS); 62 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS);
63 source->AddResourcePath("elements.html", IDR_MD_HISTORY_ELEMENTS_HTML); 63 source->AddResourcePath("elements.html", IDR_MD_HISTORY_ELEMENTS_HTML);
64 source->AddResourcePath("history_icons.html",
65 IDR_MD_HISTORY_HISTORY_ICONS_HTML);
64 source->AddResourcePath("history_item.html", 66 source->AddResourcePath("history_item.html",
65 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 67 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
66 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 68 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
67 source->AddResourcePath("history_list.html", 69 source->AddResourcePath("history_list.html",
68 IDR_MD_HISTORY_HISTORY_LIST_HTML); 70 IDR_MD_HISTORY_HISTORY_LIST_HTML);
69 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); 71 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
70 source->AddResourcePath("history_toolbar.html", 72 source->AddResourcePath("history_toolbar.html",
71 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 73 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
72 source->AddResourcePath("history_toolbar.js", 74 source->AddResourcePath("history_toolbar.js",
73 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 75 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); 108 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile));
107 } 109 }
108 110
109 MdHistoryUI::~MdHistoryUI() {} 111 MdHistoryUI::~MdHistoryUI() {}
110 112
111 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 113 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
112 ui::ScaleFactor scale_factor) { 114 ui::ScaleFactor scale_factor) {
113 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 115 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
114 IDR_HISTORY_FAVICON, scale_factor); 116 IDR_HISTORY_FAVICON, scale_factor);
115 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698