OLD | NEW |
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/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 std::string AppLauncherPageUI::HTMLSource::GetMimeType( | 125 std::string AppLauncherPageUI::HTMLSource::GetMimeType( |
126 const std::string& resource) const { | 126 const std::string& resource) const { |
127 return "text/html"; | 127 return "text/html"; |
128 } | 128 } |
129 | 129 |
130 bool AppLauncherPageUI::HTMLSource::ShouldReplaceExistingSource() const { | 130 bool AppLauncherPageUI::HTMLSource::ShouldReplaceExistingSource() const { |
131 return false; | 131 return false; |
132 } | 132 } |
133 | 133 |
134 bool AppLauncherPageUI::HTMLSource::ShouldAddContentSecurityPolicy() const { | 134 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyScriptSrc() |
135 return false; | 135 const { |
| 136 // 'unsafe-inline' is added to script-src. |
| 137 return "script-src chrome://resources 'self' 'unsafe-eval' 'unsafe-inline';"; |
| 138 } |
| 139 |
| 140 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyStyleSrc() |
| 141 const { |
| 142 return "style-src 'self' chrome://resources chrome://theme 'unsafe-inline';"; |
| 143 } |
| 144 |
| 145 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyImgSrc() |
| 146 const { |
| 147 return "img-src chrome://extension-icon chrome://theme chrome://resources " |
| 148 "data:;"; |
136 } | 149 } |
137 | 150 |
138 AppLauncherPageUI::HTMLSource::~HTMLSource() {} | 151 AppLauncherPageUI::HTMLSource::~HTMLSource() {} |
OLD | NEW |