diff options
52 files changed, 71 insertions, 70 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 df68b7a..6f4c365 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 @@ -234,7 +234,7 @@ void AwResourceDispatcherHostDelegate::RequestBeginning( // embedder. (resource_type == ResourceType::MAIN_FRAME || (resource_type == ResourceType::SUB_FRAME && - !request->url().SchemeIs(chrome::kHttpScheme) && + !request->url().SchemeIs(content::kHttpScheme) && !request->url().SchemeIs(content::kHttpsScheme))); if (allow_intercepting) { throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor( diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index c1fdf54..0ddfa5c 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -172,7 +172,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // (e.g. "ftp" or "view-source") but I'll wait to spend the effort on that // until I run into some cases that really need it. if (parts->scheme.is_nonempty() && - !LowerCaseEqualsASCII(parsed_scheme, chrome::kHttpScheme) && + !LowerCaseEqualsASCII(parsed_scheme, content::kHttpScheme) && !LowerCaseEqualsASCII(parsed_scheme, content::kHttpsScheme)) { // See if we know how to handle the URL internally. if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme))) @@ -208,7 +208,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // We don't know about this scheme. It might be that the user typed a // URL of the form "username:password@foo.com". const string16 http_scheme_prefix = - ASCIIToUTF16(std::string(chrome::kHttpScheme) + + ASCIIToUTF16(std::string(content::kHttpScheme) + content::kStandardSchemeSeparator); url_parse::Parsed http_parts; string16 http_scheme; @@ -216,7 +216,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( Type http_type = Parse(http_scheme_prefix + text, desired_tld, &http_parts, &http_scheme, &http_canonicalized_url); - DCHECK_EQ(std::string(chrome::kHttpScheme), UTF16ToUTF8(http_scheme)); + DCHECK_EQ(std::string(content::kHttpScheme), UTF16ToUTF8(http_scheme)); if (http_type == URL && http_parts.username.is_nonempty() && diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index ae89aa0..3346d35 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -378,8 +378,8 @@ void AutocompleteMatch::ComputeStrippedDestinationURL(Profile* profile) { // Replace https protocol with http protocol. if (stripped_destination_url.SchemeIs(content::kHttpsScheme)) { replacements.SetScheme( - chrome::kHttpScheme, - url_parse::Component(0, strlen(chrome::kHttpScheme))); + content::kHttpScheme, + url_parse::Component(0, strlen(content::kHttpScheme))); needs_replacement = true; } diff --git a/chrome/browser/autocomplete/autocomplete_provider.cc b/chrome/browser/autocomplete/autocomplete_provider.cc index 873bbac..15af9ab 100644 --- a/chrome/browser/autocomplete/autocomplete_provider.cc +++ b/chrome/browser/autocomplete/autocomplete_provider.cc @@ -129,7 +129,7 @@ bool AutocompleteProvider::HasHTTPScheme(const string16& input) { if (url_util::FindAndCompareScheme(utf8_input, content::kViewSourceScheme, &scheme)) utf8_input.erase(0, scheme.end() + 1); - return url_util::FindAndCompareScheme(utf8_input, chrome::kHttpScheme, NULL); + return url_util::FindAndCompareScheme(utf8_input, content::kHttpScheme, NULL); } void AutocompleteProvider::UpdateStarredStateOfMatches() { diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc index 90e25fa..32776b9 100644 --- a/chrome/browser/autocomplete/history_provider.cc +++ b/chrome/browser/autocomplete/history_provider.cc @@ -138,11 +138,11 @@ size_t HistoryProvider::TrimHttpPrefix(string16* url) { if (!HasHTTPScheme(*url)) return 0; size_t scheme_pos = - url->find(ASCIIToUTF16(chrome::kHttpScheme) + char16(':')); + url->find(ASCIIToUTF16(content::kHttpScheme) + char16(':')); DCHECK_NE(string16::npos, scheme_pos); // Erase scheme plus up to two slashes. - size_t prefix_end = scheme_pos + strlen(chrome::kHttpScheme) + 1; + size_t prefix_end = scheme_pos + strlen(content::kHttpScheme) + 1; const size_t after_slashes = std::min(url->length(), prefix_end + 2); while ((prefix_end < after_slashes) && ((*url)[prefix_end] == '/')) ++prefix_end; diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index cf996fb..a29f827 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -795,7 +795,7 @@ bool HistoryURLProvider::CanFindIntranetURL( // input's text and parts between Parse() and here, it seems better to be // paranoid and check. if ((input.type() != AutocompleteInput::UNKNOWN) || - !LowerCaseEqualsASCII(input.scheme(), chrome::kHttpScheme) || + !LowerCaseEqualsASCII(input.scheme(), content::kHttpScheme) || !input.parts().host.is_nonempty()) return false; const std::string host(UTF16ToUTF8( diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 5b366b6..e222ad0 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -745,7 +745,7 @@ bool SearchProvider::IsQuerySuitableForSuggest() const { // and happens to currently be invalid -- in which case we again want to run // 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) && + if (!LowerCaseEqualsASCII(input_.scheme(), content::kHttpScheme) && !LowerCaseEqualsASCII(input_.scheme(), content::kHttpsScheme) && !LowerCaseEqualsASCII(input_.scheme(), chrome::kFtpScheme)) return (input_.type() == AutocompleteInput::QUERY); diff --git a/chrome/browser/autocomplete/zero_suggest_provider.cc b/chrome/browser/autocomplete/zero_suggest_provider.cc index 6680bb9..ead3844 100644 --- a/chrome/browser/autocomplete/zero_suggest_provider.cc +++ b/chrome/browser/autocomplete/zero_suggest_provider.cc @@ -222,7 +222,7 @@ bool ZeroSuggestProvider::ShouldSendURL(const GURL& url) const { // Only allow HTTP URLs or Google HTTPS URLs (including Google search // result pages). For the latter case, Google was already sent the HTTPS // URLs when requesting the page, so the information is just re-sent. - return (url.scheme() == chrome::kHttpScheme) || + return (url.scheme() == content::kHttpScheme) || google_util::IsGoogleDomainUrl(url, google_util::ALLOW_SUBDOMAIN, google_util::ALLOW_NON_STANDARD_PORTS); } diff --git a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc index 26f04ae..0d49593 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc @@ -58,7 +58,7 @@ class BrowsingDataHelperTest : public testing::Test { }; TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreWebSafe) { - EXPECT_TRUE(IsWebScheme(chrome::kHttpScheme)); + EXPECT_TRUE(IsWebScheme(content::kHttpScheme)); EXPECT_TRUE(IsWebScheme(content::kHttpsScheme)); EXPECT_TRUE(IsWebScheme(chrome::kFtpScheme)); EXPECT_TRUE(IsWebScheme(chrome::kDataScheme)); @@ -82,7 +82,7 @@ TEST_F(BrowsingDataHelperTest, ChromeSchemesAreNotWebSafe) { } TEST_F(BrowsingDataHelperTest, WebSafeSchemesAreNotExtensions) { - EXPECT_FALSE(IsExtensionScheme(chrome::kHttpScheme)); + EXPECT_FALSE(IsExtensionScheme(content::kHttpScheme)); EXPECT_FALSE(IsExtensionScheme(content::kHttpsScheme)); EXPECT_FALSE(IsExtensionScheme(chrome::kFtpScheme)); EXPECT_FALSE(IsExtensionScheme(chrome::kDataScheme)); diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index f894e75..756956c 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc @@ -1082,7 +1082,7 @@ void CookiesTreeModel::PopulateCookieInfoWithFilter( domain = domain.substr(1); // We treat secure cookies just the same as normal ones. - source_string = std::string(chrome::kHttpScheme) + + source_string = std::string(content::kHttpScheme) + content::kStandardSchemeSeparator + domain + "/"; } diff --git a/chrome/browser/content_settings/local_shared_objects_container.cc b/chrome/browser/content_settings/local_shared_objects_container.cc index d4a996d..da98b1b 100644 --- a/chrome/browser/content_settings/local_shared_objects_container.cc +++ b/chrome/browser/content_settings/local_shared_objects_container.cc @@ -98,7 +98,7 @@ size_t LocalSharedObjectsContainer::GetObjectCountForDomain( // The |domain_url| is only created in order to use the // SamePublicDomainOrHost method below. It does not matter which scheme is // used as the scheme is ignored by the SamePublicDomainOrHost method. - GURL domain_url(std::string(chrome::kHttpScheme) + + GURL domain_url(std::string(content::kHttpScheme) + content::kStandardSchemeSeparator + cookie_domain); if (SamePublicDomainOrHost(origin, domain_url)) ++count; 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 133e330..29af76e 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc @@ -43,7 +43,7 @@ COMPILE_ASSERT(arraysize(kContentSettingNames) <= // TODO(bauerb): Move this someplace where it can be reused. std::string GetDefaultPort(const std::string& scheme) { - if (scheme == chrome::kHttpScheme) + if (scheme == content::kHttpScheme) return "80"; if (scheme == content::kHttpsScheme) return "443"; diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc index 2d3e67e..8ac5990 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() ? content::kHttpsScheme : chrome::kHttpScheme; + cookie.IsSecure() ? content::kHttpsScheme : content::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 8df798b..aca20fb 100644 --- a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc +++ b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc @@ -15,7 +15,7 @@ namespace { // URL schemes for which we'll send events. const char* kValidSchemes[] = { chrome::kChromeUIScheme, - chrome::kHttpScheme, + content::kHttpScheme, content::kHttpsScheme, chrome::kFileScheme, chrome::kFtpScheme, 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 4bad267..d483ce5 100644 --- a/chrome/browser/extensions/api/web_request/web_request_permissions.cc +++ b/chrome/browser/extensions/api/web_request/web_request_permissions.cc @@ -70,7 +70,7 @@ bool HasWebRequestScheme(const GURL& url) { url.SchemeIs(chrome::kFileScheme) || url.SchemeIs(chrome::kFileSystemScheme) || url.SchemeIs(chrome::kFtpScheme) || - url.SchemeIs(chrome::kHttpScheme) || + url.SchemeIs(content::kHttpScheme) || 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 21ca31d..3913d1d 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -412,7 +412,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) { !is_keyword_generated) { const GURL& origin_url(has_redirects ? request.redirects[0] : request.url); - if (origin_url.SchemeIs(chrome::kHttpScheme) || + if (origin_url.SchemeIs(content::kHttpScheme) || origin_url.SchemeIs(content::kHttpsScheme) || origin_url.SchemeIs(chrome::kFtpScheme)) { std::string host(origin_url.host()); diff --git a/chrome/browser/history/in_memory_url_index.cc b/chrome/browser/history/in_memory_url_index.cc index d9b17e2..f859da4 100644 --- a/chrome/browser/history/in_memory_url_index.cc +++ b/chrome/browser/history/in_memory_url_index.cc @@ -43,7 +43,7 @@ void InitializeSchemeWhitelist(std::set<std::string>* whitelist) { whitelist->insert(std::string(chrome::kChromeUIScheme)); whitelist->insert(std::string(chrome::kFileScheme)); whitelist->insert(std::string(chrome::kFtpScheme)); - whitelist->insert(std::string(chrome::kHttpScheme)); + whitelist->insert(std::string(content::kHttpScheme)); 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 e484dd2..1af9f40 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, + content::kHttpScheme, content::kHttpsScheme, chrome::kFtpScheme }; diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc index f758a36..d513efb 100644 --- a/chrome/browser/history/visit_database.cc +++ b/chrome/browser/history/visit_database.cc @@ -491,7 +491,7 @@ bool VisitDatabase::GetRedirectToVisit(VisitID to_visit, bool VisitDatabase::GetVisibleVisitCountToHost(const GURL& url, int* count, base::Time* first_visit) { - if (!url.SchemeIs(chrome::kHttpScheme) && + if (!url.SchemeIs(content::kHttpScheme) && !url.SchemeIs(content::kHttpsScheme)) return false; diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc index d0f3865..ea5bd89 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor.cc @@ -178,17 +178,17 @@ bool ResourcePrefetchPredictor::ShouldRecordRedirect( // static bool ResourcePrefetchPredictor::IsHandledMainPage(net::URLRequest* request) { - return request->original_url().scheme() == chrome::kHttpScheme; + return request->original_url().scheme() == content::kHttpScheme; } // static bool ResourcePrefetchPredictor::IsHandledSubresource( net::URLRequest* response) { int resource_status = 0; - if (response->first_party_for_cookies().scheme() != chrome::kHttpScheme) + if (response->first_party_for_cookies().scheme() != content::kHttpScheme) resource_status |= RESOURCE_STATUS_NOT_HTTP_PAGE; - if (response->original_url().scheme() != chrome::kHttpScheme) + if (response->original_url().scheme() != content::kHttpScheme) resource_status |= RESOURCE_STATUS_NOT_HTTP_RESOURCE; std::string mime_type; diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index e9f38fe..61570b6 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -504,7 +504,7 @@ void PrerenderContents::DidUpdateFaviconURL( } bool PrerenderContents::AddAliasURL(const GURL& url) { - const bool http = url.SchemeIs(chrome::kHttpScheme); + const bool http = url.SchemeIs(content::kHttpScheme); const bool https = url.SchemeIs(content::kHttpsScheme); if (!http && !https) { DCHECK_NE(MATCH_COMPLETE_REPLACEMENT_PENDING, match_complete_status_); 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 e410cbb..2a6f67a 100644 --- a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc +++ b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc @@ -81,7 +81,8 @@ void ChromeRenderViewHostObserver::Navigate(const GURL& url) { if (!predictor_) return; if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && - (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(content::kHttpsScheme))) + (url.SchemeIs(content::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 399d15db..28f9259 100644 --- a/chrome/browser/renderer_host/offline_resource_throttle.cc +++ b/chrome/browser/renderer_host/offline_resource_throttle.cc @@ -115,7 +115,7 @@ 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(content::kHttpScheme) || url.SchemeIs(content::kHttpsScheme)); } diff --git a/chrome/browser/safe_browsing/database_manager.cc b/chrome/browser/safe_browsing/database_manager.cc index b0d8ca98..fa4c296 100644 --- a/chrome/browser/safe_browsing/database_manager.cc +++ b/chrome/browser/safe_browsing/database_manager.cc @@ -202,7 +202,7 @@ SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { bool SafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { return url.SchemeIs(chrome::kFtpScheme) || - url.SchemeIs(chrome::kHttpScheme) || + url.SchemeIs(content::kHttpScheme) || url.SchemeIs(content::kHttpsScheme); } diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 51e7536..241675e 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -242,7 +242,7 @@ SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() { return (!web_contents_->GetBrowserContext()->IsOffTheRecord() && - web_contents_->GetURL().SchemeIs(chrome::kHttpScheme)); + web_contents_->GetURL().SchemeIs(content::kHttpScheme)); } SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc index 2333936..c1fad55 100644 --- a/chrome/browser/safe_browsing/safe_browsing_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_test.cc @@ -91,7 +91,7 @@ bool ParsePhishingUrls(const std::string& data, << urls[i]; return false; } - phishing_url.url = std::string(chrome::kHttpScheme) + + phishing_url.url = std::string(content::kHttpScheme) + "://" + record_parts[0]; phishing_url.list_name = record_parts[1]; if (record_parts[2] == "yes") { diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc index cdda21a..0ec4046 100644 --- a/chrome/browser/search/search.cc +++ b/chrome/browser/search/search.cc @@ -128,7 +128,7 @@ bool MatchesOrigin(const GURL& my_url, const GURL& other_url) { my_url.port() == other_url.port() && (my_url.scheme() == other_url.scheme() || (my_url.SchemeIs(content::kHttpsScheme) && - other_url.SchemeIs(chrome::kHttpScheme))); + other_url.SchemeIs(content::kHttpScheme))); } bool MatchesAnySearchURL(const GURL& url, TemplateURL* template_url) { diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc index 9fa4c4a..69532d2 100644 --- a/chrome/browser/search_engines/template_url_parser.cc +++ b/chrome/browser/search_engines/template_url_parser.cc @@ -100,7 +100,7 @@ bool IsHTTPRef(const std::string& url) { if (url.empty()) return true; GURL gurl(url); - return gurl.is_valid() && (gurl.SchemeIs(chrome::kHttpScheme) || + return gurl.is_valid() && (gurl.SchemeIs(content::kHttpScheme) || gurl.SchemeIs(content::kHttpsScheme)); } @@ -258,7 +258,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { // favicon from the URL. 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(content::kHttpScheme) || image_url.SchemeIs(content::kHttpsScheme))) { context->data_.favicon_url = image_url; } diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index a8e7dcf..63a4808 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -372,7 +372,7 @@ string16 TemplateURLService::CleanUserInputKeyword(const string16& keyword) { // type a web address, but rather an FTP, file:, or other scheme URL, or a // search query with some sort of initial operator (e.g. "site:"). if (result.compare(0, scheme_component.end(), - ASCIIToUTF16(chrome::kHttpScheme)) && + ASCIIToUTF16(content::kHttpScheme)) && result.compare(0, scheme_component.end(), ASCIIToUTF16(content::kHttpsScheme))) return string16(); diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 402504c5..b283d31 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -942,7 +942,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { ASSERT_TRUE(test_server()->Start()); GURL http_url(test_server()->GetURL(std::string())); - ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); + ASSERT_TRUE(http_url.SchemeIs(content::kHttpScheme)); ui_test_utils::NavigateToURL(browser(), http_url); EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); } @@ -1002,7 +1002,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_ConvertTabToAppShortcut) { ASSERT_TRUE(test_server()->Start()); GURL http_url(test_server()->GetURL(std::string())); - ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); + ASSERT_TRUE(http_url.SchemeIs(content::kHttpScheme)); ASSERT_EQ(1, browser()->tab_strip_model()->count()); WebContents* initial_tab = browser()->tab_strip_model()->GetWebContentsAt(0); diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc index 7743ca5..0893a93 100644 --- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc +++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc @@ -435,10 +435,10 @@ void OmniboxEditModel::AdjustTextForCopy(int sel_min, // entire host, and the user hasn't edited the host or manually removed the // scheme. GURL perm_url(PermanentURL()); - if (perm_url.SchemeIs(chrome::kHttpScheme) && - url->SchemeIs(chrome::kHttpScheme) && perm_url.host() == url->host()) { + if (perm_url.SchemeIs(content::kHttpScheme) && + url->SchemeIs(content::kHttpScheme) && perm_url.host() == url->host()) { *write_url = true; - string16 http = ASCIIToUTF16(chrome::kHttpScheme) + + string16 http = ASCIIToUTF16(content::kHttpScheme) + ASCIIToUTF16(content::kStandardSchemeSeparator); if (text->compare(0, http.length(), http) != 0) *text = http + *text; diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc index d414510..dada154 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -54,7 +54,7 @@ string16 GenerateKeywordFromNavigationEntry(const NavigationEntry* entry) { // If we relax the path constraint, we need to be sure to sanitize the path // elements and update AutocompletePopup to look for keywords using the path. // See http://b/issue?id=863583. - if (!url.SchemeIs(chrome::kHttpScheme) || (url.path().length() > 1)) + if (!url.SchemeIs(content::kHttpScheme) || (url.path().length() > 1)) return string16(); return TemplateURLService::GenerateKeyword(url); diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 103090d..072bbf0 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -198,7 +198,7 @@ bool IsValidUrl(const GURL& url) { chrome::kFileScheme, chrome::kFileSystemScheme, chrome::kFtpScheme, - chrome::kHttpScheme, + content::kHttpScheme, content::kHttpsScheme, extensions::kExtensionScheme, }; diff --git a/chrome/common/content_settings_helper.cc b/chrome/common/content_settings_helper.cc index f43bf80..af80870 100644 --- a/chrome/common/content_settings_helper.cc +++ b/chrome/common/content_settings_helper.cc @@ -15,7 +15,7 @@ std::string OriginToString(const GURL& origin) { std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED ? ":" + origin.port() : std::string()); - std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) + std::string scheme_component(!origin.SchemeIs(content::kHttpScheme) ? origin.scheme() + content::kStandardSchemeSeparator : std::string()); diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc index d5e971c..34272b0 100644 --- a/chrome/common/content_settings_pattern.cc +++ b/chrome/common/content_settings_pattern.cc @@ -22,7 +22,7 @@ namespace { std::string GetDefaultPort(const std::string& scheme) { - if (scheme == chrome::kHttpScheme) + if (scheme == content::kHttpScheme) return "80"; if (scheme == content::kHttpsScheme) return "443"; @@ -243,7 +243,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(content::kHttpScheme) && parts.scheme != std::string(content::kHttpsScheme)) { return false; } @@ -278,7 +278,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(content::kHttpScheme) && parts.scheme != std::string(content::kHttpsScheme)) { return false; } @@ -339,7 +339,7 @@ ContentSettingsPattern ContentSettingsPattern::FromURL( // also have a "http" scheme. if (local_url->HostIsIPAddress()) { builder->WithScheme(local_url->scheme())->WithHost(local_url->host()); - } else if (local_url->SchemeIs(chrome::kHttpScheme)) { + } else if (local_url->SchemeIs(content::kHttpScheme)) { builder->WithSchemeWildcard()->WithDomainWildcard()->WithHost( local_url->host()); } else if (local_url->SchemeIs(content::kHttpsScheme)) { diff --git a/chrome/common/net/url_fixer_upper.cc b/chrome/common/net/url_fixer_upper.cc index 45a4786..bcbc80b 100644 --- a/chrome/common/net/url_fixer_upper.cc +++ b/chrome/common/net/url_fixer_upper.cc @@ -419,7 +419,7 @@ std::string SegmentURLInternal(std::string* text, url_parse::Parsed* parts) { // Couldn't determine the scheme, so just pick one. parts->scheme.reset(); scheme.assign(StartsWithASCII(*text, "ftp.", false) ? - chrome::kFtpScheme : chrome::kHttpScheme); + chrome::kFtpScheme : content::kHttpScheme); } } diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc index 931d103..ce2408f 100644 --- a/chrome/renderer/extensions/dispatcher.cc +++ b/chrome/renderer/extensions/dispatcher.cc @@ -1282,7 +1282,7 @@ void Dispatcher::AddOrRemoveOriginPermissions( for (URLPatternSet::const_iterator i = origins.begin(); i != origins.end(); ++i) { const char* schemes[] = { - chrome::kHttpScheme, + content::kHttpScheme, 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 0b53c17..16af7a3 100644 --- a/chrome/renderer/extensions/user_script_slave.cc +++ b/chrome/renderer/extensions/user_script_slave.cc @@ -104,7 +104,7 @@ void UserScriptSlave::InitializeIsolatedWorld(int isolated_world_id, for (URLPatternSet::const_iterator i = permissions.begin(); i != permissions.end(); ++i) { const char* schemes[] = { - chrome::kHttpScheme, + content::kHttpScheme, content::kHttpsScheme, chrome::kFileScheme, chrome::kChromeUIScheme, diff --git a/chrome/renderer/safe_browsing/phishing_classifier.cc b/chrome/renderer/safe_browsing/phishing_classifier.cc index 8f4182b..a303284 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier.cc @@ -118,7 +118,7 @@ void PhishingClassifier::BeginFeatureExtraction() { // Check whether the URL is one that we should classify. // Currently, we only classify http: URLs that are GET requests. GURL url(frame->document().url()); - if (!url.SchemeIs(chrome::kHttpScheme)) { + if (!url.SchemeIs(content::kHttpScheme)) { RunFailureCallback(); return; } diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc index 9dd760a..3ca85a3 100644 --- a/chrome/utility/importer/ie_importer_win.cc +++ b/chrome/utility/importer/ie_importer_win.cc @@ -469,7 +469,7 @@ void IEImporter::ImportFavorites() { } void IEImporter::ImportHistory() { - const std::string kSchemes[] = {chrome::kHttpScheme, + const std::string kSchemes[] = {content::kHttpScheme, content::kHttpsScheme, chrome::kFtpScheme, chrome::kFileScheme}; @@ -603,7 +603,7 @@ void IEImporter::ImportPasswordsIE6() { continue; GURL url(ac_list[i].key.c_str()); - if (!(LowerCaseEqualsASCII(url.scheme(), chrome::kHttpScheme) || + if (!(LowerCaseEqualsASCII(url.scheme(), content::kHttpScheme) || LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { continue; } diff --git a/chrome_frame/navigation_constraints.cc b/chrome_frame/navigation_constraints.cc index 92524e4..59efb0e 100644 --- a/chrome_frame/navigation_constraints.cc +++ b/chrome_frame/navigation_constraints.cc @@ -26,14 +26,14 @@ bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) { if (!url.is_valid()) return false; - if (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(content::kHttpsScheme)) + if (url.SchemeIs(content::kHttpScheme) || url.SchemeIs(content::kHttpsScheme)) return true; // Additional checking for view-source. Allow only http and https // URLs in view source. if (url.SchemeIs(content::kViewSourceScheme)) { GURL sub_url(url.path()); - if (sub_url.SchemeIs(chrome::kHttpScheme) || + if (sub_url.SchemeIs(content::kHttpScheme) || sub_url.SchemeIs(content::kHttpsScheme)) return true; } diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 940ab1f..7c8b713 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -1001,7 +1001,7 @@ bool IsValidUrlScheme(const GURL& url, bool is_privileged) { if (url.is_empty()) return false; - if (url.SchemeIs(chrome::kHttpScheme) || + if (url.SchemeIs(content::kHttpScheme) || url.SchemeIs(content::kHttpsScheme) || url.SchemeIs(chrome::kAboutScheme)) return true; @@ -1010,7 +1010,7 @@ bool IsValidUrlScheme(const GURL& url, bool is_privileged) { // URLs in view source. if (url.SchemeIs(content::kViewSourceScheme)) { GURL sub_url(url.path()); - if (sub_url.SchemeIs(chrome::kHttpScheme) || + if (sub_url.SchemeIs(content::kHttpScheme) || sub_url.SchemeIs(content::kHttpsScheme)) return true; else diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc index 1c06fdd..5ff1309 100644 --- a/content/browser/browser_url_handler_impl.cc +++ b/content/browser/browser_url_handler_impl.cc @@ -21,7 +21,7 @@ static bool HandleViewSource(GURL* url, BrowserContext* browser_context) { // 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, kHttpsScheme, chrome::kFtpScheme, + 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 eaba768..0516e1c 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc @@ -291,7 +291,7 @@ class ChildProcessSecurityPolicyImpl::SecurityState { ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() { // We know about these schemes and believe them to be safe. - RegisterWebSafeScheme(chrome::kHttpScheme); + RegisterWebSafeScheme(kHttpScheme); RegisterWebSafeScheme(kHttpsScheme); RegisterWebSafeScheme(chrome::kFtpScheme); RegisterWebSafeScheme(chrome::kDataScheme); diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index d945fdd..247a74f6 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -99,7 +99,7 @@ TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { ChildProcessSecurityPolicyImpl* p = ChildProcessSecurityPolicyImpl::GetInstance(); - EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(kHttpScheme)); EXPECT_TRUE(p->IsWebSafeScheme(kHttpsScheme)); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kFtpScheme)); EXPECT_TRUE(p->IsWebSafeScheme(chrome::kDataScheme)); diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc index fe5e52d..5f741fd 100644 --- a/content/browser/web_contents/navigation_controller_impl.cc +++ b/content/browser/web_contents/navigation_controller_impl.cc @@ -637,7 +637,7 @@ void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) { case LOAD_TYPE_DEFAULT: break; case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: - if (!params.url.SchemeIs(chrome::kHttpScheme) && + if (!params.url.SchemeIs(kHttpScheme) && !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 c37b78c..697f2eb 100644 --- a/content/common/savable_url_schemes.cc +++ b/content/common/savable_url_schemes.cc @@ -13,7 +13,7 @@ namespace content { namespace { const char* const kDefaultSavableSchemes[] = { - chrome::kHttpScheme, + kHttpScheme, kHttpsScheme, chrome::kFileScheme, chrome::kFileSystemScheme, diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 51635ec..7ace0ca 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -321,7 +321,7 @@ void WebPluginProxy::HandleURLRequest(const char* url, if (delegate_->GetQuirks() & WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); - if (!request_url.SchemeIs(chrome::kHttpScheme) && + if (!request_url.SchemeIs(kHttpScheme) && !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 e1d9c01..cee2976 100644 --- a/content/public/common/url_constants.cc +++ b/content/public/common/url_constants.cc @@ -19,11 +19,11 @@ const char kFileScheme[] = "file"; const char kFileSystemScheme[] = "filesystem"; const char kFtpScheme[] = "ftp"; const char kGuestScheme[] = "chrome-guest"; -const char kHttpScheme[] = "http"; } // namespace chrome namespace content { +const char kHttpScheme[] = "http"; const char kHttpsScheme[] = "https"; const char kJavaScriptScheme[] = "javascript"; const char kMailToScheme[] = "mailto"; diff --git a/content/public/common/url_constants.h b/content/public/common/url_constants.h index b6d4418..cb8fe22 100644 --- a/content/public/common/url_constants.h +++ b/content/public/common/url_constants.h @@ -25,11 +25,11 @@ CONTENT_EXPORT extern const char kFileScheme[]; CONTENT_EXPORT extern const char kFileSystemScheme[]; CONTENT_EXPORT extern const char kFtpScheme[]; CONTENT_EXPORT extern const char kGuestScheme[]; -CONTENT_EXPORT extern const char kHttpScheme[]; } // namespace chrome namespace content { +CONTENT_EXPORT extern const char kHttpScheme[]; CONTENT_EXPORT extern const char kHttpsScheme[]; CONTENT_EXPORT extern const char kJavaScriptScheme[]; CONTENT_EXPORT extern const char kMailToScheme[]; diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index d5a1759..7d97f6e 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -521,7 +521,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(kHttpsScheme)) + if (!url.SchemeIs(kHttpScheme) && !url.SchemeIs(kHttpsScheme)) return false; if (type != WebKit::WebNavigationTypeReload && diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc index 93b3270..219bf0f 100644 --- a/extensions/common/url_pattern.cc +++ b/extensions/common/url_pattern.cc @@ -20,7 +20,7 @@ namespace { // TODO(aa): What about more obscure schemes like data: and javascript: ? // Note: keep this array in sync with kValidSchemeMasks. const char* kValidSchemes[] = { - chrome::kHttpScheme, + content::kHttpScheme, content::kHttpsScheme, chrome::kFileScheme, chrome::kFtpScheme, @@ -360,7 +360,7 @@ bool URLPattern::MatchesScheme(const std::string& test) const { } bool URLPattern::MatchesHost(const std::string& host) const { - std::string test(chrome::kHttpScheme); + std::string test(content::kHttpScheme); test += content::kStandardSchemeSeparator; test += host; test += "/"; |