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

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

Issue 2149323003: Change the way that gzipped resources are loaded from resources.pak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/snippets_internals_ui.h" 5 #include "chrome/browser/ui/webui/snippets_internals_ui.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/webui/snippets_internals_message_handler.h" 8 #include "chrome/browser/ui/webui/snippets_internals_message_handler.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/web_ui.h" 10 #include "content/public/browser/web_ui.h"
11 #include "content/public/browser/web_ui_data_source.h" 11 #include "content/public/browser/web_ui_data_source.h"
12 #include "grit/browser_resources.h" 12 #include "grit/browser_resources.h"
13 13
14 namespace { 14 namespace {
15 15
16 content::WebUIDataSource* CreateSnippetsInternalsHTMLSource() { 16 content::WebUIDataSource* CreateSnippetsInternalsHTMLSource() {
17 content::WebUIDataSource* source = 17 content::WebUIDataSource* source =
18 content::WebUIDataSource::Create(chrome::kChromeUISnippetsInternalsHost); 18 content::WebUIDataSource::Create(chrome::kChromeUISnippetsInternalsHost);
19 19
20 source->AddResourcePath("snippets_internals.js", IDR_SNIPPETS_INTERNALS_JS); 20 source->AddResourcePath("snippets_internals.js", IDR_SNIPPETS_INTERNALS_JS);
21 source->AddResourcePath("snippets_internals.css", IDR_SNIPPETS_INTERNALS_CSS); 21 source->AddResourcePath("snippets_internals.css", IDR_SNIPPETS_INTERNALS_CSS);
22 source->SetDefaultResource(IDR_SNIPPETS_INTERNALS_HTML); 22 source->SetDefaultResource(IDR_SNIPPETS_INTERNALS_HTML);
23 source->DisableI18nAndUseGzipForAllPaths();
23 return source; 24 return source;
24 } 25 }
25 26
26 } // namespace 27 } // namespace
27 28
28 SnippetsInternalsUI::SnippetsInternalsUI(content::WebUI* web_ui) 29 SnippetsInternalsUI::SnippetsInternalsUI(content::WebUI* web_ui)
29 : WebUIController(web_ui) { 30 : WebUIController(web_ui) {
30 Profile* profile = Profile::FromWebUI(web_ui); 31 Profile* profile = Profile::FromWebUI(web_ui);
31 content::WebUIDataSource::Add(profile, CreateSnippetsInternalsHTMLSource()); 32 content::WebUIDataSource::Add(profile, CreateSnippetsInternalsHTMLSource());
32 33
33 web_ui->AddMessageHandler(new SnippetsInternalsMessageHandler); 34 web_ui->AddMessageHandler(new SnippetsInternalsMessageHandler);
34 } 35 }
35 36
36 SnippetsInternalsUI::~SnippetsInternalsUI() {} 37 SnippetsInternalsUI::~SnippetsInternalsUI() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin_internals_ui.cc ('k') | chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698