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

Side by Side Diff: extensions/shell/common/shell_content_client.cc

Issue 2679383003: Share schemes needed for CSP between the browser and the renderer. (Closed)
Patch Set: Rebase and fix conflict. Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/common/shell_content_client.h" 5 #include "extensions/shell/common/shell_content_client.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/common/user_agent.h" 9 #include "content/public/common/user_agent.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; 72 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
73 plugins->push_back(nacl); 73 plugins->push_back(nacl);
74 #endif // !defined(DISABLE_NACL) 74 #endif // !defined(DISABLE_NACL)
75 } 75 }
76 76
77 void ShellContentClient::AddAdditionalSchemes(Schemes* schemes) { 77 void ShellContentClient::AddAdditionalSchemes(Schemes* schemes) {
78 schemes->standard_schemes.push_back(extensions::kExtensionScheme); 78 schemes->standard_schemes.push_back(extensions::kExtensionScheme);
79 schemes->savable_schemes.push_back(kExtensionScheme); 79 schemes->savable_schemes.push_back(kExtensionScheme);
80 schemes->secure_schemes.push_back(kExtensionScheme); 80 schemes->secure_schemes.push_back(kExtensionScheme);
81 schemes->cors_enabled_schemes.push_back(kExtensionScheme); 81 schemes->cors_enabled_schemes.push_back(kExtensionScheme);
82 schemes->csp_bypassing_schemes.push_back(kExtensionScheme);
82 } 83 }
83 84
84 std::string ShellContentClient::GetUserAgent() const { 85 std::string ShellContentClient::GetUserAgent() const {
85 // Must contain a user agent string for version sniffing. For example, 86 // Must contain a user agent string for version sniffing. For example,
86 // pluginless WebRTC Hangouts checks the Chrome version number. 87 // pluginless WebRTC Hangouts checks the Chrome version number.
87 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); 88 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION);
88 } 89 }
89 90
90 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { 91 base::string16 ShellContentClient::GetLocalizedString(int message_id) const {
91 return l10n_util::GetStringUTF16(message_id); 92 return l10n_util::GetStringUTF16(message_id);
92 } 93 }
93 94
94 base::StringPiece ShellContentClient::GetDataResource( 95 base::StringPiece ShellContentClient::GetDataResource(
95 int resource_id, 96 int resource_id,
96 ui::ScaleFactor scale_factor) const { 97 ui::ScaleFactor scale_factor) const {
97 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( 98 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
98 resource_id, scale_factor); 99 resource_id, scale_factor);
99 } 100 }
100 101
101 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes( 102 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes(
102 int resource_id) const { 103 int resource_id) const {
103 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 104 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
104 } 105 }
105 106
106 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { 107 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
107 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 108 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
108 } 109 }
109 110
110 } // namespace extensions 111 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698