diff options
Diffstat (limited to 'chrome/browser')
23 files changed, 77 insertions, 48 deletions
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc index d926ed3..c61385b 100644 --- a/chrome/browser/banners/app_banner_data_fetcher.cc +++ b/chrome/browser/banners/app_banner_data_fetcher.cc @@ -40,7 +40,8 @@ bool DoesManifestContainRequiredIcon(const content::Manifest& manifest) { // the src extension, and allow the icon if the extension ends with png. if (!base::EqualsASCII(icon.type.string(), "image/png") && !(icon.type.is_null() && - base::EndsWith(icon.src.ExtractFileName(), kPngExtension, false))) + base::EndsWith(icon.src.ExtractFileName(), kPngExtension, + base::CompareCase::INSENSITIVE_ASCII))) continue; for (const auto& size : icon.sizes) { diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index d8dec49..bc79830 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc @@ -919,7 +919,8 @@ void WallpaperPrivateGetOfflineWallpaperListFunction::GetList() { current = files.Next()) { std::string file_name = current.BaseName().RemoveExtension().value(); // Do not add file name of small resolution wallpaper to the list. - if (!base::EndsWith(file_name, wallpaper::kSmallWallpaperSuffix, true)) + if (!base::EndsWith(file_name, wallpaper::kSmallWallpaperSuffix, + base::CompareCase::SENSITIVE)) file_list.push_back(current.BaseName().value()); } } diff --git a/chrome/browser/chromeos/policy/device_local_account.cc b/chrome/browser/chromeos/policy/device_local_account.cc index 3e85b3c..2657377 100644 --- a/chrome/browser/chromeos/policy/device_local_account.cc +++ b/chrome/browser/chromeos/policy/device_local_account.cc @@ -68,7 +68,8 @@ bool IsDeviceLocalAccountUser(const std::string& user_id, if (user_id == chromeos::login::kGuestUserName) return false; const std::string domain = gaia::ExtractDomainName(user_id); - if (!base::EndsWith(domain, kDeviceLocalAccountDomainSuffix, true)) + if (!base::EndsWith(domain, kDeviceLocalAccountDomainSuffix, + base::CompareCase::SENSITIVE)) return false; const std::string domain_prefix = domain.substr( diff --git a/chrome/browser/component_updater/cld_component_installer_unittest.cc b/chrome/browser/component_updater/cld_component_installer_unittest.cc index ab40b35..aa19c25 100644 --- a/chrome/browser/component_updater/cld_component_installer_unittest.cc +++ b/chrome/browser/component_updater/cld_component_installer_unittest.cc @@ -102,7 +102,8 @@ TEST_F(CldComponentInstallerTest, GetInstalledPath) { const base::FilePath base_dir; const base::FilePath result = CldComponentInstallerTraits::GetInstalledPath(base_dir); - ASSERT_TRUE(base::EndsWith(result.value(), kTestCldDataFileName, true)); + ASSERT_TRUE(base::EndsWith(result.value(), kTestCldDataFileName, + base::CompareCase::SENSITIVE)); } TEST_F(CldComponentInstallerTest, GetBaseDirectory) { @@ -127,8 +128,10 @@ TEST_F(CldComponentInstallerTest, ComponentReady) { traits_.ComponentReady(version, install_dir, manifest.Pass()); base::FilePath result = CldComponentInstallerTraits::GetLatestCldDataFile(); ASSERT_TRUE(base::StartsWith(result.AsUTF16Unsafe(), - install_dir.AsUTF16Unsafe(), true)); - ASSERT_TRUE(base::EndsWith(result.value(), kTestCldDataFileName, true)); + install_dir.AsUTF16Unsafe(), + base::CompareCase::SENSITIVE)); + ASSERT_TRUE(base::EndsWith(result.value(), kTestCldDataFileName, + base::CompareCase::SENSITIVE)); } } // namespace component_updater diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc index 169f8da..0f58e84 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc @@ -223,7 +223,8 @@ class DelayLoadStartAndExecuteJavascript const GURL& url, ui::PageTransition transition_type) override { if (script_was_executed_ && - base::EndsWith(url.spec(), until_url_suffix_, true)) { + base::EndsWith(url.spec(), until_url_suffix_, + base::CompareCase::SENSITIVE)) { content::WebContentsObserver::Observe(NULL); test_navigation_listener_->ResumeAll(); } diff --git a/chrome/browser/extensions/default_apps.cc b/chrome/browser/extensions/default_apps.cc index c8078e4..2cc3228 100644 --- a/chrome/browser/extensions/default_apps.cc +++ b/chrome/browser/extensions/default_apps.cc @@ -37,7 +37,8 @@ bool IsLocaleSupported() { const std::string& locale = g_browser_process->GetApplicationLocale(); static const char* const unsupported_locales[] = {"CN", "TR", "IR"}; for (size_t i = 0; i < arraysize(unsupported_locales); ++i) { - if (base::EndsWith(locale, unsupported_locales[i], false)) { + if (base::EndsWith(locale, unsupported_locales[i], + base::CompareCase::INSENSITIVE_ASCII)) { return false; } } diff --git a/chrome/browser/extensions/updater/local_extension_cache.cc b/chrome/browser/extensions/updater/local_extension_cache.cc index 677b3e8..14273a8 100644 --- a/chrome/browser/extensions/updater/local_extension_cache.cc +++ b/chrome/browser/extensions/updater/local_extension_cache.cc @@ -421,7 +421,7 @@ void LocalExtensionCache::BackendCheckCacheContentsInternal( std::string version; std::string expected_hash; if (base::EndsWith(basename, kCRXFileExtension, - false /* case-sensitive */)) { + base::CompareCase::INSENSITIVE_ASCII)) { size_t n = basename.find('-'); if (n != std::string::npos && n + 1 < basename.size() - 4) { id = basename.substr(0, n); diff --git a/chrome/browser/metrics/chromeos_metrics_provider.cc b/chrome/browser/metrics/chromeos_metrics_provider.cc index 8360369..7c65d0b 100644 --- a/chrome/browser/metrics/chromeos_metrics_provider.cc +++ b/chrome/browser/metrics/chromeos_metrics_provider.cc @@ -115,7 +115,7 @@ EnrollmentStatus GetEnrollmentStatus() { return NON_MANAGED; std::string domain = connector->GetEnterpriseDomain(); - if (base::EndsWith(domain, kEduDomain, false /* case insensitive */)) + if (base::EndsWith(domain, kEduDomain, base::CompareCase::INSENSITIVE_ASCII)) return MANAGED_EDU; return MANAGED_NON_EDU; diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl.cc b/chrome/browser/net/pref_proxy_config_tracker_impl.cc index 02469dd..6de119ea 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl.cc +++ b/chrome/browser/net/pref_proxy_config_tracker_impl.cc @@ -27,7 +27,8 @@ namespace { // Determine if |proxy| is of the form "*.googlezip.net". bool IsGooglezipDataReductionProxy(const net::ProxyServer& proxy) { return proxy.is_valid() && !proxy.is_direct() && - base::EndsWith(proxy.host_port_pair().host(), ".googlezip.net", true); + base::EndsWith(proxy.host_port_pair().host(), ".googlezip.net", + base::CompareCase::SENSITIVE); } // Removes any Data Reduction Proxies like *.googlezip.net from |proxy_list|. diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc index cb74b99..b8471ea 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc @@ -45,7 +45,8 @@ bool ContainsDataReductionProxyDefaultHostSuffix( for (const net::ProxyServer& proxy : proxy_list.GetAll()) { if (proxy.is_valid() && !proxy.is_direct() && base::EndsWith(proxy.host_port_pair().host(), - kDataReductionProxyDefaultHostSuffix, true)) { + kDataReductionProxyDefaultHostSuffix, + base::CompareCase::SENSITIVE)) { return true; } } diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc index 09e4643..5a7929e 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc @@ -1792,7 +1792,8 @@ void SafeBrowsingDatabaseNew::RecordFileSizeHistogram( // Default to logging DB sizes unless |file_path| points at PrefixSet storage. std::string histogram_name("SB2.DatabaseSizeKilobytes"); - if (base::EndsWith(filename, kPrefixSetFileSuffix, true)) { + if (base::EndsWith(filename, kPrefixSetFileSuffix, + base::CompareCase::SENSITIVE)) { histogram_name = "SB2.PrefixSetSizeKilobytes"; // Clear the PrefixSet suffix to have the histogram suffix selector below // work the same for PrefixSet-based storage as it does for simple safe @@ -1805,21 +1806,28 @@ void SafeBrowsingDatabaseNew::RecordFileSizeHistogram( // Changes to histogram suffixes below need to be mirrored in the // SafeBrowsingLists suffix enum in histograms.xml. - if (base::EndsWith(filename, kBrowseDBFile, true)) + if (base::EndsWith(filename, kBrowseDBFile, base::CompareCase::SENSITIVE)) histogram_name.append(".Browse"); - else if (base::EndsWith(filename, kDownloadDBFile, true)) + else if (base::EndsWith(filename, kDownloadDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".Download"); - else if (base::EndsWith(filename, kCsdWhitelistDBFile, true)) + else if (base::EndsWith(filename, kCsdWhitelistDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".CsdWhitelist"); - else if (base::EndsWith(filename, kDownloadWhitelistDBFile, true)) + else if (base::EndsWith(filename, kDownloadWhitelistDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".DownloadWhitelist"); - else if (base::EndsWith(filename, kInclusionWhitelistDBFile, true)) + else if (base::EndsWith(filename, kInclusionWhitelistDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".InclusionWhitelist"); - else if (base::EndsWith(filename, kExtensionBlacklistDBFile, true)) + else if (base::EndsWith(filename, kExtensionBlacklistDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".ExtensionBlacklist"); - else if (base::EndsWith(filename, kIPBlacklistDBFile, true)) + else if (base::EndsWith(filename, kIPBlacklistDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".IPBlacklist"); - else if (base::EndsWith(filename, kUnwantedSoftwareDBFile, true)) + else if (base::EndsWith(filename, kUnwantedSoftwareDBFile, + base::CompareCase::SENSITIVE)) histogram_name.append(".UnwantedSoftware"); else NOTREACHED(); // Add support for new lists above. diff --git a/chrome/browser/search/iframe_source.cc b/chrome/browser/search/iframe_source.cc index c611501..55282b8 100644 --- a/chrome/browser/search/iframe_source.cc +++ b/chrome/browser/search/iframe_source.cc @@ -25,13 +25,13 @@ IframeSource::~IframeSource() { std::string IframeSource::GetMimeType( const std::string& path_and_query) const { std::string path(GURL("chrome-search://host/" + path_and_query).path()); - if (base::EndsWith(path, ".js", false)) + if (base::EndsWith(path, ".js", base::CompareCase::INSENSITIVE_ASCII)) return "application/javascript"; - if (base::EndsWith(path, ".png", false)) + if (base::EndsWith(path, ".png", base::CompareCase::INSENSITIVE_ASCII)) return "image/png"; - if (base::EndsWith(path, ".css", false)) + if (base::EndsWith(path, ".css", base::CompareCase::INSENSITIVE_ASCII)) return "text/css"; - if (base::EndsWith(path, ".html", false)) + if (base::EndsWith(path, ".html", base::CompareCase::INSENSITIVE_ASCII)) return "text/html"; return std::string(); } diff --git a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.cc b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.cc index 2e60864..59e4ac8 100644 --- a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.cc +++ b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.cc @@ -54,7 +54,7 @@ GURL GetNormalizedURL(const GURL& url) { replacements.SetHostStr(base::StringPiece(host).substr(www.size())); // Strip trailing slash (if any). const std::string path(url.path()); - if (base::EndsWith(path, "/", true)) + if (base::EndsWith(path, "/", base::CompareCase::SENSITIVE)) replacements.SetPathStr(base::StringPiece(path).substr(0, path.size() - 1)); return url.ReplaceComponents(replacements); } diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.cc b/chrome/browser/supervised_user/supervised_user_url_filter.cc index b1dad56..667fc25 100644 --- a/chrome/browser/supervised_user/supervised_user_url_filter.cc +++ b/chrome/browser/supervised_user/supervised_user_url_filter.cc @@ -239,7 +239,7 @@ bool SupervisedUserURLFilter::HostMatchesPattern(const std::string& host, const std::string& pattern) { std::string trimmed_pattern = pattern; std::string trimmed_host = host; - if (base::EndsWith(pattern, ".*", true)) { + if (base::EndsWith(pattern, ".*", base::CompareCase::SENSITIVE)) { size_t registry_length = GetRegistryLength( trimmed_host, EXCLUDE_UNKNOWN_REGISTRIES, EXCLUDE_PRIVATE_REGISTRIES); // A host without a known registry part does not match. @@ -258,7 +258,8 @@ bool SupervisedUserURLFilter::HostMatchesPattern(const std::string& host, // pattern. if (trimmed_pattern.empty() || trimmed_pattern.find('*') != std::string::npos || - !base::EndsWith(trimmed_host, trimmed_pattern, true)) { + !base::EndsWith(trimmed_host, trimmed_pattern, + base::CompareCase::SENSITIVE)) { return false; } diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index ebae3b2..08a863e 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -964,7 +964,8 @@ gfx::Image CreateFavicon(SkColor color) { gfx::Image Create1xFaviconFromPNGFile(const std::string& path) { const char* kPNGExtension = ".png"; - if (!base::EndsWith(path, kPNGExtension, false)) + if (!base::EndsWith(path, kPNGExtension, + base::CompareCase::INSENSITIVE_ASCII)) return gfx::Image(); base::FilePath full_path; diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc index 7bd7b96..e087266 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc @@ -1400,16 +1400,16 @@ TEST_F(AutofillDialogControllerTest, BillingVsShippingStreetAddress) { // separated by commas. EXPECT_TRUE(base::StartsWith(form_structure()->field(0)->value, shipping_profile.GetRawInfo(ADDRESS_HOME_LINE1), - true)); + base::CompareCase::SENSITIVE)); EXPECT_TRUE(base::EndsWith(form_structure()->field(0)->value, shipping_profile.GetRawInfo(ADDRESS_HOME_LINE2), - true)); + base::CompareCase::SENSITIVE)); EXPECT_TRUE(base::StartsWith(form_structure()->field(1)->value, billing_profile.GetRawInfo(ADDRESS_HOME_LINE1), - true)); + base::CompareCase::SENSITIVE)); EXPECT_TRUE(base::EndsWith(form_structure()->field(1)->value, billing_profile.GetRawInfo(ADDRESS_HOME_LINE2), - true)); + base::CompareCase::SENSITIVE)); // The textareas should be an exact match. EXPECT_EQ(shipping_profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), form_structure()->field(2)->value); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm index 840de46..0fa91ec 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm @@ -563,8 +563,10 @@ NSAttributedString* CreateClassifiedAttributedString( match.GetAdditionalInfo(kACMatchPropertyContentsStartIndex), &contentsStartIndex); // Ignore invalid state. - if (!base::StartsWith(match.fill_into_edit, inputText, true) || - !base::EndsWith(match.fill_into_edit, match.contents, true) || + if (!base::StartsWith(match.fill_into_edit, inputText, + base::CompareCase::SENSITIVE) || + !base::EndsWith(match.fill_into_edit, match.contents, + base::CompareCase::SENSITIVE) || ((size_t)contentsStartIndex >= inputText.length())) { return 0; } diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc index cfd6955..0797df7 100644 --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc @@ -34,7 +34,8 @@ namespace { // Makes sure that .jpg also shows .JPG. gboolean FileFilterCaseInsensitive(const GtkFileFilterInfo* file_info, std::string* file_extension) { - return base::EndsWith(file_info->filename, *file_extension, false); + return base::EndsWith(file_info->filename, *file_extension, + base::CompareCase::INSENSITIVE_ASCII); } // Deletes |data| when gtk_file_filter_add_custom() is done with it. diff --git a/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc index 4ea7fe5..c02b0ae 100644 --- a/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc @@ -67,7 +67,7 @@ TEST(ManagePasswordsViewUtilTest, GetSavePasswordDialogTitleTextAndLinkRange) { // Verify against expectations. EXPECT_TRUE(base::EndsWith( title, base::ASCIIToUTF16(test_cases[i].expected_title_text_ends_with), - false)); + base::CompareCase::INSENSITIVE_ASCII)); EXPECT_EQ(test_cases[i].expected_link_range_start, title_link_range.start()); EXPECT_EQ(test_cases[i].expected_link_range_end, title_link_range.end()); diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc index 7960c0f..68ccc01 100644 --- a/chrome/browser/ui/webui/devtools_ui.cc +++ b/chrome/browser/ui/webui/devtools_ui.cc @@ -49,19 +49,25 @@ const char kFallbackFrontendURL[] = std::string GetMimeTypeForPath(const std::string& path) { std::string filename = PathWithoutParams(path); - if (base::EndsWith(filename, ".html", false)) { + if (base::EndsWith(filename, ".html", base::CompareCase::INSENSITIVE_ASCII)) { return "text/html"; - } else if (base::EndsWith(filename, ".css", false)) { + } else if (base::EndsWith(filename, ".css", + base::CompareCase::INSENSITIVE_ASCII)) { return "text/css"; - } else if (base::EndsWith(filename, ".js", false)) { + } else if (base::EndsWith(filename, ".js", + base::CompareCase::INSENSITIVE_ASCII)) { return "application/javascript"; - } else if (base::EndsWith(filename, ".png", false)) { + } else if (base::EndsWith(filename, ".png", + base::CompareCase::INSENSITIVE_ASCII)) { return "image/png"; - } else if (base::EndsWith(filename, ".gif", false)) { + } else if (base::EndsWith(filename, ".gif", + base::CompareCase::INSENSITIVE_ASCII)) { return "image/gif"; - } else if (base::EndsWith(filename, ".svg", false)) { + } else if (base::EndsWith(filename, ".svg", + base::CompareCase::INSENSITIVE_ASCII)) { return "image/svg+xml"; - } else if (base::EndsWith(filename, ".manifest", false)) { + } else if (base::EndsWith(filename, ".manifest", + base::CompareCase::INSENSITIVE_ASCII)) { return "text/cache-manifest"; } return "text/html"; diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 352eba5..6cd974b 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -124,7 +124,7 @@ bool HandleRequestCallback( const content::WebUIDataSource::GotDataCallback& callback) { // ChromeWebUIDataSource handles most requests except for the print preview // data. - if (!base::EndsWith(path, "/print.pdf", true)) + if (!base::EndsWith(path, "/print.pdf", base::CompareCase::SENSITIVE)) return false; // Print Preview data. diff --git a/chrome/browser/ui/webui/profiler_ui.cc b/chrome/browser/ui/webui/profiler_ui.cc index fda2c09..97629121 100644 --- a/chrome/browser/ui/webui/profiler_ui.cc +++ b/chrome/browser/ui/webui/profiler_ui.cc @@ -58,7 +58,7 @@ class ProfilerWebUIDataSource : public content::URLDataSource { } std::string GetMimeType(const std::string& path) const override { - if (base::EndsWith(path, ".js", false)) + if (base::EndsWith(path, ".js", base::CompareCase::INSENSITIVE_ASCII)) return "application/javascript"; return "text/html"; } diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 89cad0e..68b5929 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -184,8 +184,8 @@ bool HasExistingExtensionShim(const base::FilePath& destination_directory, !shim_path.empty(); shim_path = enumerator.Next()) { if (shim_path.BaseName() != own_basename && base::EndsWith(shim_path.RemoveExtension().value(), - extension_id, - true /* case_sensitive */)) { + extension_id, + base::CompareCase::SENSITIVE)) { return true; } } |