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

Side by Side Diff: chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc

Issue 2590793004: MD Downloads: gzip vulcanized resources via compress="gzip" (Closed)
Patch Set: . Created 3 years, 12 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/translate_internals/translate_internals_ui.h" 5 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 content::WebUIDataSource* CreateTranslateInternalsHTMLSource() { 45 content::WebUIDataSource* CreateTranslateInternalsHTMLSource() {
46 content::WebUIDataSource* source = 46 content::WebUIDataSource* source =
47 content::WebUIDataSource::Create(chrome::kChromeUITranslateInternalsHost); 47 content::WebUIDataSource::Create(chrome::kChromeUITranslateInternalsHost);
48 48
49 source->SetDefaultResource(IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HTML); 49 source->SetDefaultResource(IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HTML);
50 source->SetJsonPath("strings.js"); 50 source->SetJsonPath("strings.js");
51 source->AddResourcePath("translate_internals.js", 51 source->AddResourcePath("translate_internals.js",
52 IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_JS); 52 IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_JS);
53 source->DisableI18nAndUseGzipForAllPaths(); 53 source->UseGzip(std::unordered_set<std::string>());
54 54
55 base::DictionaryValue langs; 55 base::DictionaryValue langs;
56 GetLanguages(&langs); 56 GetLanguages(&langs);
57 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) { 57 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) {
58 std::string key = "language-" + it.key(); 58 std::string key = "language-" + it.key();
59 std::string value; 59 std::string value;
60 it.value().GetAsString(&value); 60 it.value().GetAsString(&value);
61 source->AddString(key, value); 61 source->AddString(key, value);
62 } 62 }
63 63
(...skipping 14 matching lines...) Expand all
78 78
79 } // namespace 79 } // namespace
80 80
81 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) 81 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui)
82 : WebUIController(web_ui) { 82 : WebUIController(web_ui) {
83 web_ui->AddMessageHandler(new TranslateInternalsHandler); 83 web_ui->AddMessageHandler(new TranslateInternalsHandler);
84 84
85 Profile* profile = Profile::FromWebUI(web_ui); 85 Profile* profile = Profile::FromWebUI(web_ui);
86 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); 86 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource());
87 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/supervised_user_internals_ui.cc ('k') | chrome/browser/ui/webui/usb_internals/usb_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698