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

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: format 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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("app.html", IDR_MD_HISTORY_APP_HTML); 61 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
62 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); 62 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
63 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML); 63 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML);
64 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS); 64 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS);
65 source->AddResourcePath("history_icons.html",
66 IDR_MD_HISTORY_HISTORY_ICONS_HTML);
65 source->AddResourcePath("history_item.html", 67 source->AddResourcePath("history_item.html",
66 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 68 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
67 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 69 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
68 source->AddResourcePath("history_list.html", 70 source->AddResourcePath("history_list.html",
69 IDR_MD_HISTORY_HISTORY_LIST_HTML); 71 IDR_MD_HISTORY_HISTORY_LIST_HTML);
70 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); 72 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
71 source->AddResourcePath("history_toolbar.html", 73 source->AddResourcePath("history_toolbar.html",
72 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 74 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
73 source->AddResourcePath("history_toolbar.js", 75 source->AddResourcePath("history_toolbar.js",
74 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 76 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); 109 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile));
108 } 110 }
109 111
110 MdHistoryUI::~MdHistoryUI() {} 112 MdHistoryUI::~MdHistoryUI() {}
111 113
112 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 114 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
113 ui::ScaleFactor scale_factor) { 115 ui::ScaleFactor scale_factor) {
114 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 116 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
115 IDR_HISTORY_FAVICON, scale_factor); 117 IDR_HISTORY_FAVICON, scale_factor);
116 } 118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698