| 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/vr_shell/vr_shell_ui_ui.h" | 5 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_ui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.h" | 8 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_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" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 pending_.erase(it); | 180 pending_.erase(it); |
| 181 } | 181 } |
| 182 #else | 182 #else |
| 183 content::WebUIDataSource* CreateVrShellUIHTMLSource() { | 183 content::WebUIDataSource* CreateVrShellUIHTMLSource() { |
| 184 content::WebUIDataSource* source = | 184 content::WebUIDataSource* source = |
| 185 content::WebUIDataSource::Create(chrome::kChromeUIVrShellUIHost); | 185 content::WebUIDataSource::Create(chrome::kChromeUIVrShellUIHost); |
| 186 source->AddResourcePath("vr_shell_ui.css", IDR_VR_SHELL_UI_CSS); | 186 source->AddResourcePath("vr_shell_ui.css", IDR_VR_SHELL_UI_CSS); |
| 187 source->AddResourcePath("vr_shell_ui.js", IDR_VR_SHELL_UI_JS); | 187 source->AddResourcePath("vr_shell_ui.js", IDR_VR_SHELL_UI_JS); |
| 188 source->AddResourcePath("vr_shell_ui_api.js", IDR_VR_SHELL_UI_API_JS); | 188 source->AddResourcePath("vr_shell_ui_api.js", IDR_VR_SHELL_UI_API_JS); |
| 189 source->AddResourcePath("vr_shell_ui_scene.js", IDR_VR_SHELL_UI_SCENE_JS); | 189 source->AddResourcePath("vr_shell_ui_scene.js", IDR_VR_SHELL_UI_SCENE_JS); |
| 190 source->AddResourcePath("images/back.svg", IDR_VR_SHELL_IMAGES_BACK); |
| 191 source->AddResourcePath("images/info.svg", IDR_VR_SHELL_IMAGES_INFO); |
| 192 source->AddResourcePath("images/lock.svg", IDR_VR_SHELL_IMAGES_LOCK); |
| 193 source->AddResourcePath("images/reload.svg", IDR_VR_SHELL_IMAGES_RELOAD); |
| 194 source->AddResourcePath("images/warning.svg", IDR_VR_SHELL_IMAGES_WARNING); |
| 190 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML); | 195 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML); |
| 191 // We're localizing strings, so we can't currently use gzip since it's | 196 // We're localizing strings, so we can't currently use gzip since it's |
| 192 // incompatible with i18n. TODO(klausw): re-enable gzip once an i18n | 197 // incompatible with i18n. TODO(klausw): re-enable gzip once an i18n |
| 193 // compatible variant of WebUIDataSource's DisableI18nAndUseGzipForAllPaths | 198 // compatible variant of WebUIDataSource's DisableI18nAndUseGzipForAllPaths |
| 194 // gets added, and add compress=gzip to browser_resources.grd as appropriate. | 199 // gets added, and add compress=gzip to browser_resources.grd as appropriate. |
| 195 source->AddLocalizedString( | 200 source->AddLocalizedString( |
| 196 "insecureWebVrContentPermanent", | 201 "insecureWebVrContentPermanent", |
| 197 IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_PERMANENT); | 202 IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_PERMANENT); |
| 198 source->AddLocalizedString( | 203 source->AddLocalizedString( |
| 199 "insecureWebVrContentTransient", | 204 "insecureWebVrContentTransient", |
| (...skipping 13 matching lines...) Expand all Loading... |
| 213 #if !defined(ENABLE_VR_SHELL_UI_DEV) | 218 #if !defined(ENABLE_VR_SHELL_UI_DEV) |
| 214 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource()); | 219 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource()); |
| 215 #else | 220 #else |
| 216 content::URLDataSource::Add( | 221 content::URLDataSource::Add( |
| 217 profile, new RemoteDataSource(profile->GetRequestContext())); | 222 profile, new RemoteDataSource(profile->GetRequestContext())); |
| 218 #endif | 223 #endif |
| 219 web_ui->AddMessageHandler(new VrShellUIMessageHandler); | 224 web_ui->AddMessageHandler(new VrShellUIMessageHandler); |
| 220 } | 225 } |
| 221 | 226 |
| 222 VrShellUIUI::~VrShellUIUI() {} | 227 VrShellUIUI::~VrShellUIUI() {} |
| OLD | NEW |