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

Side by Side Diff: chrome/browser/ui/webui/invalidations_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/invalidations_ui.h" 5 #include "chrome/browser/ui/webui/invalidations_ui.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/webui/invalidations_message_handler.h" 8 #include "chrome/browser/ui/webui/invalidations_message_handler.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/grit/invalidations_resources.h" 10 #include "chrome/grit/invalidations_resources.h"
11 #include "content/public/browser/web_ui.h" 11 #include "content/public/browser/web_ui.h"
12 #include "content/public/browser/web_ui_data_source.h" 12 #include "content/public/browser/web_ui_data_source.h"
13 #include "content/public/browser/web_ui_message_handler.h" 13 #include "content/public/browser/web_ui_message_handler.h"
14 14
15 content::WebUIDataSource* CreateInvalidationsHTMLSource() { 15 content::WebUIDataSource* CreateInvalidationsHTMLSource() {
16 // This is done once per opening of the page 16 // This is done once per opening of the page
17 // This method does not fire when refreshing the page 17 // This method does not fire when refreshing the page
18 content::WebUIDataSource* source = 18 content::WebUIDataSource* source =
19 content::WebUIDataSource::Create(chrome::kChromeUIInvalidationsHost); 19 content::WebUIDataSource::Create(chrome::kChromeUIInvalidationsHost);
20 source->AddResourcePath("about_invalidations.js", IDR_ABOUT_INVALIDATIONS_JS); 20 source->AddResourcePath("about_invalidations.js", IDR_ABOUT_INVALIDATIONS_JS);
21 source->SetDefaultResource(IDR_ABOUT_INVALIDATIONS_HTML); 21 source->SetDefaultResource(IDR_ABOUT_INVALIDATIONS_HTML);
22 source->DisableI18nAndUseGzipForAllPaths(); 22 source->UseGzip(std::unordered_set<std::string>());
23 return source; 23 return source;
24 } 24 }
25 25
26 InvalidationsUI::InvalidationsUI(content::WebUI* web_ui) 26 InvalidationsUI::InvalidationsUI(content::WebUI* web_ui)
27 : WebUIController(web_ui) { 27 : WebUIController(web_ui) {
28 Profile* profile = Profile::FromWebUI(web_ui); 28 Profile* profile = Profile::FromWebUI(web_ui);
29 if (profile) { 29 if (profile) {
30 content::WebUIDataSource::Add(profile, CreateInvalidationsHTMLSource()); 30 content::WebUIDataSource::Add(profile, CreateInvalidationsHTMLSource());
31 InvalidationsMessageHandler* message_handler = 31 InvalidationsMessageHandler* message_handler =
32 new InvalidationsMessageHandler(); 32 new InvalidationsMessageHandler();
33 // The MessageHandler of web_ui takes ownership of the object 33 // The MessageHandler of web_ui takes ownership of the object
34 web_ui->AddMessageHandler(message_handler); 34 web_ui->AddMessageHandler(message_handler);
35 } 35 }
36 } 36 }
37 37
38 InvalidationsUI::~InvalidationsUI() { } 38 InvalidationsUI::~InvalidationsUI() { }
39 39
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/history_ui.cc ('k') | chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698