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

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

Issue 2235593002: Vulcanize MD History (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chrome/browser/resources/vulcanize_readme.md ('k') | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 source->AddBoolean("groupByDomain", group_by_domain); 107 source->AddBoolean("groupByDomain", group_by_domain);
108 108
109 source->AddBoolean("isGuestSession", profile->IsGuestSession()); 109 source->AddBoolean("isGuestSession", profile->IsGuestSession());
110 110
111 SigninManagerBase* signin_manager = 111 SigninManagerBase* signin_manager =
112 SigninManagerFactory::GetForProfile(profile); 112 SigninManagerFactory::GetForProfile(profile);
113 bool is_authenticated = signin_manager != nullptr && 113 bool is_authenticated = signin_manager != nullptr &&
114 signin_manager->IsAuthenticated(); 114 signin_manager->IsAuthenticated();
115 source->AddBoolean("isUserSignedIn", is_authenticated); 115 source->AddBoolean("isUserSignedIn", is_authenticated);
116 116
117 #if BUILDFLAG(USE_VULCANIZE)
118 source->AddResourcePath("crisper.js", IDR_MD_HISTORY_CRISPER_JS);
119 source->SetDefaultResource(IDR_MD_HISTORY_VULCANIZED_HTML);
120 #else
117 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML); 121 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
118 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); 122 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
119 source->AddResourcePath("browser_service.html", 123 source->AddResourcePath("browser_service.html",
120 IDR_MD_HISTORY_BROWSER_SERVICE_HTML); 124 IDR_MD_HISTORY_BROWSER_SERVICE_HTML);
121 source->AddResourcePath("browser_service.js", 125 source->AddResourcePath("browser_service.js",
122 IDR_MD_HISTORY_BROWSER_SERVICE_JS); 126 IDR_MD_HISTORY_BROWSER_SERVICE_JS);
123 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML); 127 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML);
124 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS); 128 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS);
125 source->AddResourcePath("grouped_list.html", 129 source->AddResourcePath("grouped_list.html",
126 IDR_MD_HISTORY_GROUPED_LIST_HTML); 130 IDR_MD_HISTORY_GROUPED_LIST_HTML);
127 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS); 131 source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS);
128 source->AddResourcePath("history_item.html", 132 source->AddResourcePath("history_item.html",
129 IDR_MD_HISTORY_HISTORY_ITEM_HTML); 133 IDR_MD_HISTORY_HISTORY_ITEM_HTML);
130 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); 134 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
131 source->AddResourcePath("history_list.html", 135 source->AddResourcePath("history_list.html",
132 IDR_MD_HISTORY_HISTORY_LIST_HTML); 136 IDR_MD_HISTORY_HISTORY_LIST_HTML);
133 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); 137 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
134 source->AddResourcePath("history_toolbar.html", 138 source->AddResourcePath("history_toolbar.html",
135 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); 139 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
136 source->AddResourcePath("history_toolbar.js", 140 source->AddResourcePath("history_toolbar.js",
137 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); 141 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
138 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); 142 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS);
139 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML); 143 source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML);
140 source->AddResourcePath("images/100/sign_in_promo.png",
141 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG);
142 source->AddResourcePath("images/200/sign_in_promo.png",
143 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG);
144 source->AddResourcePath("list_container.html", 144 source->AddResourcePath("list_container.html",
145 IDR_MD_HISTORY_LIST_CONTAINER_HTML); 145 IDR_MD_HISTORY_LIST_CONTAINER_HTML);
146 source->AddResourcePath("list_container.js", 146 source->AddResourcePath("list_container.js",
147 IDR_MD_HISTORY_LIST_CONTAINER_JS); 147 IDR_MD_HISTORY_LIST_CONTAINER_JS);
148 source->AddResourcePath("searched_label.html", 148 source->AddResourcePath("searched_label.html",
149 IDR_MD_HISTORY_SEARCHED_LABEL_HTML); 149 IDR_MD_HISTORY_SEARCHED_LABEL_HTML);
150 source->AddResourcePath("searched_label.js", 150 source->AddResourcePath("searched_label.js",
151 IDR_MD_HISTORY_SEARCHED_LABEL_JS); 151 IDR_MD_HISTORY_SEARCHED_LABEL_JS);
152 source->AddResourcePath("shared_style.html", 152 source->AddResourcePath("shared_style.html",
153 IDR_MD_HISTORY_SHARED_STYLE_HTML); 153 IDR_MD_HISTORY_SHARED_STYLE_HTML);
154 source->AddResourcePath("side_bar.html", IDR_MD_HISTORY_SIDE_BAR_HTML); 154 source->AddResourcePath("side_bar.html", IDR_MD_HISTORY_SIDE_BAR_HTML);
155 source->AddResourcePath("side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS); 155 source->AddResourcePath("side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS);
156 source->AddResourcePath("synced_device_card.html", 156 source->AddResourcePath("synced_device_card.html",
157 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_HTML); 157 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_HTML);
158 source->AddResourcePath("synced_device_card.js", 158 source->AddResourcePath("synced_device_card.js",
159 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_JS); 159 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_JS);
160 source->AddResourcePath("synced_device_manager.html", 160 source->AddResourcePath("synced_device_manager.html",
161 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_HTML); 161 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_HTML);
162 source->AddResourcePath("synced_device_manager.js", 162 source->AddResourcePath("synced_device_manager.js",
163 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_JS); 163 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_JS);
164 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML);
165 #endif
164 166
165 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); 167 source->AddResourcePath("images/100/sign_in_promo.png",
168 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG);
169 source->AddResourcePath("images/200/sign_in_promo.png",
170 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG);
171
166 source->SetJsonPath("strings.js"); 172 source->SetJsonPath("strings.js");
167 173
168 return source; 174 return source;
169 } 175 }
170 176
171 } // namespace 177 } // namespace
172 178
173 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { 179 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
174 Profile* profile = Profile::FromWebUI(web_ui); 180 Profile* profile = Profile::FromWebUI(web_ui);
175 web_ui->AddMessageHandler(new BrowsingHistoryHandler()); 181 web_ui->AddMessageHandler(new BrowsingHistoryHandler());
(...skipping 27 matching lines...) Expand all
203 base::FeatureList::ClearInstanceForTesting(); 209 base::FeatureList::ClearInstanceForTesting();
204 base::FeatureList::SetInstance(std::move(feature_list)); 210 base::FeatureList::SetInstance(std::move(feature_list));
205 } 211 }
206 212
207 // static 213 // static
208 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( 214 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
209 ui::ScaleFactor scale_factor) { 215 ui::ScaleFactor scale_factor) {
210 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 216 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
211 IDR_HISTORY_FAVICON, scale_factor); 217 IDR_HISTORY_FAVICON, scale_factor);
212 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/vulcanize_readme.md ('k') | third_party/polymer/v1_0/reproduce.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698