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

Side by Side Diff: chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc

Issue 2590793004: MD Downloads: gzip vulcanized resources via compress="gzip" (Closed)
Patch Set: . Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_downloads/md_downloads_ui.h" 5 #include "chrome/browser/ui/webui/md_downloads/md_downloads_ui.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 source->AddResourcePath("1x/incognito_marker.png", 98 source->AddResourcePath("1x/incognito_marker.png",
99 IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG); 99 IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG);
100 source->AddResourcePath("2x/incognito_marker.png", 100 source->AddResourcePath("2x/incognito_marker.png",
101 IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG); 101 IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG);
102 source->AddResourcePath("1x/no_downloads.png", 102 source->AddResourcePath("1x/no_downloads.png",
103 IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG); 103 IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG);
104 source->AddResourcePath("2x/no_downloads.png", 104 source->AddResourcePath("2x/no_downloads.png",
105 IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG); 105 IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG);
106 106
107 #if BUILDFLAG(USE_VULCANIZE) 107 #if BUILDFLAG(USE_VULCANIZE)
108 std::unordered_set<std::string> exclude_from_gzip;
109 exclude_from_gzip.insert("1x/incognito_marker.png");
110 exclude_from_gzip.insert("2x/incognito_marker.png");
111 exclude_from_gzip.insert("1x/no_downloads.png");
112 exclude_from_gzip.insert("2x/no_downloads.png");
113 source->UseGzip(exclude_from_gzip);
114
108 source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS); 115 source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS);
109 source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML); 116 source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML);
110 #else 117 #else
111 source->AddResourcePath("action_service.html", 118 source->AddResourcePath("action_service.html",
112 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML); 119 IDR_MD_DOWNLOADS_ACTION_SERVICE_HTML);
113 source->AddResourcePath("action_service.js", 120 source->AddResourcePath("action_service.js",
114 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS); 121 IDR_MD_DOWNLOADS_ACTION_SERVICE_JS);
115 source->AddResourcePath("constants.html", IDR_MD_DOWNLOADS_CONSTANTS_HTML); 122 source->AddResourcePath("constants.html", IDR_MD_DOWNLOADS_CONSTANTS_HTML);
116 source->AddResourcePath("constants.js", IDR_MD_DOWNLOADS_CONSTANTS_JS); 123 source->AddResourcePath("constants.js", IDR_MD_DOWNLOADS_CONSTANTS_JS);
117 source->AddResourcePath("downloads.js", IDR_MD_DOWNLOADS_DOWNLOADS_JS); 124 source->AddResourcePath("downloads.js", IDR_MD_DOWNLOADS_DOWNLOADS_JS);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 ThemeSource* theme = new ThemeSource(profile); 160 ThemeSource* theme = new ThemeSource(profile);
154 content::URLDataSource::Add(profile, theme); 161 content::URLDataSource::Add(profile, theme);
155 } 162 }
156 163
157 // static 164 // static
158 base::RefCountedMemory* MdDownloadsUI::GetFaviconResourceBytes( 165 base::RefCountedMemory* MdDownloadsUI::GetFaviconResourceBytes(
159 ui::ScaleFactor scale_factor) { 166 ui::ScaleFactor scale_factor) {
160 return ResourceBundle::GetSharedInstance(). 167 return ResourceBundle::GetSharedInstance().
161 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor); 168 LoadDataResourceBytesForScale(IDR_DOWNLOADS_FAVICON, scale_factor);
162 } 169 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/invalidations_ui.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698