diff options
47 files changed, 67 insertions, 71 deletions
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc index 49d98da..1bab66b 100644 --- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc +++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc @@ -231,7 +231,7 @@ void AwResourceDispatcherHostDelegate::RequestBeginning( (resource_type == ResourceType::MAIN_FRAME || (resource_type == ResourceType::SUB_FRAME && !request->url().SchemeIs(chrome::kHttpScheme) && - !request->url().SchemeIs(chrome::kHttpsScheme))); + !request->url().SchemeIs(content::kHttpsScheme))); if (allow_intercepting) { throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor( request)); diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index e192a89d..c1fdf54 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -173,7 +173,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // until I run into some cases that really need it. if (parts->scheme.is_nonempty() && !LowerCaseEqualsASCII(parsed_scheme, chrome::kHttpScheme) && - !LowerCaseEqualsASCII(parsed_scheme, chrome::kHttpsScheme)) { + !LowerCaseEqualsASCII(parsed_scheme, content::kHttpsScheme)) { // See if we know how to handle the URL internally. if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme))) return URL; diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index ca6cb7d..ae89aa0 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -376,7 +376,7 @@ void AutocompleteMatch::ComputeStrippedDestinationURL(Profile* profile) { } // Replace https protocol with http protocol. - if (stripped_destination_url.SchemeIs(chrome::kHttpsScheme)) { + if (stripped_destination_url.SchemeIs(content::kHttpsScheme)) { replacements.SetScheme( chrome::kHttpScheme, url_parse::Component(0, strlen(chrome::kHttpScheme))); diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 05b49e6..38f0b9e 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -731,7 +731,7 @@ bool SearchProvider::IsQuerySuitableForSuggest() const { // our checks below. Other QUERY cases are less likely to be URLs and thus we // assume we're OK. if (!LowerCaseEqualsASCII(input_.scheme(), chrome::kHttpScheme) && - !LowerCaseEqualsASCII(input_.scheme(), chrome::kHttpsScheme) && + !LowerCaseEqualsASCII(input_.scheme(), content::kHttpsScheme) && !LowerCaseEqualsASCII(input_.scheme(), chrome::kFtpScheme)) return (input_.type() == AutocompleteInput::QUERY); @@ -749,7 +749,7 @@ bool SearchProvider::IsQuerySuitableForSuggest() const { // Don't send anything for https except the hostname. Hostnames are OK // because they are visible when the TCP connection is established, but the // specific path may reveal private information. - if (LowerCaseEqualsASCII(input_.scheme(), chrome::kHttpsScheme) && + if (LowerCaseEqualsASCII(input_.scheme(), content::kHttpsScheme) && parts.path.is_nonempty()) return false; diff --git a/chrome/browser/autocomplete/zero_suggest_provider.cc b/chrome/browser/autocomplete/zero_suggest_provider.cc index f19b287..4369aba 100644 --- a/chrome/browser/autocomplete/zero_suggest_provider.cc +++ b/chrome/browser/autocomplete/zero_suggest_provider.cc @@ -390,7 +390,7 @@ void ZeroSuggestProvider::Run() { ReplaceSearchTerms(search_term_args); GURL suggest_url(req_url); // Make sure we are sending the suggest request through HTTPS. - if (!suggest_url.SchemeIs(chrome::kHttpsScheme)) { + if (!suggest_url.SchemeIs(content::kHttpsScheme)) { Stop(true); return; } diff --git a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc index d0fbd04..26f04ae 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc @@ -59,7 +59,7 @@ class BrowsingDataHelperTest : public testing::Test { TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreWebSafe) { EXPECT_TRUE(IsWebScheme(chrome::kHttpScheme)); - EXPECT_TRUE(IsWebScheme(chrome::kHttpsScheme)); + EXPECT_TRUE(IsWebScheme(content::kHttpsScheme)); EXPECT_TRUE(IsWebScheme(chrome::kFtpScheme)); EXPECT_TRUE(IsWebScheme(chrome::kDataScheme)); EXPECT_TRUE(IsWebScheme("feed")); @@ -83,7 +83,7 @@ TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotWebSafe) { TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) { EXPECT_FALSE(IsExtensionScheme(chrome::kHttpScheme)); - EXPECT_FALSE(IsExtensionScheme(chrome::kHttpsScheme)); + EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme)); EXPECT_FALSE(IsExtensionScheme(chrome::kFtpScheme)); EXPECT_FALSE(IsExtensionScheme(chrome::kDataScheme)); EXPECT_FALSE(IsExtensionScheme("feed")); diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index 58abc27..f894e75 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc @@ -1229,7 +1229,7 @@ void CookiesTreeModel::PopulateServerBoundCertInfoWithFilter( if (!origin.is_valid()) { // Domain Bound Cert. Make a valid URL to satisfy the // CookieTreeRootNode::GetOrCreateHostNode interface. - origin = GURL(std::string(chrome::kHttpsScheme) + + origin = GURL(std::string(content::kHttpsScheme) + content::kStandardSchemeSeparator + cert_info->server_identifier() + "/"); } diff --git a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc index 537d08f..133e330 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc @@ -45,7 +45,7 @@ COMPILE_ASSERT(arraysize(kContentSettingNames) <= std::string GetDefaultPort(const std::string& scheme) { if (scheme == chrome::kHttpScheme) return "80"; - if (scheme == chrome::kHttpsScheme) + if (scheme == content::kHttpsScheme) return "443"; NOTREACHED(); return std::string(); diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc index b68146b..2d3e67e 100644 --- a/chrome/browser/extensions/api/cookies/cookies_helpers.cc +++ b/chrome/browser/extensions/api/cookies/cookies_helpers.cc @@ -119,7 +119,7 @@ void GetCookieListFromStore( GURL GetURLFromCanonicalCookie(const net::CanonicalCookie& cookie) { const std::string& domain_key = cookie.Domain(); const std::string scheme = - cookie.IsSecure() ? chrome::kHttpsScheme : chrome::kHttpScheme; + cookie.IsSecure() ? content::kHttpsScheme : chrome::kHttpScheme; const std::string host = domain_key.find('.') != 0 ? domain_key : domain_key.substr(1); return GURL(scheme + content::kStandardSchemeSeparator + host + "/"); diff --git a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc index 11092cb..8df798b 100644 --- a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc +++ b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc @@ -16,7 +16,7 @@ namespace { const char* kValidSchemes[] = { chrome::kChromeUIScheme, chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFileScheme, chrome::kFtpScheme, content::kJavaScriptScheme, diff --git a/chrome/browser/extensions/api/web_request/web_request_permissions.cc b/chrome/browser/extensions/api/web_request/web_request_permissions.cc index 480bf84..4bad267 100644 --- a/chrome/browser/extensions/api/web_request/web_request_permissions.cc +++ b/chrome/browser/extensions/api/web_request/web_request_permissions.cc @@ -71,7 +71,7 @@ bool HasWebRequestScheme(const GURL& url) { url.SchemeIs(chrome::kFileSystemScheme) || url.SchemeIs(chrome::kFtpScheme) || url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme) || + url.SchemeIs(content::kHttpsScheme) || url.SchemeIs(extensions::kExtensionScheme)); } diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 7cdecc5..e313002 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -413,7 +413,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) { const GURL& origin_url(has_redirects ? request.redirects[0] : request.url); if (origin_url.SchemeIs(chrome::kHttpScheme) || - origin_url.SchemeIs(chrome::kHttpsScheme) || + origin_url.SchemeIs(content::kHttpsScheme) || origin_url.SchemeIs(chrome::kFtpScheme)) { std::string host(origin_url.host()); size_t registry_length = diff --git a/chrome/browser/history/in_memory_url_index.cc b/chrome/browser/history/in_memory_url_index.cc index 9eba62e..d9b17e2 100644 --- a/chrome/browser/history/in_memory_url_index.cc +++ b/chrome/browser/history/in_memory_url_index.cc @@ -44,7 +44,7 @@ void InitializeSchemeWhitelist(std::set<std::string>* whitelist) { whitelist->insert(std::string(chrome::kFileScheme)); whitelist->insert(std::string(chrome::kFtpScheme)); whitelist->insert(std::string(chrome::kHttpScheme)); - whitelist->insert(std::string(chrome::kHttpsScheme)); + whitelist->insert(std::string(content::kHttpsScheme)); whitelist->insert(std::string(content::kMailToScheme)); } diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index 4f5a72d..a2eb07d 100644 --- a/chrome/browser/history/url_database.cc +++ b/chrome/browser/history/url_database.cc @@ -312,7 +312,7 @@ bool URLDatabase::AutocompleteForPrefix(const std::string& prefix, bool URLDatabase::IsTypedHost(const std::string& host) { const char* schemes[] = { chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFtpScheme }; URLRows dummy; diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc index 5e04c02..f758a36 100644 --- a/chrome/browser/history/visit_database.cc +++ b/chrome/browser/history/visit_database.cc @@ -491,7 +491,8 @@ bool VisitDatabase::GetRedirectToVisit(VisitID to_visit, bool VisitDatabase::GetVisibleVisitCountToHost(const GURL& url, int* count, base::Time* first_visit) { - if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) + if (!url.SchemeIs(chrome::kHttpScheme) && + !url.SchemeIs(content::kHttpsScheme)) return false; // We need to search for URLs with a matching host/port. One way to query for diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index e049827..e9f38fe 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -505,7 +505,7 @@ void PrerenderContents::DidUpdateFaviconURL( bool PrerenderContents::AddAliasURL(const GURL& url) { const bool http = url.SchemeIs(chrome::kHttpScheme); - const bool https = url.SchemeIs(chrome::kHttpsScheme); + const bool https = url.SchemeIs(content::kHttpsScheme); if (!http && !https) { DCHECK_NE(MATCH_COMPLETE_REPLACEMENT_PENDING, match_complete_status_); Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME); diff --git a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc index cfebd23..7e99d9e 100644 --- a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc +++ b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc @@ -80,7 +80,7 @@ void ChromeRenderViewHostObserver::Navigate(const GURL& url) { if (!predictor_) return; if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && - (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme))) + (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(content::kHttpsScheme))) predictor_->PreconnectUrlAndSubresources(url, GURL()); } diff --git a/chrome/browser/renderer_host/offline_resource_throttle.cc b/chrome/browser/renderer_host/offline_resource_throttle.cc index ceaffca..34f8c42 100644 --- a/chrome/browser/renderer_host/offline_resource_throttle.cc +++ b/chrome/browser/renderer_host/offline_resource_throttle.cc @@ -117,10 +117,9 @@ void OfflineResourceThrottle::OnBlockingPageComplete(bool proceed) { } bool OfflineResourceThrottle::IsRemote(const GURL& url) const { - return !net::IsLocalhost(url.host()) && - (url.SchemeIs(chrome::kFtpScheme) || - url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme)); + return !net::IsLocalhost(url.host()) && (url.SchemeIs(chrome::kFtpScheme) || + url.SchemeIs(chrome::kHttpScheme) || + url.SchemeIs(content::kHttpsScheme)); } bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const { diff --git a/chrome/browser/safe_browsing/database_manager.cc b/chrome/browser/safe_browsing/database_manager.cc index db0963a..ac606f2 100644 --- a/chrome/browser/safe_browsing/database_manager.cc +++ b/chrome/browser/safe_browsing/database_manager.cc @@ -193,7 +193,7 @@ SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { return url.SchemeIs(chrome::kFtpScheme) || url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme); + url.SchemeIs(content::kHttpsScheme); } bool SafeBrowsingDatabaseManager::CheckDownloadUrl( diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc index f42fafb..17b7854 100644 --- a/chrome/browser/search/search.cc +++ b/chrome/browser/search/search.cc @@ -140,7 +140,7 @@ bool MatchesOrigin(const GURL& my_url, const GURL& other_url) { return my_url.host() == other_url.host() && my_url.port() == other_url.port() && (my_url.scheme() == other_url.scheme() || - (my_url.SchemeIs(chrome::kHttpsScheme) && + (my_url.SchemeIs(content::kHttpsScheme) && other_url.SchemeIs(chrome::kHttpScheme))); } @@ -430,7 +430,7 @@ GURL GetInstantURL(Profile* profile, int start_margin) { google_util::StartsWithCommandLineGoogleBaseURL(instant_url)) return instant_url; GURL::Replacements replacements; - const std::string secure_scheme(chrome::kHttpsScheme); + const std::string secure_scheme(content::kHttpsScheme); replacements.SetSchemeStr(secure_scheme); return instant_url.ReplaceComponents(replacements); } diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index a0a7c63..5a0c4af 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -803,7 +803,7 @@ std::string TemplateURLRef::HandleReplacements( search_terms_args_without_aqs.assisted_query_stats.clear(); GURL base_url(ReplaceSearchTermsUsingTermsData( search_terms_args_without_aqs, search_terms_data, NULL)); - if (base_url.SchemeIs(chrome::kHttpsScheme)) { + if (base_url.SchemeIs(content::kHttpsScheme)) { HandleReplacement( "aqs", search_terms_args.assisted_query_stats, *i, &url); } diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc index 64978a7..9fa4c4a 100644 --- a/chrome/browser/search_engines/template_url_parser.cc +++ b/chrome/browser/search_engines/template_url_parser.cc @@ -101,7 +101,7 @@ bool IsHTTPRef(const std::string& url) { return true; GURL gurl(url); return gurl.is_valid() && (gurl.SchemeIs(chrome::kHttpScheme) || - gurl.SchemeIs(chrome::kHttpsScheme)); + gurl.SchemeIs(content::kHttpsScheme)); } } // namespace @@ -259,7 +259,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { context->derive_image_from_url_ = true; } else if (context->image_is_valid_for_favicon_ && image_url.is_valid() && (image_url.SchemeIs(chrome::kHttpScheme) || - image_url.SchemeIs(chrome::kHttpsScheme))) { + image_url.SchemeIs(content::kHttpsScheme))) { context->data_.favicon_url = image_url; } context->image_is_valid_for_favicon_ = false; diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index 55df617..a8e7dcf 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -374,7 +374,7 @@ string16 TemplateURLService::CleanUserInputKeyword(const string16& keyword) { if (result.compare(0, scheme_component.end(), ASCIIToUTF16(chrome::kHttpScheme)) && result.compare(0, scheme_component.end(), - ASCIIToUTF16(chrome::kHttpsScheme))) + ASCIIToUTF16(content::kHttpsScheme))) return string16(); // Include trailing ':'. diff --git a/chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc b/chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc index 00f5da8..0c4ce46 100644 --- a/chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc +++ b/chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc @@ -454,7 +454,7 @@ bool AutofillDialogControllerAndroid::RequestingCreditCardInfo() const { } bool AutofillDialogControllerAndroid::TransmissionWillBeSecure() const { - return source_url_.SchemeIs(chrome::kHttpsScheme); + return source_url_.SchemeIs(content::kHttpsScheme); } void AutofillDialogControllerAndroid::SetAutocheckoutState( diff --git a/chrome/browser/ui/app_list/search/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore_provider.cc index ec8cdd4..3873a219 100644 --- a/chrome/browser/ui/app_list/search/webstore_provider.cc +++ b/chrome/browser/ui/app_list/search/webstore_provider.cc @@ -73,9 +73,8 @@ bool IsSensitiveInput(const string16& query) { // Don't send anything for https except the hostname. Hostnames are OK // because they are visible when the TCP connection is established, but the // specific path may reveal private information. - if (LowerCaseEqualsASCII(query_as_url.scheme(), chrome::kHttpsScheme) && - !query_as_url.path().empty() && - query_as_url.path() != "/") { + if (LowerCaseEqualsASCII(query_as_url.scheme(), content::kHttpsScheme) && + !query_as_url.path().empty() && query_as_url.path() != "/") { return true; } diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc index 3fec283..daa407d 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc @@ -2321,7 +2321,7 @@ bool AutofillDialogControllerImpl::RequestingCreditCardInfo() const { } bool AutofillDialogControllerImpl::TransmissionWillBeSecure() const { - return source_url_.SchemeIs(chrome::kHttpsScheme); + return source_url_.SchemeIs(content::kHttpsScheme); } void AutofillDialogControllerImpl::ShowNewCreditCardBubble( diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index e176b52..d2039b9 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -196,7 +196,7 @@ class TransferHttpsRedirectsContentBrowserClient content::ResourceContext* resource_context, const GURL& current_url, const GURL& new_url) OVERRIDE { - return new_url.SchemeIs(chrome::kHttpsScheme); + return new_url.SchemeIs(content::kHttpsScheme); } }; @@ -871,7 +871,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttps) { base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); GURL https_url(test_server.GetURL("/")); - ASSERT_TRUE(https_url.SchemeIs(chrome::kHttpsScheme)); + ASSERT_TRUE(https_url.SchemeIs(content::kHttpsScheme)); ui_test_utils::NavigateToURL(browser(), https_url); EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); } diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 8ab546d..10c2c99 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -199,7 +199,7 @@ bool IsValidUrl(const GURL& url) { chrome::kFileSystemScheme, chrome::kFtpScheme, chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, extensions::kExtensionScheme, }; diff --git a/chrome/browser/web_resource/promo_resource_service_unittest.cc b/chrome/browser/web_resource/promo_resource_service_unittest.cc index 0f0ae62..7ac89cc 100644 --- a/chrome/browser/web_resource/promo_resource_service_unittest.cc +++ b/chrome/browser/web_resource/promo_resource_service_unittest.cc @@ -530,7 +530,7 @@ TEST_F(PromoResourceServiceTest, PromoServerURLTest) { GURL promo_server_url = NotificationPromo::PromoServerURL(); EXPECT_FALSE(promo_server_url.is_empty()); EXPECT_TRUE(promo_server_url.is_valid()); - EXPECT_TRUE(promo_server_url.SchemeIs(chrome::kHttpsScheme)); + EXPECT_TRUE(promo_server_url.SchemeIs(content::kHttpsScheme)); // TODO(achuith): Test this better. } diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc index 01860c5..d5e971c 100644 --- a/chrome/common/content_settings_pattern.cc +++ b/chrome/common/content_settings_pattern.cc @@ -24,7 +24,7 @@ namespace { std::string GetDefaultPort(const std::string& scheme) { if (scheme == chrome::kHttpScheme) return "80"; - if (scheme == chrome::kHttpsScheme) + if (scheme == content::kHttpsScheme) return "443"; return std::string(); } @@ -244,7 +244,7 @@ bool ContentSettingsPattern::Builder::Validate(const PatternParts& parts) { // Test if the scheme is supported or a wildcard. if (!parts.is_scheme_wildcard && parts.scheme != std::string(chrome::kHttpScheme) && - parts.scheme != std::string(chrome::kHttpsScheme)) { + parts.scheme != std::string(content::kHttpsScheme)) { return false; } return true; @@ -279,7 +279,7 @@ bool ContentSettingsPattern::Builder::LegacyValidate( // Test if the scheme is supported or a wildcard. if (!parts.is_scheme_wildcard && parts.scheme != std::string(chrome::kHttpScheme) && - parts.scheme != std::string(chrome::kHttpsScheme)) { + parts.scheme != std::string(content::kHttpsScheme)) { return false; } return true; @@ -342,15 +342,15 @@ ContentSettingsPattern ContentSettingsPattern::FromURL( } else if (local_url->SchemeIs(chrome::kHttpScheme)) { builder->WithSchemeWildcard()->WithDomainWildcard()->WithHost( local_url->host()); - } else if (local_url->SchemeIs(chrome::kHttpsScheme)) { + } else if (local_url->SchemeIs(content::kHttpsScheme)) { builder->WithScheme(local_url->scheme())->WithDomainWildcard()->WithHost( local_url->host()); } else { // Unsupported scheme } if (local_url->port().empty()) { - if (local_url->SchemeIs(chrome::kHttpsScheme)) - builder->WithPort(GetDefaultPort(chrome::kHttpsScheme)); + if (local_url->SchemeIs(content::kHttpsScheme)) + builder->WithPort(GetDefaultPort(content::kHttpsScheme)); else builder->WithPortWildcard(); } else { diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc index f3df304..0c112fe 100644 --- a/chrome/renderer/extensions/dispatcher.cc +++ b/chrome/renderer/extensions/dispatcher.cc @@ -1276,7 +1276,7 @@ void Dispatcher::AddOrRemoveOriginPermissions( i != origins.end(); ++i) { const char* schemes[] = { chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFileScheme, chrome::kChromeUIScheme, }; diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc index 044859a..0b53c17 100644 --- a/chrome/renderer/extensions/user_script_slave.cc +++ b/chrome/renderer/extensions/user_script_slave.cc @@ -105,7 +105,7 @@ void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id, i != permissions.end(); ++i) { const char* schemes[] = { chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFileScheme, chrome::kChromeUIScheme, }; diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc index 11a61c2..0c7c1ea 100644 --- a/chrome/utility/importer/ie_importer_win.cc +++ b/chrome/utility/importer/ie_importer_win.cc @@ -471,7 +471,7 @@ void IEImporter::ImportFavorites() { void IEImporter::ImportHistory() { const std::string kSchemes[] = {chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFtpScheme, chrome::kFileScheme}; int total_schemes = arraysize(kSchemes); @@ -605,7 +605,7 @@ void IEImporter::ImportPasswordsIE6() { GURL url(ac_list[i].key.c_str()); if (!(LowerCaseEqualsASCII(url.scheme(), chrome::kHttpScheme) || - LowerCaseEqualsASCII(url.scheme(), chrome::kHttpsScheme))) { + LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { continue; } diff --git a/chrome_frame/navigation_constraints.cc b/chrome_frame/navigation_constraints.cc index 33f4216..92524e4 100644 --- a/chrome_frame/navigation_constraints.cc +++ b/chrome_frame/navigation_constraints.cc @@ -26,8 +26,7 @@ bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) { if (!url.is_valid()) return false; - if (url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme)) + if (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(content::kHttpsScheme)) return true; // Additional checking for view-source. Allow only http and https @@ -35,7 +34,7 @@ bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) { if (url.SchemeIs(content::kViewSourceScheme)) { GURL sub_url(url.path()); if (sub_url.SchemeIs(chrome::kHttpScheme) || - sub_url.SchemeIs(chrome::kHttpsScheme)) + sub_url.SchemeIs(content::kHttpsScheme)) return true; } diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 02101ed..940ab1f 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -1002,7 +1002,7 @@ bool IsValidUrlScheme(const GURL& url, bool is_privileged) { return false; if (url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme) || + url.SchemeIs(content::kHttpsScheme) || url.SchemeIs(chrome::kAboutScheme)) return true; @@ -1011,7 +1011,7 @@ bool IsValidUrlScheme(const GURL& url, bool is_privileged) { if (url.SchemeIs(content::kViewSourceScheme)) { GURL sub_url(url.path()); if (sub_url.SchemeIs(chrome::kHttpScheme) || - sub_url.SchemeIs(chrome::kHttpsScheme)) + sub_url.SchemeIs(content::kHttpsScheme)) return true; else return false; diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index ca4c46b..615390e 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc @@ -322,7 +322,7 @@ void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame, content::SSLStatus ssl_status = render_view()->GetSSLStatusOfFrame(frame); FormData form_data; if (!in_flight_request_form_.isNull() || - (url.SchemeIs(chrome::kHttpsScheme) && + (url.SchemeIs(content::kHttpsScheme) && (net::IsCertStatusError(ssl_status.cert_status) || net::IsCertStatusMinorError(ssl_status.cert_status))) || !WebFormElementToFormData(form, diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 4c66699..2d2c677 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -129,7 +129,7 @@ bool SectionIsAutofilled(const FormStructure& form_structure, } bool FormIsHTTPS(const FormStructure& form) { - return form.source_url().SchemeIs(chrome::kHttpsScheme); + return form.source_url().SchemeIs(content::kHttpsScheme); } // Uses the existing personal data in |profiles| and |credit_cards| to determine diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc index 56efe6b..1c06fdd 100644 --- a/content/browser/browser_url_handler_impl.cc +++ b/content/browser/browser_url_handler_impl.cc @@ -13,8 +13,7 @@ namespace content { // Handles rewriting view-source URLs for what we'll actually load. -static bool HandleViewSource(GURL* url, - BrowserContext* browser_context) { +static bool HandleViewSource(GURL* url, BrowserContext* browser_context) { if (url->SchemeIs(kViewSourceScheme)) { // Load the inner URL instead. *url = GURL(url->path()); @@ -22,7 +21,7 @@ static bool HandleViewSource(GURL* url, // Bug 26129: limit view-source to view the content and not any // other kind of 'active' url scheme like 'javascript' or 'data'. static const char* const allowed_sub_schemes[] = { - chrome::kHttpScheme, chrome::kHttpsScheme, chrome::kFtpScheme, + chrome::kHttpScheme, kHttpsScheme, chrome::kFtpScheme, chrome::kChromeDevToolsScheme, chrome::kChromeUIScheme, chrome::kFileScheme, chrome::kFileSystemScheme }; diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index b47cbd2..c3533ad 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc @@ -280,7 +280,7 @@ class ChildProcessSecurityPolicyImpl::SecurityState { ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() { // We know about these schemes and believe them to be safe. RegisterWebSafeScheme(chrome::kHttpScheme); - RegisterWebSafeScheme(chrome::kHttpsScheme); + RegisterWebSafeScheme(kHttpsScheme); RegisterWebSafeScheme(chrome::kFtpScheme); RegisterWebSafeScheme(chrome::kDataScheme); RegisterWebSafeScheme("feed"); diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index 24696489..d945fdd 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -100,7 +100,7 @@ TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { ChildProcessSecurityPolicyImpl::GetInstance(); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpScheme)); - EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpsScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(kHttpsScheme)); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kFtpScheme)); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kDataScheme)); EXPECT_TRUE(p->IsWebSafeScheme("feed")); diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc index c3e9140..c8da805 100644 --- a/content/browser/web_contents/navigation_controller_impl.cc +++ b/content/browser/web_contents/navigation_controller_impl.cc @@ -638,7 +638,7 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) { break; case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: if (!params.url.SchemeIs(chrome::kHttpScheme) && - !params.url.SchemeIs(chrome::kHttpsScheme)) { + !params.url.SchemeIs(kHttpsScheme)) { NOTREACHED() << "Http post load must use http(s) scheme."; return; } diff --git a/content/common/savable_url_schemes.cc b/content/common/savable_url_schemes.cc index 0e2c37e..c37b78c 100644 --- a/content/common/savable_url_schemes.cc +++ b/content/common/savable_url_schemes.cc @@ -8,11 +8,13 @@ #include "content/public/common/url_constants.h" +namespace content { + namespace { const char* const kDefaultSavableSchemes[] = { chrome::kHttpScheme, - chrome::kHttpsScheme, + kHttpsScheme, chrome::kFileScheme, chrome::kFileSystemScheme, chrome::kFtpScheme, @@ -26,8 +28,6 @@ const char* const* g_savable_schemes = kDefaultSavableSchemes; } // namespace -namespace content { - const char* const* GetSavableSchemesInternal() { return g_savable_schemes; } diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index f411f30..0988d68 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -321,7 +321,7 @@ void WebPluginProxy::HandleURLRequest(const char* url, WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); if (!request_url.SchemeIs(chrome::kHttpScheme) && - !request_url.SchemeIs(chrome::kHttpsScheme) && + !request_url.SchemeIs(kHttpsScheme) && !request_url.SchemeIs(chrome::kFtpScheme)) { return; } diff --git a/content/public/common/url_constants.cc b/content/public/common/url_constants.cc index e380faa..e1d9c01 100644 --- a/content/public/common/url_constants.cc +++ b/content/public/common/url_constants.cc @@ -20,11 +20,11 @@ const char kFileSystemScheme[] = "filesystem"; const char kFtpScheme[] = "ftp"; const char kGuestScheme[] = "chrome-guest"; const char kHttpScheme[] = "http"; -const char kHttpsScheme[] = "https"; } // namespace chrome namespace content { +const char kHttpsScheme[] = "https"; const char kJavaScriptScheme[] = "javascript"; const char kMailToScheme[] = "mailto"; const char kMetadataScheme[] = "metadata"; diff --git a/content/public/common/url_constants.h b/content/public/common/url_constants.h index 68a7ac4..b6d4418 100644 --- a/content/public/common/url_constants.h +++ b/content/public/common/url_constants.h @@ -26,11 +26,11 @@ CONTENT_EXPORT extern const char kFileSystemScheme[]; CONTENT_EXPORT extern const char kFtpScheme[]; CONTENT_EXPORT extern const char kGuestScheme[]; CONTENT_EXPORT extern const char kHttpScheme[]; -CONTENT_EXPORT extern const char kHttpsScheme[]; } // namespace chrome namespace content { +CONTENT_EXPORT extern const char kHttpsScheme[]; CONTENT_EXPORT extern const char kJavaScriptScheme[]; CONTENT_EXPORT extern const char kMailToScheme[]; CONTENT_EXPORT extern const char kMetadataScheme[]; diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 32f323f..6a0e601 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -518,7 +518,7 @@ static bool IsNonLocalTopLevelNavigation(const GURL& url, // 2. The origin of the url and the opener is the same in which case the // opener relationship is maintained. // 3. Reloads/form submits/back forward navigations - if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) + if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(kHttpsScheme)) return false; if (type != WebKit::WebNavigationTypeReload && @@ -6543,5 +6543,4 @@ void RenderViewImpl::DidStopLoadingIcons() { SendUpdateFaviconURL(urls); } - } // namespace content diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc index 5400567..93b3270 100644 --- a/extensions/common/url_pattern.cc +++ b/extensions/common/url_pattern.cc @@ -21,7 +21,7 @@ namespace { // Note: keep this array in sync with kValidSchemeMasks. const char* kValidSchemes[] = { chrome::kHttpScheme, - chrome::kHttpsScheme, + content::kHttpsScheme, chrome::kFileScheme, chrome::kFtpScheme, chrome::kChromeUIScheme, |