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

Side by Side Diff: chrome/browser/ui/webui/vr_shell/vr_shell_ui_ui.cc

Issue 2363553003: VrShell: implement insecure content warning display (Closed)
Patch Set: Josh: lower permanent icon by half its height. Created 4 years, 2 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 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"
11 11
12 #if !defined(ENABLE_VR_SHELL_UI_DEV) 12 #if !defined(ENABLE_VR_SHELL_UI_DEV)
13 #include "chrome/grit/browser_resources.h" 13 #include "chrome/grit/browser_resources.h"
14 #include "chrome/grit/generated_resources.h"
14 #include "content/public/browser/web_ui_data_source.h" 15 #include "content/public/browser/web_ui_data_source.h"
15 #else 16 #else
16 #include <map> 17 #include <map>
17 #include "base/macros.h" 18 #include "base/macros.h"
18 #include "base/memory/ref_counted_memory.h" 19 #include "base/memory/ref_counted_memory.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "content/public/browser/url_data_source.h" 21 #include "content/public/browser/url_data_source.h"
21 #include "net/url_request/url_fetcher.h" 22 #include "net/url_request/url_fetcher.h"
22 #include "net/url_request/url_fetcher_delegate.h" 23 #include "net/url_request/url_fetcher_delegate.h"
23 #include "net/url_request/url_request_context_getter.h" 24 #include "net/url_request/url_request_context_getter.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 delete source; 173 delete source;
173 pending_.erase(it); 174 pending_.erase(it);
174 } 175 }
175 #else 176 #else
176 content::WebUIDataSource* CreateVrShellUIHTMLSource() { 177 content::WebUIDataSource* CreateVrShellUIHTMLSource() {
177 content::WebUIDataSource* source = 178 content::WebUIDataSource* source =
178 content::WebUIDataSource::Create(chrome::kChromeUIVrShellUIHost); 179 content::WebUIDataSource::Create(chrome::kChromeUIVrShellUIHost);
179 source->AddResourcePath("vr_shell_ui.js", IDR_VR_SHELL_UI_JS); 180 source->AddResourcePath("vr_shell_ui.js", IDR_VR_SHELL_UI_JS);
180 source->AddResourcePath("vr_shell_ui.css", IDR_VR_SHELL_UI_CSS); 181 source->AddResourcePath("vr_shell_ui.css", IDR_VR_SHELL_UI_CSS);
181 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML); 182 source->SetDefaultResource(IDR_VR_SHELL_UI_HTML);
182 source->DisableI18nAndUseGzipForAllPaths(); 183 // We're localizing strings, so we can't use gzip since it's incompatible with
184 // i18n. See WebUIDataSource's DisableI18nAndUseGzipForAllPaths() comments.
bshe 2016/09/29 13:50:56 The above comment seems more relevant to the chang
185 source->AddLocalizedString(
186 "insecureWebVrContentPermanent",
187 IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_PERMANENT);
188 source->AddLocalizedString(
189 "insecureWebVrContentTransient",
190 IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_TRANSIENT);
183 return source; 191 return source;
184 } 192 }
185 #endif 193 #endif
186 194
187 } // namespace 195 } // namespace
188 196
189 VrShellUIUI::VrShellUIUI(content::WebUI* web_ui) : WebUIController(web_ui) { 197 VrShellUIUI::VrShellUIUI(content::WebUI* web_ui) : WebUIController(web_ui) {
190 Profile* profile = Profile::FromWebUI(web_ui); 198 Profile* profile = Profile::FromWebUI(web_ui);
191 #if !defined(ENABLE_VR_SHELL_UI_DEV) 199 #if !defined(ENABLE_VR_SHELL_UI_DEV)
192 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource()); 200 content::WebUIDataSource::Add(profile, CreateVrShellUIHTMLSource());
193 #else 201 #else
194 content::URLDataSource::Add( 202 content::URLDataSource::Add(
195 profile, new RemoteDataSource(profile->GetRequestContext())); 203 profile, new RemoteDataSource(profile->GetRequestContext()));
196 #endif 204 #endif
197 web_ui->AddMessageHandler(new VrShellUIMessageHandler); 205 web_ui->AddMessageHandler(new VrShellUIMessageHandler);
198 } 206 }
199 207
200 VrShellUIUI::~VrShellUIUI() {} 208 VrShellUIUI::~VrShellUIUI() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698