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

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

Issue 1272113002: Allow url::SchemeHostPort to hold non-file scheme without port (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
77 void ShellContentClient::AddAdditionalSchemes( 84 void ShellContentClient::AddAdditionalSchemes(
78 std::vector<std::string>* standard_schemes, 85 std::vector<url::SchemeWithType>* standard_schemes,
79 std::vector<std::string>* savable_schemes) { 86 std::vector<std::string>* savable_schemes) {
80 standard_schemes->push_back(kExtensionScheme); 87 for (int i = 0; i < kNumShellStandardURLSchemes; i++)
88 standard_schemes->push_back(kShellStandardURLSchemes[i]);
89
81 savable_schemes->push_back(kExtensionScheme); 90 savable_schemes->push_back(kExtensionScheme);
82 standard_schemes->push_back(kExtensionResourceScheme);
83 savable_schemes->push_back(kExtensionResourceScheme); 91 savable_schemes->push_back(kExtensionResourceScheme);
84 } 92 }
85 93
86 std::string ShellContentClient::GetUserAgent() const { 94 std::string ShellContentClient::GetUserAgent() const {
87 // Must contain a user agent string for version sniffing. For example, 95 // Must contain a user agent string for version sniffing. For example,
88 // pluginless WebRTC Hangouts checks the Chrome version number. 96 // pluginless WebRTC Hangouts checks the Chrome version number.
89 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); 97 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION);
90 } 98 }
91 99
92 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { 100 base::string16 ShellContentClient::GetLocalizedString(int message_id) const {
(...skipping 10 matching lines...) Expand all
103 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( 111 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
104 int resource_id) const { 112 int resource_id) const {
105 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 113 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
106 } 114 }
107 115
108 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { 116 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
109 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 117 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
110 } 118 }
111 119
112 } // namespace extensions 120 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/common/shell_content_client.h ('k') | extensions/test/extensions_unittests_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698