| 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 <string> | 7 #include <string> |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 source->AddResourcePath("vk.css", IDR_VR_SHELL_UI_VK_CSS); | 194 source->AddResourcePath("vk.css", IDR_VR_SHELL_UI_VK_CSS); |
| 195 source->AddResourcePath("vk.js", IDR_VR_SHELL_UI_VK_JS); | 195 source->AddResourcePath("vk.js", IDR_VR_SHELL_UI_VK_JS); |
| 196 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML); | 196 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML); |
| 197 source->AddLocalizedString("insecureWebVrContentPermanent", | 197 source->AddLocalizedString("insecureWebVrContentPermanent", |
| 198 IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_PERMANENT); | 198 IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_PERMANENT); |
| 199 source->AddLocalizedString("insecureWebVrContentTransient", | 199 source->AddLocalizedString("insecureWebVrContentTransient", |
| 200 IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT); | 200 IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT); |
| 201 source->AddLocalizedString("back", IDS_VR_SHELL_UI_BACK_BUTTON); | 201 source->AddLocalizedString("back", IDS_VR_SHELL_UI_BACK_BUTTON); |
| 202 source->AddLocalizedString("forward", IDS_VR_SHELL_UI_FORWARD_BUTTON); | 202 source->AddLocalizedString("forward", IDS_VR_SHELL_UI_FORWARD_BUTTON); |
| 203 source->AddLocalizedString("reload", IDS_VR_SHELL_UI_RELOAD_BUTTON); | 203 source->AddLocalizedString("reload", IDS_VR_SHELL_UI_RELOAD_BUTTON); |
| 204 source->AddLocalizedString("exitPresent", |
| 205 IDS_VR_SHELL_UI_EXIT_PRESENT_BUTTON); |
| 204 source->AddLocalizedString("newTab", IDS_VR_SHELL_NEW_TAB_BUTTON); | 206 source->AddLocalizedString("newTab", IDS_VR_SHELL_NEW_TAB_BUTTON); |
| 205 source->AddLocalizedString("newIncognitoTab", | 207 source->AddLocalizedString("newIncognitoTab", |
| 206 IDS_VR_SHELL_NEW_INCOGNITO_TAB_BUTTON); | 208 IDS_VR_SHELL_NEW_INCOGNITO_TAB_BUTTON); |
| 207 | 209 |
| 208 return source; | 210 return source; |
| 209 } | 211 } |
| 210 #endif | 212 #endif |
| 211 | 213 |
| 212 } // namespace | 214 } // namespace |
| 213 | 215 |
| 214 VrShellUIUI::VrShellUIUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 216 VrShellUIUI::VrShellUIUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 215 Profile* profile = Profile::FromWebUI(web_ui); | 217 Profile* profile = Profile::FromWebUI(web_ui); |
| 216 #if !defined(ENABLE_VR_SHELL_UI_DEV) | 218 #if !defined(ENABLE_VR_SHELL_UI_DEV) |
| 217 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource()); | 219 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource()); |
| 218 #else | 220 #else |
| 219 content::URLDataSource::Add( | 221 content::URLDataSource::Add( |
| 220 profile, new RemoteDataSource(profile->GetRequestContext())); | 222 profile, new RemoteDataSource(profile->GetRequestContext())); |
| 221 #endif | 223 #endif |
| 222 web_ui->AddMessageHandler(base::MakeUnique<VrShellUIMessageHandler>()); | 224 web_ui->AddMessageHandler(base::MakeUnique<VrShellUIMessageHandler>()); |
| 223 } | 225 } |
| 224 | 226 |
| 225 VrShellUIUI::~VrShellUIUI() {} | 227 VrShellUIUI::~VrShellUIUI() {} |
| OLD | NEW |