OLD | NEW |
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/offline/offline_internals_ui.h" | 5 #include "chrome/browser/ui/webui/offline/offline_internals_ui.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h
" | 9 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h
" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Required resources. | 22 // Required resources. |
23 html_source->SetJsonPath("strings.js"); | 23 html_source->SetJsonPath("strings.js"); |
24 html_source->AddResourcePath("offline_internals.css", | 24 html_source->AddResourcePath("offline_internals.css", |
25 IDR_OFFLINE_INTERNALS_CSS); | 25 IDR_OFFLINE_INTERNALS_CSS); |
26 html_source->AddResourcePath("offline_internals.js", | 26 html_source->AddResourcePath("offline_internals.js", |
27 IDR_OFFLINE_INTERNALS_JS); | 27 IDR_OFFLINE_INTERNALS_JS); |
28 html_source->AddResourcePath("offline_internals_browser_proxy.js", | 28 html_source->AddResourcePath("offline_internals_browser_proxy.js", |
29 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS); | 29 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS); |
30 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML); | 30 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML); |
31 html_source->DisableI18nAndUseGzipForAllPaths(); | 31 html_source->UseGzip(std::unordered_set<std::string>()); |
32 | 32 |
33 Profile* profile = Profile::FromWebUI(web_ui); | 33 Profile* profile = Profile::FromWebUI(web_ui); |
34 html_source->AddBoolean("isIncognito", profile->IsOffTheRecord()); | 34 html_source->AddBoolean("isIncognito", profile->IsOffTheRecord()); |
35 | 35 |
36 content::WebUIDataSource::Add(profile, html_source); | 36 content::WebUIDataSource::Add(profile, html_source); |
37 | 37 |
38 web_ui->AddMessageHandler( | 38 web_ui->AddMessageHandler( |
39 new offline_internals::OfflineInternalsUIMessageHandler()); | 39 new offline_internals::OfflineInternalsUIMessageHandler()); |
40 } | 40 } |
41 | 41 |
42 OfflineInternalsUI::~OfflineInternalsUI() {} | 42 OfflineInternalsUI::~OfflineInternalsUI() {} |
OLD | NEW |