OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; | 67 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; |
68 nacl.internal_entry_points.initialize_module = | 68 nacl.internal_entry_points.initialize_module = |
69 nacl_plugin::PPP_InitializeModule; | 69 nacl_plugin::PPP_InitializeModule; |
70 nacl.internal_entry_points.shutdown_module = | 70 nacl.internal_entry_points.shutdown_module = |
71 nacl_plugin::PPP_ShutdownModule; | 71 nacl_plugin::PPP_ShutdownModule; |
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 static const int kNumShellStandardURLSchemes = 2; | |
78 static const url::SchemeWithType kShellStandardURLSchemes[ | |
79 kNumShellStandardURLSchemes] = { | |
80 {extensions::kExtensionScheme, url::SCHEME_WITHOUT_PORT}, | |
81 {extensions::kExtensionResourceScheme, url::SCHEME_WITHOUT_PORT}, | |
82 }; | |
83 | |
84 void ShellContentClient::AddAdditionalSchemes( | 77 void ShellContentClient::AddAdditionalSchemes( |
85 std::vector<url::SchemeWithType>* standard_schemes, | 78 std::vector<std::string>* standard_schemes, |
86 std::vector<std::string>* savable_schemes) { | 79 std::vector<std::string>* savable_schemes) { |
87 for (int i = 0; i < kNumShellStandardURLSchemes; i++) | 80 standard_schemes->push_back(kExtensionScheme); |
88 standard_schemes->push_back(kShellStandardURLSchemes[i]); | |
89 | |
90 savable_schemes->push_back(kExtensionScheme); | 81 savable_schemes->push_back(kExtensionScheme); |
| 82 standard_schemes->push_back(kExtensionResourceScheme); |
91 savable_schemes->push_back(kExtensionResourceScheme); | 83 savable_schemes->push_back(kExtensionResourceScheme); |
92 } | 84 } |
93 | 85 |
94 std::string ShellContentClient::GetUserAgent() const { | 86 std::string ShellContentClient::GetUserAgent() const { |
95 // Must contain a user agent string for version sniffing. For example, | 87 // Must contain a user agent string for version sniffing. For example, |
96 // pluginless WebRTC Hangouts checks the Chrome version number. | 88 // pluginless WebRTC Hangouts checks the Chrome version number. |
97 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); | 89 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); |
98 } | 90 } |
99 | 91 |
100 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { | 92 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { |
(...skipping 10 matching lines...) Expand all Loading... |
111 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( | 103 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( |
112 int resource_id) const { | 104 int resource_id) const { |
113 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 105 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
114 } | 106 } |
115 | 107 |
116 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 108 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
117 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 109 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
118 } | 110 } |
119 | 111 |
120 } // namespace extensions | 112 } // namespace extensions |
OLD | NEW |