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 11 matching lines...) Expand all Loading... |
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 | 31 |
32 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); | 32 Profile* profile = Profile::FromWebUI(web_ui); |
| 33 html_source->AddBoolean("isIncognito", profile->IsOffTheRecord()); |
| 34 |
| 35 content::WebUIDataSource::Add(profile, html_source); |
33 | 36 |
34 web_ui->AddMessageHandler( | 37 web_ui->AddMessageHandler( |
35 new offline_internals::OfflineInternalsUIMessageHandler()); | 38 new offline_internals::OfflineInternalsUIMessageHandler()); |
36 } | 39 } |
37 | 40 |
38 OfflineInternalsUI::~OfflineInternalsUI() {} | 41 OfflineInternalsUI::~OfflineInternalsUI() {} |
OLD | NEW |