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

Side by Side Diff: chrome/browser/ui/webui/app_launcher_page_ui.cc

Issue 2774263002: Specify AllowCaching = false for dynamically-generated contents (Closed)
Patch Set: typo Created 3 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/app_launcher_page_ui.h" 5 #include "chrome/browser/ui/webui/app_launcher_page_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 std::string AppLauncherPageUI::HTMLSource::GetMimeType( 120 std::string AppLauncherPageUI::HTMLSource::GetMimeType(
121 const std::string& resource) const { 121 const std::string& resource) const {
122 return "text/html"; 122 return "text/html";
123 } 123 }
124 124
125 bool AppLauncherPageUI::HTMLSource::ShouldReplaceExistingSource() const { 125 bool AppLauncherPageUI::HTMLSource::ShouldReplaceExistingSource() const {
126 return false; 126 return false;
127 } 127 }
128 128
129 bool AppLauncherPageUI::HTMLSource::AllowCaching() const {
130 // Should not be cached to reflect dynamically-generated contents that may
131 // depend on user profiles.
132 return false;
133 }
134
129 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyScriptSrc() 135 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyScriptSrc()
130 const { 136 const {
131 // 'unsafe-inline' is added to script-src. 137 // 'unsafe-inline' is added to script-src.
132 return "script-src chrome://resources 'self' 'unsafe-eval' 'unsafe-inline';"; 138 return "script-src chrome://resources 'self' 'unsafe-eval' 'unsafe-inline';";
133 } 139 }
134 140
135 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyStyleSrc() 141 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyStyleSrc()
136 const { 142 const {
137 return "style-src 'self' chrome://resources chrome://theme 'unsafe-inline';"; 143 return "style-src 'self' chrome://resources chrome://theme 'unsafe-inline';";
138 } 144 }
139 145
140 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyImgSrc() 146 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyImgSrc()
141 const { 147 const {
142 return "img-src chrome://extension-icon chrome://theme chrome://resources " 148 return "img-src chrome://extension-icon chrome://theme chrome://resources "
143 "data:;"; 149 "data:;";
144 } 150 }
145 151
146 AppLauncherPageUI::HTMLSource::~HTMLSource() {} 152 AppLauncherPageUI::HTMLSource::~HTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/app_launcher_page_ui.h ('k') | chrome/browser/ui/webui/extensions/extension_icon_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698