[cleanup] Replace base::ranges with std::ranges: chrome/
Done entirely with `git grep` and `sed` + `git cl format`, no
hand-editing.
Bug: 386918226
Change-Id: I64d8764f7d2df25078862d528e471e13ce95517f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6200893
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Peter Kasting <[email protected]>
Owners-Override: Peter Kasting <[email protected]>
Auto-Submit: Peter Kasting <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1411657}
diff --git a/chrome/browser/accessibility/live_caption/live_caption_controller_browsertest.cc b/chrome/browser/accessibility/live_caption/live_caption_controller_browsertest.cc
index 41119598..8d8e0b2 100644
--- a/chrome/browser/accessibility/live_caption/live_caption_controller_browsertest.cc
+++ b/chrome/browser/accessibility/live_caption/live_caption_controller_browsertest.cc
@@ -4,10 +4,11 @@
#include "components/live_caption/live_caption_controller.h"
+#include <ranges>
+
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/callback_forward.h"
-#include "base/ranges/ranges.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/caption_bubble_context_browser.h"
diff --git a/chrome/browser/android/httpclient/http_client_unittest.cc b/chrome/browser/android/httpclient/http_client_unittest.cc
index 9e06d45a..b4fa28f 100644
--- a/chrome/browser/android/httpclient/http_client_unittest.cc
+++ b/chrome/browser/android/httpclient/http_client_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/android/httpclient/http_client.h"
+#include <algorithm>
#include <iostream>
#include <ostream>
#include <string>
#include <type_traits>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/android/preferences/autofill/autofill_profile_bridge.cc b/chrome/browser/android/preferences/autofill/autofill_profile_bridge.cc
index 4cf289fc..e3ef42b 100644
--- a/chrome/browser/android/preferences/autofill/autofill_profile_bridge.cc
+++ b/chrome/browser/android/preferences/autofill/autofill_profile_bridge.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/android/preferences/autofill/autofill_profile_bridge.h"
+#include <algorithm>
+
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "components/autofill/core/browser/geo/address_i18n.h"
diff --git a/chrome/browser/apps/app_preload_service/app_preload_service.cc b/chrome/browser/apps/app_preload_service/app_preload_service.cc
index 7f872d5..045a86b 100644
--- a/chrome/browser/apps/app_preload_service/app_preload_service.cc
+++ b/chrome/browser/apps/app_preload_service/app_preload_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/apps/app_preload_service/app_preload_service.h"
+#include <algorithm>
#include <memory>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "chrome/browser/apps/app_preload_service/app_preload_almanac_endpoint.h"
@@ -216,9 +216,9 @@
// Sort shelf pin ordering.
std::vector<std::pair<apps::PackageId, uint32_t>> pins(
shelf_pin_ordering.begin(), shelf_pin_ordering.end());
- base::ranges::sort(pins, {}, &std::pair<apps::PackageId, uint32_t>::second);
- base::ranges::transform(pins, std::back_inserter(pin_order_),
- &std::pair<apps::PackageId, uint32_t>::first);
+ std::ranges::sort(pins, {}, &std::pair<apps::PackageId, uint32_t>::second);
+ std::ranges::transform(pins, std::back_inserter(pin_order_),
+ &std::pair<apps::PackageId, uint32_t>::first);
}
for (auto& callback : get_pin_apps_callbacks_) {
std::move(callback).Run(pin_apps_, pin_order_);
@@ -252,7 +252,7 @@
base::TimeTicks start_time,
const std::vector<bool>& results) {
OnFirstLoginFlowComplete(start_time,
- base::ranges::all_of(results, std::identity{}));
+ std::ranges::all_of(results, std::identity{}));
}
void AppPreloadService::OnFirstLoginFlowComplete(base::TimeTicks start_time,
diff --git a/chrome/browser/apps/app_service/app_icon/app_icon_reader.cc b/chrome/browser/apps/app_service/app_icon/app_icon_reader.cc
index f0cb68d..c25485b 100644
--- a/chrome/browser/apps/app_service/app_icon/app_icon_reader.cc
+++ b/chrome/browser/apps/app_service/app_icon/app_icon_reader.cc
@@ -86,8 +86,8 @@
TRACE_EVENT0("ui", "AppIconReader::OnUncompressedIconRead");
DCHECK_NE(IconType::kUnknown, icon_type);
- auto it = base::ranges::find(decodes_, decoder,
- &std::unique_ptr<AppIconDecoder>::get);
+ auto it = std::ranges::find(decodes_, decoder,
+ &std::unique_ptr<AppIconDecoder>::get);
CHECK(it != decodes_.end(), base::NotFatalUntil::M130);
decodes_.erase(it);
diff --git a/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc b/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc
index aa9ac51..dbe8297 100644
--- a/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc
+++ b/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/apps/app_service/app_install/app_install_service_ash.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "base/debug/stack_trace.h"
#include "base/functional/bind.h"
@@ -11,7 +13,6 @@
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_install/app_install.pb.h"
#include "chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h"
#include "chrome/browser/apps/app_service/app_install/app_install_types.h"
diff --git a/chrome/browser/apps/app_service/intent_util.cc b/chrome/browser/apps/app_service/intent_util.cc
index 742bb4c..8361328 100644
--- a/chrome/browser/apps/app_service/intent_util.cc
+++ b/chrome/browser/apps/app_service/intent_util.cc
@@ -259,7 +259,7 @@
}
// Check that the scheme is generic or has a value related to files.
- bool has_generic_scheme = base::ranges::any_of(
+ bool has_generic_scheme = std::ranges::any_of(
arc_intent_filter.schemes(), [](const std::string& scheme) {
return scheme == "content" || scheme == "file" || scheme == "*";
});
@@ -268,7 +268,7 @@
}
// Check that the host is generic or doesn't exist.
- bool has_generic_host = base::ranges::any_of(
+ bool has_generic_host = std::ranges::any_of(
arc_intent_filter.authorities(),
[](const arc::IntentFilter::AuthorityEntry& authority) {
return authority.wild();
@@ -278,7 +278,7 @@
}
// Check that the mime type is generic or doesn't exist.
- bool has_generic_mime = base::ranges::any_of(
+ bool has_generic_mime = std::ranges::any_of(
arc_intent_filter.mime_types(), [](const std::string& mime_type) {
return mime_type == "*" || mime_type == "*/*";
});
diff --git a/chrome/browser/apps/app_service/intent_util_unittest.cc b/chrome/browser/apps/app_service/intent_util_unittest.cc
index f374f99..f142fcf 100644
--- a/chrome/browser/apps/app_service/intent_util_unittest.cc
+++ b/chrome/browser/apps/app_service/intent_util_unittest.cc
@@ -795,7 +795,7 @@
apps::ConditionValues& result_extensions =
app_service_filter->conditions[1]->condition_values;
auto found_extension = [&result_extensions](const std::string extension) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
result_extensions,
[extension](std::unique_ptr<apps::ConditionValue>& condition_value) {
return condition_value->value == extension;
diff --git a/chrome/browser/apps/app_service/policy_util.cc b/chrome/browser/apps/app_service/policy_util.cc
index 6df36a9..ea7a071 100644
--- a/chrome/browser/apps/app_service/policy_util.cc
+++ b/chrome/browser/apps/app_service/policy_util.cc
@@ -4,15 +4,15 @@
#include "chrome/browser/apps/app_service/policy_util.h"
+#include <algorithm>
#include <array>
+#include <functional>
#include <string_view>
#include <utility>
#include "ash/constants/web_app_id_constants.h"
#include "base/containers/fixed_flat_map.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "base/strings/string_util.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -74,8 +74,8 @@
{"graduation", ash::SystemWebAppType::GRADUATION}});
constexpr ash::SystemWebAppType GetMaxSystemWebAppType() {
- return base::ranges::max_element(
- kSystemWebAppsMapping, base::ranges::less{},
+ return std::ranges::max_element(
+ kSystemWebAppsMapping, std::ranges::less{},
&decltype(kSystemWebAppsMapping)::value_type::second)
->second;
}
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.cc b/chrome/browser/apps/app_service/publishers/arc_apps.cc
index 76c4415e..e226e00 100644
--- a/chrome/browser/apps/app_service/publishers/arc_apps.cc
+++ b/chrome/browser/apps/app_service/publishers/arc_apps.cc
@@ -443,7 +443,7 @@
if (intent->files.empty()) {
return false;
}
- bool all_files_have_mime_type = base::ranges::all_of(
+ bool all_files_have_mime_type = std::ranges::all_of(
intent->files,
[](apps::IntentFilePtr& file) { return file->mime_type.has_value(); });
return all_files_have_mime_type || intent->mime_type.has_value();
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps_unittest.cc b/chrome/browser/apps/app_service/publishers/arc_apps_unittest.cc
index 6b8af27..2307bfac 100644
--- a/chrome/browser/apps/app_service/publishers/arc_apps_unittest.cc
+++ b/chrome/browser/apps/app_service/publishers/arc_apps_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/apps/app_service/publishers/arc_apps.h"
+#include <algorithm>
#include <functional>
#include <memory>
#include "ash/constants/ash_features.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/test/bind.h"
@@ -684,7 +684,7 @@
EXPECT_EQ(result.size(), 2ul);
// Sort permissions by permission type.
- base::ranges::sort(result, std::less<>(), &apps::Permission::permission_type);
+ std::ranges::sort(result, std::less<>(), &apps::Permission::permission_type);
EXPECT_EQ(result[0]->permission_type, apps::PermissionType::kCamera);
EXPECT_EQ(absl::get<apps::TriState>(result[0]->value), apps::TriState::kAsk);
diff --git a/chrome/browser/apps/app_service/webapk/webapk_install_task.cc b/chrome/browser/apps/app_service/webapk/webapk_install_task.cc
index 962a836..b72b42fb 100644
--- a/chrome/browser/apps/app_service/webapk/webapk_install_task.cc
+++ b/chrome/browser/apps/app_service/webapk/webapk_install_task.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/apps/app_service/webapk/webapk_install_task.h"
+#include <algorithm>
#include <utility>
#include "base/command_line.h"
@@ -11,7 +12,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -366,7 +366,7 @@
// and just send any URL of the correct purpose.
auto& registrar = web_app_provider_->registrar_unsafe();
const auto& manifest_icons = registrar.GetAppIconInfos(app_id_);
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
manifest_icons, [&icon_size_and_purpose](const apps::IconInfo& info) {
return info.purpose == web_app::ManifestPurposeToIconInfoPurpose(
icon_size_and_purpose->purpose);
diff --git a/chrome/browser/apps/app_shim/app_shim_manager_mac.cc b/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
index 2504815..07f2840 100644
--- a/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
+++ b/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
@@ -1908,7 +1908,7 @@
std::map<base::FilePath, AppShimRegistry::HandlerInfo> handlers =
AppShimRegistry::Get()->GetHandlersForApp(params.app_id);
for (const auto& [profile, handler_info] : handlers) {
- int count = base::ranges::count_if(
+ int count = std::ranges::count_if(
files, [&handler_info](const base::FilePath& file_path) {
std::string file_extension =
base::FilePath(file_path.Extension()).AsUTF8Unsafe();
diff --git a/chrome/browser/apps/browser_instance/browser_app_instance_map.h b/chrome/browser/apps/browser_instance/browser_app_instance_map.h
index ac72af8e..3d268a9 100644
--- a/chrome/browser/apps/browser_instance/browser_app_instance_map.h
+++ b/chrome/browser/apps/browser_instance/browser_app_instance_map.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_APPS_BROWSER_INSTANCE_BROWSER_APP_INSTANCE_MAP_H_
#define CHROME_BROWSER_APPS_BROWSER_INSTANCE_BROWSER_APP_INSTANCE_MAP_H_
+#include <algorithm>
#include <map>
#include <memory>
#include <set>
@@ -12,7 +13,6 @@
#include "base/check.h"
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
namespace apps {
@@ -64,7 +64,7 @@
const ValueT* FindInstanceIf(
const BrowserAppInstanceMap<KeyT, ValueT>& instances,
PredicateT predicate) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
instances, predicate,
[](const auto& pair) -> const ValueT& { return *pair.second; });
if (it == instances.end()) {
diff --git a/chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.cc b/chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.cc
index 3547935..fb47fda 100644
--- a/chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.cc
+++ b/chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.h"
+#include <algorithm>
#include <optional>
#include <string_view>
@@ -15,7 +16,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/values_equivalent.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
diff --git a/chrome/browser/apps/link_capturing/enable_link_capturing_infobar_delegate.cc b/chrome/browser/apps/link_capturing/enable_link_capturing_infobar_delegate.cc
index d3b008548..eab09f6e 100644
--- a/chrome/browser/apps/link_capturing/enable_link_capturing_infobar_delegate.cc
+++ b/chrome/browser/apps/link_capturing/enable_link_capturing_infobar_delegate.cc
@@ -79,7 +79,7 @@
auto* infobar_manager =
infobars::ContentInfoBarManager::FromWebContents(web_contents);
CHECK(infobar_manager);
- const auto it = base::ranges::find(
+ const auto it = std::ranges::find(
infobar_manager->infobars(),
infobars::InfoBarDelegate::ENABLE_LINK_CAPTURING_INFOBAR_DELEGATE,
&infobars::InfoBar::GetIdentifier);
diff --git a/chrome/browser/ash/accessibility/accessibility_manager.cc b/chrome/browser/ash/accessibility/accessibility_manager.cc
index 86c1b511..06c6767 100644
--- a/chrome/browser/ash/accessibility/accessibility_manager.cc
+++ b/chrome/browser/ash/accessibility/accessibility_manager.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <string_view>
#include <utility>
@@ -36,7 +37,6 @@
#include "base/memory/singleton.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -1595,7 +1595,7 @@
pref_service->GetString(::prefs::kLanguagePreloadEngines);
std::vector<std::string_view> preload_engines = base::SplitStringPiece(
preload_engines_str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
- std::vector<std::string_view>::iterator it = base::ranges::find(
+ std::vector<std::string_view>::iterator it = std::ranges::find(
preload_engines, extension_ime_util::kBrailleImeEngineId);
bool is_enabled = (it != preload_engines.end());
bool should_be_enabled =
diff --git a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
index dd07796..11869c9 100644
--- a/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
+++ b/chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ash/account_manager/account_manager_edu_coexistence_controller.h"
+#include <algorithm>
#include <optional>
#include "ash/constants/ash_pref_names.h"
#include "base/containers/contains.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/account_manager/account_manager_util.h"
#include "chrome/browser/ash/child_accounts/edu_coexistence_tos_store_utils.h"
#include "chrome/browser/profiles/profile.h"
@@ -90,7 +90,7 @@
continue;
}
- auto iterator = base::ranges::find(
+ auto iterator = std::ranges::find(
current_edu_account_consent_list, GaiaId(account.key.id()),
&edu_coexistence::UserConsentInfo::edu_account_gaia_id);
diff --git a/chrome/browser/ash/app_list/app_list_syncable_service.cc b/chrome/browser/ash/app_list/app_list_syncable_service.cc
index 5247a69..d15dd8f 100644
--- a/chrome/browser/ash/app_list/app_list_syncable_service.cc
+++ b/chrome/browser/ash/app_list/app_list_syncable_service.cc
@@ -21,7 +21,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/one_shot_event.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/to_string.h"
#include "base/task/sequenced_task_runner.h"
@@ -1672,7 +1671,7 @@
sync_item->item_id != ash::kOemFolderId, // Don't sync oem folder's name.
update_folder);
- const auto linked_promise_item = base::ranges::find_if(
+ const auto linked_promise_item = std::ranges::find_if(
items_linked_to_promise_item_, [&sync_item](const auto& linked_item) {
return linked_item.second == sync_item->item_id;
});
@@ -1852,8 +1851,8 @@
}
// Sort remaining items based on their positions.
- base::ranges::sort(sync_items, syncer::StringOrdinal::LessThanFn(),
- &SyncItem::item_ordinal);
+ std::ranges::sort(sync_items, syncer::StringOrdinal::LessThanFn(),
+ &SyncItem::item_ordinal);
return sync_items;
}
@@ -2243,7 +2242,7 @@
// Sort ordering for items in the same folder.
std::vector<std::pair<apps::LauncherItem, apps::LauncherItemData>>
folder_order(item_map.begin(), item_map.end());
- base::ranges::sort(
+ std::ranges::sort(
folder_order, {},
[](const std::pair<apps::LauncherItem, apps::LauncherItemData>& p) {
return p.second.order;
@@ -2281,8 +2280,8 @@
lhs = ordinal;
} else {
// Update `merge_index` and `lhs` if new match is after current.
- auto defaults_it = base::ranges::find(defaults.begin() + merge_index,
- defaults.end(), item);
+ auto defaults_it = std::ranges::find(defaults.begin() + merge_index,
+ defaults.end(), item);
if (defaults_it != defaults.end()) {
merge_index = defaults_it - defaults.begin();
lhs = preload_service_ordinals_[item];
diff --git a/chrome/browser/ash/app_list/app_service/app_service_promise_app_item_browsertest.cc b/chrome/browser/ash/app_list/app_service/app_service_promise_app_item_browsertest.cc
index 4fffb88..ea8a99ab 100644
--- a/chrome/browser/ash/app_list/app_service/app_service_promise_app_item_browsertest.cc
+++ b/chrome/browser/ash/app_list/app_service/app_service_promise_app_item_browsertest.cc
@@ -77,7 +77,7 @@
bool IsItemPinned(const std::string& item_id) {
const auto& shelf_items = ash::ShelfModel::Get()->items();
auto pinned_item =
- base::ranges::find_if(shelf_items, [&item_id](const auto& shelf_item) {
+ std::ranges::find_if(shelf_items, [&item_id](const auto& shelf_item) {
return shelf_item.id.app_id == item_id;
});
return pinned_item != std::ranges::end(shelf_items);
diff --git a/chrome/browser/ash/app_list/arc/arc_app_icon.cc b/chrome/browser/ash/app_list/arc/arc_app_icon.cc
index 3385fdc..0a965072 100644
--- a/chrome/browser/ash/app_list/arc/arc_app_icon.cc
+++ b/chrome/browser/ash/app_list/arc/arc_app_icon.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_list/arc/arc_app_icon.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <utility>
@@ -17,7 +18,6 @@
#include "base/lazy_instance.h"
#include "base/memory/raw_ref.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/app_list/arc/arc_app_icon_descriptor.h"
#include "chrome/browser/ash/app_list/arc/arc_app_list_prefs.h"
@@ -768,8 +768,8 @@
bool is_decode_success) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- auto it = base::ranges::find(decode_requests_, request,
- &std::unique_ptr<DecodeRequest>::get);
+ auto it = std::ranges::find(decode_requests_, request,
+ &std::unique_ptr<DecodeRequest>::get);
DCHECK(it != decode_requests_.end());
decode_requests_.erase(it);
diff --git a/chrome/browser/ash/app_list/arc/arc_app_test.cc b/chrome/browser/ash/app_list/arc/arc_app_test.cc
index c0f4801..554443f9 100644
--- a/chrome/browser/ash/app_list/arc/arc_app_test.cc
+++ b/chrome/browser/ash/app_list/arc/arc_app_test.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_list/arc/arc_app_test.h"
+#include <algorithm>
#include <vector>
#include "ash/constants/ash_features.h"
@@ -11,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@@ -396,8 +396,8 @@
}
void ArcAppTest::UpdatePackage(arc::mojom::ArcPackageInfoPtr updated_package) {
- auto it = base::ranges::find(fake_packages_, updated_package->package_name,
- &arc::mojom::ArcPackageInfo::package_name);
+ auto it = std::ranges::find(fake_packages_, updated_package->package_name,
+ &arc::mojom::ArcPackageInfo::package_name);
if (it != fake_packages_.end()) {
*it = std::move(updated_package);
}
diff --git a/chrome/browser/ash/app_list/arc/arc_app_unittest.cc b/chrome/browser/ash/app_list/arc/arc_app_unittest.cc
index e343ef9..b2a9be4 100644
--- a/chrome/browser/ash/app_list/arc/arc_app_unittest.cc
+++ b/chrome/browser/ash/app_list/arc/arc_app_unittest.cc
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <map>
#include <memory>
#include <string>
@@ -22,7 +23,6 @@
#include "base/memory/raw_ref.h"
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
@@ -715,7 +715,7 @@
// Process requested apps.
for (auto& app : apps) {
const std::string id = ArcAppTest::GetAppId(*app);
- std::vector<std::string>::iterator it_id = base::ranges::find(ids, id);
+ std::vector<std::string>::iterator it_id = std::ranges::find(ids, id);
ASSERT_NE(it_id, ids.end());
ids.erase(it_id);
@@ -744,7 +744,7 @@
// Process requested apps.
for (auto& shortcut : shortcuts) {
const std::string id = ArcAppTest::GetAppId(shortcut);
- std::vector<std::string>::iterator it_id = base::ranges::find(ids, id);
+ std::vector<std::string>::iterator it_id = std::ranges::find(ids, id);
ASSERT_NE(it_id, ids.end());
ids.erase(it_id);
diff --git a/chrome/browser/ash/app_list/chrome_app_list_item_manager.cc b/chrome/browser/ash/app_list/chrome_app_list_item_manager.cc
index ce45991..b3ae6d4 100644
--- a/chrome/browser/ash/app_list/chrome_app_list_item_manager.cc
+++ b/chrome/browser/ash/app_list/chrome_app_list_item_manager.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ash/app_list/chrome_app_list_item_manager.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/app_list/chrome_app_list_item.h"
ChromeAppListItemManager::ChromeAppListItemManager() = default;
@@ -175,7 +176,7 @@
sorted_children_ptr = &folder_item_mappings_iter->second;
auto children_array_iter =
- base::ranges::find(*sorted_children_ptr, child_item);
+ std::ranges::find(*sorted_children_ptr, child_item);
DCHECK(children_array_iter != sorted_children_ptr->cend());
// Delete `child_item` from `src_folder`'s children list.
diff --git a/chrome/browser/ash/app_list/search/essential_search/essential_search_manager_unittest.cc b/chrome/browser/ash/app_list/search/essential_search/essential_search_manager_unittest.cc
index 64b8010e..739f6e76 100644
--- a/chrome/browser/ash/app_list/search/essential_search/essential_search_manager_unittest.cc
+++ b/chrome/browser/ash/app_list/search/essential_search/essential_search_manager_unittest.cc
@@ -102,7 +102,7 @@
net::CookieList cookie_list = GetCookiesInUserProfile();
EXPECT_GT(cookie_list.size(), 0u);
- const auto socs_cookie_iterator = base::ranges::find(
+ const auto socs_cookie_iterator = std::ranges::find(
cookie_list, cookie_name,
[](const net::CanonicalCookie& cookie) { return cookie.Name(); });
ASSERT_NE(socs_cookie_iterator, cookie_list.end());
diff --git a/chrome/browser/ash/app_list/search/files/file_search_provider.cc b/chrome/browser/ash/app_list/search/files/file_search_provider.cc
index a2ae3080..eb8cb7e 100644
--- a/chrome/browser/ash/app_list/search/files/file_search_provider.cc
+++ b/chrome/browser/ash/app_list/search/files/file_search_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_list/search/files/file_search_provider.h"
+#include <algorithm>
#include <cmath>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/i18n/case_conversion.h"
#include "base/i18n/rtl.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/task_traits.h"
@@ -108,18 +108,18 @@
for (base::FilePath path = enumerator.Next(); !path.empty();
path = enumerator.Next()) {
// Exclude any paths that are parented at an enabled trash location.
- if (base::ranges::any_of(trash_paths,
- [&path](const base::FilePath& trash_path) {
- return trash_path.IsParent(path);
- })) {
+ if (std::ranges::any_of(trash_paths,
+ [&path](const base::FilePath& trash_path) {
+ return trash_path.IsParent(path);
+ })) {
continue;
}
// Exclude any results that are not in the allowed extensions.
if (!allowed_extensions.empty() &&
- !base::ranges::any_of(allowed_extensions,
- [&path](const std::string& extension) {
- return path.MatchesFinalExtension(extension);
- })) {
+ !std::ranges::any_of(allowed_extensions,
+ [&path](const std::string& extension) {
+ return path.MatchesFinalExtension(extension);
+ })) {
continue;
}
diff --git a/chrome/browser/ash/app_list/search/ranking/best_match_ranker_unittest.cc b/chrome/browser/ash/app_list/search/ranking/best_match_ranker_unittest.cc
index 338f022..ff38c4a4 100644
--- a/chrome/browser/ash/app_list/search/ranking/best_match_ranker_unittest.cc
+++ b/chrome/browser/ash/app_list/search/ranking/best_match_ranker_unittest.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ash/app_list/search/ranking/best_match_ranker.h"
+#include <algorithm>
+
#include "base/containers/to_vector.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/app_list/search/chrome_search_result.h"
#include "chrome/browser/ash/app_list/search/test/test_result.h"
#include "chrome/browser/ash/app_list/search/types.h"
diff --git a/chrome/browser/ash/app_list/search/search_controller_unittest.cc b/chrome/browser/ash/app_list/search/search_controller_unittest.cc
index 285cb0f..dae4a8ab 100644
--- a/chrome/browser/ash/app_list/search/search_controller_unittest.cc
+++ b/chrome/browser/ash/app_list/search/search_controller_unittest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ash/app_list/search/search_controller.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <vector>
@@ -18,7 +19,6 @@
#include "ash/public/cpp/app_list/app_list_types.h"
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "chrome/browser/ash/app_list/search/chrome_search_result.h"
diff --git a/chrome/browser/ash/app_list/search/search_file_scanner.cc b/chrome/browser/ash/app_list/search/search_file_scanner.cc
index 4cd801cc..6ff68a7 100644
--- a/chrome/browser/ash/app_list/search/search_file_scanner.cc
+++ b/chrome/browser/ash/app_list/search/search_file_scanner.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_list/search/search_file_scanner.h"
+#include <algorithm>
#include <map>
#include <string_view>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
@@ -83,10 +83,10 @@
for (base::FilePath file_path = file_enumerator.Next(); !file_path.empty();
file_path = file_enumerator.Next()) {
// Exclude any paths that are parented at an enabled trash location.
- if (base::ranges::any_of(trash_paths,
- [&file_path](const base::FilePath& trash_path) {
- return trash_path.IsParent(file_path);
- })) {
+ if (std::ranges::any_of(trash_paths,
+ [&file_path](const base::FilePath& trash_path) {
+ return trash_path.IsParent(file_path);
+ })) {
continue;
}
// Always counts the total file number.
diff --git a/chrome/browser/ash/app_mode/consumer_kiosk_test_helper.cc b/chrome/browser/ash/app_mode/consumer_kiosk_test_helper.cc
index af51f483..d5bb9b9 100644
--- a/chrome/browser/ash/app_mode/consumer_kiosk_test_helper.cc
+++ b/chrome/browser/ash/app_mode/consumer_kiosk_test_helper.cc
@@ -7,12 +7,12 @@
#include "chrome/browser/ash/app_mode/consumer_kiosk_test_helper.h"
+#include <algorithm>
#include <string>
#include <vector>
#include "base/callback_list.h"
#include "base/check_deref.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/app_mode/kiosk_chrome_app_manager.h"
#include "chrome/browser/ash/ownership/owner_settings_service_ash.h"
#include "chrome/browser/ash/policy/core/device_local_account.h"
@@ -90,7 +90,7 @@
// TODO(crbug.com/358022471) Stop using multiple Kiosk apps with the same ID.
// Remove the first device local account with the given `chrome_app_id`.
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
device_local_accounts, [chrome_app_id](const auto& account) {
return account.type == policy::DeviceLocalAccountType::kKioskApp &&
account.kiosk_app_id == chrome_app_id;
diff --git a/chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_manager.cc b/chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_manager.cc
index c6b2458..49bc3de 100644
--- a/chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_manager.cc
+++ b/chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_manager.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <optional>
@@ -16,7 +17,6 @@
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/app_mode/isolated_web_app/kiosk_iwa_data.h"
#include "chrome/browser/ash/app_mode/kiosk_app_manager_base.h"
#include "chrome/browser/ash/app_mode/kiosk_app_types.h"
@@ -96,7 +96,7 @@
return nullptr;
}
- const auto iter = base::ranges::find_if(
+ const auto iter = std::ranges::find_if(
isolated_web_apps_,
[&account_id](const std::unique_ptr<KioskIwaData>& app) {
return app->account_id() == account_id;
@@ -194,8 +194,8 @@
void KioskIwaManager::RemoveApps(const KioskIwaDataMap& previous_apps) const {
std::vector<const KioskAppDataBase*> apps_to_remove;
- base::ranges::transform(previous_apps, std::back_inserter(apps_to_remove),
- [](const auto& kv) { return kv.second.get(); });
+ std::ranges::transform(previous_apps, std::back_inserter(apps_to_remove),
+ [](const auto& kv) { return kv.second.get(); });
ClearRemovedApps(apps_to_remove);
}
diff --git a/chrome/browser/ash/app_mode/kiosk_controller_impl.cc b/chrome/browser/ash/app_mode/kiosk_controller_impl.cc
index 73bd94d..d9b6baa 100644
--- a/chrome/browser/ash/app_mode/kiosk_controller_impl.cc
+++ b/chrome/browser/ash/app_mode/kiosk_controller_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_mode/kiosk_controller_impl.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -22,7 +23,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/ash/app_mode/app_launch_utils.h"
@@ -293,9 +293,9 @@
// device-local account list here to extract the kiosk_app_id.
const std::vector<policy::DeviceLocalAccount> device_local_accounts =
policy::GetDeviceLocalAccounts(CrosSettings::Get());
- const auto account = base::ranges::find(device_local_accounts,
- kiosk_app_account_id.GetUserEmail(),
- &policy::DeviceLocalAccount::user_id);
+ const auto account = std::ranges::find(device_local_accounts,
+ kiosk_app_account_id.GetUserEmail(),
+ &policy::DeviceLocalAccount::user_id);
std::string kiosk_app_id;
if (account != device_local_accounts.end()) {
kiosk_app_id = account->kiosk_app_id;
diff --git a/chrome/browser/ash/app_mode/test/kiosk_mixin.cc b/chrome/browser/ash/app_mode/test/kiosk_mixin.cc
index 6bf6161d..69bdaba 100644
--- a/chrome/browser/ash/app_mode/test/kiosk_mixin.cc
+++ b/chrome/browser/ash/app_mode/test/kiosk_mixin.cc
@@ -136,22 +136,22 @@
// If there is an auto launch app, there must also be a config option for it.
if (config.auto_launch_account_id.has_value()) {
CHECK_NE(0l,
- base::ranges::count(config.options,
- config.auto_launch_account_id.value().value(),
- GetAccountId));
+ std::ranges::count(config.options,
+ config.auto_launch_account_id.value().value(),
+ GetAccountId));
}
// No two Web apps can have the same URL.
for (auto it = config.options.begin(); it != config.options.end(); it++) {
if (GURL url = GetWebAppUrl(*it); url.is_valid()) {
- CHECK_EQ(1, base::ranges::count(config.options, url, GetWebAppUrl));
+ CHECK_EQ(1, std::ranges::count(config.options, url, GetWebAppUrl));
}
}
// No two Chrome apps can have the same app ID.
for (auto it = config.options.begin(); it != config.options.end(); it++) {
if (std::string_view app_id = GetChromeAppId(*it); !app_id.empty()) {
- CHECK_EQ(1, base::ranges::count(config.options, app_id, GetChromeAppId));
+ CHECK_EQ(1, std::ranges::count(config.options, app_id, GetChromeAppId));
}
}
}
diff --git a/chrome/browser/ash/app_restore/full_restore_service.cc b/chrome/browser/ash/app_restore/full_restore_service.cc
index 688e57e..8038f11 100644
--- a/chrome/browser/ash/app_restore/full_restore_service.cc
+++ b/chrome/browser/ash/app_restore/full_restore_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/app_restore/full_restore_service.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -28,7 +29,6 @@
#include "base/check_is_test.h"
#include "base/command_line.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "base/version.h"
@@ -579,8 +579,8 @@
// Sort the windows based on their activation index (more recent windows
// have a lower index). Windows without an activation index can be placed at
// the end.
- base::ranges::sort(complete_window_list, [](const WindowAppData& element_a,
- const WindowAppData& element_b) {
+ std::ranges::sort(complete_window_list, [](const WindowAppData& element_a,
+ const WindowAppData& element_b) {
return element_a.app_restore_data->window_info.activation_index.value_or(
INT_MAX) <
element_b.app_restore_data->window_info.activation_index.value_or(
diff --git a/chrome/browser/ash/app_restore/informed_restore_browsertest.cc b/chrome/browser/ash/app_restore/informed_restore_browsertest.cc
index ebd6af23..472b3f0 100644
--- a/chrome/browser/ash/app_restore/informed_restore_browsertest.cc
+++ b/chrome/browser/ash/app_restore/informed_restore_browsertest.cc
@@ -184,10 +184,10 @@
// settings SWAs.
auto* browser_list = BrowserList::GetInstance();
EXPECT_EQ(2u, browser_list->size());
- EXPECT_TRUE(base::ranges::any_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browser_list, [](Browser* browser) {
return IsBrowserForSystemWebApp(browser, SystemWebAppType::FILE_MANAGER);
}));
- EXPECT_TRUE(base::ranges::any_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browser_list, [](Browser* browser) {
return IsBrowserForSystemWebApp(browser, SystemWebAppType::SETTINGS);
}));
}
@@ -319,27 +319,27 @@
EXPECT_EQ(5u, browser_list->size());
// Test that there is a maximized, floated and snapped window.
- EXPECT_TRUE(base::ranges::any_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browser_list, [](Browser* browser) {
return WindowState::Get(browser->window()->GetNativeWindow())
->IsMaximized();
}));
- EXPECT_TRUE(base::ranges::any_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browser_list, [](Browser* browser) {
return WindowState::Get(browser->window()->GetNativeWindow())->IsFloated();
}));
- EXPECT_TRUE(base::ranges::any_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browser_list, [](Browser* browser) {
return WindowState::Get(browser->window()->GetNativeWindow())->IsSnapped();
}));
// Test that there is no fullscreen window as full restore does not restore
// fullscreen state.
- EXPECT_TRUE(base::ranges::none_of(*browser_list, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::none_of(*browser_list, [](Browser* browser) {
return WindowState::Get(browser->window()->GetNativeWindow())
->IsFullscreen();
}));
// Test the pre-minimized state of the minimized browser window. When we
// unminimize it, it should be maximized state.
- auto it = base::ranges::find_if(*browser_list, [](Browser* browser) {
+ auto it = std::ranges::find_if(*browser_list, [](Browser* browser) {
return WindowState::Get(browser->window()->GetNativeWindow())
->IsMinimized();
});
diff --git a/chrome/browser/ash/arc/adbd/arc_adbd_monitor_bridge_unittest.cc b/chrome/browser/ash/arc/adbd/arc_adbd_monitor_bridge_unittest.cc
index 9095fee..69b3eb6 100644
--- a/chrome/browser/ash/arc/adbd/arc_adbd_monitor_bridge_unittest.cc
+++ b/chrome/browser/ash/arc/adbd/arc_adbd_monitor_bridge_unittest.cc
@@ -158,7 +158,7 @@
EXPECT_EQ(ops[1].type, ash::FakeUpstartClient::UpstartOperationType::START);
// Check the environment variables when starting arcvm-adbd Upstart job.
- const auto it_cid = base::ranges::find(
+ const auto it_cid = std::ranges::find(
ops[1].env,
base::StringPrintf("ARCVM_CID=%" PRId64, kArcVmCidForTesting));
EXPECT_NE(it_cid, ops[1].env.end());
@@ -166,7 +166,7 @@
arc::ArcSessionManager::Get()->GetSerialNumber();
ASSERT_FALSE(serial_number.empty());
const auto it_serial =
- base::ranges::find(ops[1].env, "SERIALNUMBER=" + serial_number);
+ std::ranges::find(ops[1].env, "SERIALNUMBER=" + serial_number);
EXPECT_NE(it_serial, ops[1].env.end());
}
diff --git a/chrome/browser/ash/arc/bluetooth/arc_bluetooth_bridge.cc b/chrome/browser/ash/arc/bluetooth/arc_bluetooth_bridge.cc
index 1ad53e8..aea3fea6b 100644
--- a/chrome/browser/ash/arc/bluetooth/arc_bluetooth_bridge.cc
+++ b/chrome/browser/ash/arc/bluetooth/arc_bluetooth_bridge.cc
@@ -11,6 +11,7 @@
#include <stdint.h>
#include <sys/socket.h>
+#include <algorithm>
#include <iomanip>
#include <optional>
#include <string>
@@ -26,7 +27,6 @@
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/posix/eintr_wrapper.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
@@ -188,7 +188,7 @@
RemoteGattAttribute* FindGattAttributeByUuid(
const std::vector<RemoteGattAttribute*>& attributes,
const BluetoothUUID& uuid) {
- auto it = base::ranges::find(attributes, uuid, &RemoteGattAttribute::GetUUID);
+ auto it = std::ranges::find(attributes, uuid, &RemoteGattAttribute::GetUUID);
return it != attributes.end() ? *it : nullptr;
}
diff --git a/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc b/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc
index 414d91c..933027ca 100644
--- a/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc
+++ b/chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_browsertest.cc
@@ -11,6 +11,7 @@
#include <stdint.h>
+#include <algorithm>
#include <map>
#include <string>
#include <utility>
@@ -22,7 +23,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "chrome/browser/ash/arc/enterprise/cert_store/cert_store_service_factory.h"
@@ -298,7 +298,7 @@
// Returns the number of corporate usage certs in |test_certs|.
size_t CountCorporateUsage(const std::vector<TestCertData>& test_certs) {
- return base::ranges::count_if(test_certs, &TestCertData::is_corporate_usage);
+ return std::ranges::count_if(test_certs, &TestCertData::is_corporate_usage);
}
// Deletes the given |cert| from |cert_db|.
diff --git a/chrome/browser/ash/arc/fileapi/arc_documents_provider_util.cc b/chrome/browser/ash/arc/fileapi/arc_documents_provider_util.cc
index 213d1988..f62fdf3 100644
--- a/chrome/browser/ash/arc/fileapi/arc_documents_provider_util.cc
+++ b/chrome/browser/ash/arc/fileapi/arc_documents_provider_util.cc
@@ -9,7 +9,6 @@
#include <utility>
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -217,7 +216,7 @@
base::FilePath::StringType preferred_extension;
if (net::GetPreferredExtensionForMimeType(mime_type,
&preferred_extension)) {
- auto iter = base::ranges::find(extensions, preferred_extension);
+ auto iter = std::ranges::find(extensions, preferred_extension);
if (iter == extensions.end()) {
// This is unlikely to happen, but there is no guarantee.
extensions.insert(extensions.begin(), preferred_extension);
diff --git a/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc b/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc
index 87652222..91b1d67 100644
--- a/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc
+++ b/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.h"
+#include <algorithm>
#include <optional>
#include <utility>
#include <vector>
@@ -18,7 +19,6 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/singleton.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/arc/arc_util.h"
#include "chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_bridge_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -644,7 +644,7 @@
// Filter out non ARC IME ids.
std::set<std::string> new_arc_enabled_ime_ids;
- base::ranges::copy_if(
+ std::ranges::copy_if(
new_enabled_ime_ids,
std::inserter(new_arc_enabled_ime_ids, new_arc_enabled_ime_ids.end()),
&ash::extension_ime_util::IsArcIME);
diff --git a/chrome/browser/ash/arc/input_method_manager/arc_input_method_state.cc b/chrome/browser/ash/arc/input_method_manager/arc_input_method_state.cc
index 730c474..1630b3d 100644
--- a/chrome/browser/ash/arc/input_method_manager/arc_input_method_state.cc
+++ b/chrome/browser/ash/arc/input_method_manager/arc_input_method_state.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ash/arc/input_method_manager/arc_input_method_state.h"
+#include <algorithm>
+
#include "ash/public/cpp/keyboard/keyboard_switches.h"
#include "ash/public/cpp/tablet_mode.h"
#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "chromeos/ash/experiences/arc/mojom/input_method_manager.mojom.h"
#include "components/prefs/pref_service.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
@@ -63,7 +64,7 @@
void ArcInputMethodState::SetInputMethodEnabled(const std::string& ime_id,
bool enabled) {
auto it =
- base::ranges::find(installed_imes_, ime_id, &InputMethodEntry::ime_id_);
+ std::ranges::find(installed_imes_, ime_id, &InputMethodEntry::ime_id_);
if (it == installed_imes_.end()) {
// Ignore the request to enable/disable not-installed IME.
return;
diff --git a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc
index ea1cd54..d76af8c 100644
--- a/chrome/browser/ash/arc/input_overlay/actions/action_move.cc
+++ b/chrome/browser/ash/arc/input_overlay/actions/action_move.cc
@@ -15,7 +15,6 @@
#include "base/check_op.h"
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ash/arc/input_overlay/actions/action.h"
#include "chrome/browser/ash/arc/input_overlay/touch_id_manager.h"
@@ -139,7 +138,7 @@
if (labels_.size() != kActionMoveKeysSize) {
return;
}
- auto it = base::ranges::find(labels_, action_label);
+ auto it = std::ranges::find(labels_, action_label);
DCHECK(it != labels_.end());
if (it == labels_.end()) {
return;
@@ -418,7 +417,7 @@
const gfx::Transform* rotation_transform,
std::list<ui::TouchEvent>& rewritten_events) {
auto keys = current_input_->keys();
- auto it = base::ranges::find(keys, key_event->code());
+ auto it = std::ranges::find(keys, key_event->code());
if (it == keys.end()) {
return false;
}
diff --git a/chrome/browser/ash/arc/input_overlay/actions/input_element.cc b/chrome/browser/ash/arc/input_overlay/actions/input_element.cc
index fd48fa75..0314f6bc 100644
--- a/chrome/browser/ash/arc/input_overlay/actions/input_element.cc
+++ b/chrome/browser/ash/arc/input_overlay/actions/input_element.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ash/arc/input_overlay/actions/input_element.h"
+#include <algorithm>
#include <iterator>
#include "base/containers/contains.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/arc/input_overlay/util.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/dom/dom_code.h"
@@ -59,7 +59,7 @@
const std::vector<ui::DomCode>& keys) {
auto element = std::make_unique<InputElement>();
element->input_sources_ = InputSource::IS_KEYBOARD;
- base::ranges::copy(keys, std::back_inserter(element->keys_));
+ std::ranges::copy(keys, std::back_inserter(element->keys_));
// There are four and only four keys representing move up, left, down and
// right.
DCHECK(element->keys_.size() == kActionMoveKeysSize);
@@ -163,11 +163,11 @@
void InputElement::SetKeys(std::vector<ui::DomCode>& keys) {
keys_.clear();
- base::ranges::copy(keys, std::back_inserter(keys_));
+ std::ranges::copy(keys, std::back_inserter(keys_));
}
int InputElement::GetIndexOfKey(ui::DomCode key) const {
- auto it = base::ranges::find(keys_, key);
+ auto it = std::ranges::find(keys_, key);
return it == keys_.end() ? -1 : it - keys_.begin();
}
diff --git a/chrome/browser/ash/arc/instance_throttle/arc_pip_window_throttle_observer.cc b/chrome/browser/ash/arc/instance_throttle/arc_pip_window_throttle_observer.cc
index 2f680734..aad0e3c8 100644
--- a/chrome/browser/ash/arc/instance_throttle/arc_pip_window_throttle_observer.cc
+++ b/chrome/browser/ash/arc/instance_throttle/arc_pip_window_throttle_observer.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ash/arc/instance_throttle/arc_pip_window_throttle_observer.h"
+#include <algorithm>
+
#include "ash/public/cpp/app_types_util.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
#include "base/check.h"
-#include "base/ranges/algorithm.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/window.h"
@@ -60,7 +61,7 @@
// window may be removed after a new one is added.
auto* const container = GetPipContainer();
if (!container ||
- base::ranges::none_of(container->children(), &ash::IsArcWindow)) {
+ std::ranges::none_of(container->children(), &ash::IsArcWindow)) {
SetActive(false);
}
}
diff --git a/chrome/browser/ash/borealis/borealis_app_launcher.cc b/chrome/browser/ash/borealis/borealis_app_launcher.cc
index 89b4424..74b9fcb6 100644
--- a/chrome/browser/ash/borealis/borealis_app_launcher.cc
+++ b/chrome/browser/ash/borealis/borealis_app_launcher.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ash/borealis/borealis_app_launcher.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/borealis/borealis_context.h"
#include "chrome/browser/ash/borealis/borealis_context_manager.h"
#include "chrome/browser/ash/borealis/borealis_features.h"
@@ -50,8 +51,8 @@
request.set_vm_name(ctx.vm_name());
request.set_container_name(ctx.container_name());
request.set_desktop_file_id(reg->DesktopFileId());
- base::ranges::copy(args, google::protobuf::RepeatedFieldBackInserter(
- request.mutable_files()));
+ std::ranges::copy(args, google::protobuf::RepeatedFieldBackInserter(
+ request.mutable_files()));
ash::CiceroneClient::Get()->LaunchContainerApplication(
std::move(request),
diff --git a/chrome/browser/ash/child_accounts/time_limit_test_utils.cc b/chrome/browser/ash/child_accounts/time_limit_test_utils.cc
index fd6bab3..da7da10 100644
--- a/chrome/browser/ash/child_accounts/time_limit_test_utils.cc
+++ b/chrome/browser/ash/child_accounts/time_limit_test_utils.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ash/child_accounts/time_limit_test_utils.h"
+#include <algorithm>
#include <optional>
#include <utility>
#include "base/json/json_writer.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
namespace ash {
@@ -119,7 +119,7 @@
DCHECK_EQ(quota.InNanoseconds() % base::Minutes(1).InNanoseconds(), 0);
DCHECK_LT(quota, base::Hours(24));
- base::ranges::transform(day, day.begin(), ::tolower);
+ std::ranges::transform(day, day.begin(), ::tolower);
policy->Find(kTimeUsageLimit)
->GetDict()
.Set(day, CreateTimeUsage(quota, last_updated));
diff --git a/chrome/browser/ash/child_accounts/usage_time_limit_processor.cc b/chrome/browser/ash/child_accounts/usage_time_limit_processor.cc
index 8bbfeb6..e574366 100644
--- a/chrome/browser/ash/child_accounts/usage_time_limit_processor.cc
+++ b/chrome/browser/ash/child_accounts/usage_time_limit_processor.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ash/child_accounts/usage_time_limit_processor.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -17,7 +18,6 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -1078,7 +1078,7 @@
// Transforms weekday strings into the Weekday enum.
Weekday GetWeekday(std::string weekday) {
- base::ranges::transform(weekday, weekday.begin(), ::tolower);
+ std::ranges::transform(weekday, weekday.begin(), ::tolower);
for (int i = 0; i < static_cast<int>(Weekday::kCount); i++) {
if (weekday == kTimeLimitWeekdays[i]) {
return static_cast<Weekday>(i);
diff --git a/chrome/browser/ash/crosapi/audio_service_ash.cc b/chrome/browser/ash/crosapi/audio_service_ash.cc
index 0366eab6..ed321cc 100644
--- a/chrome/browser/ash/crosapi/audio_service_ash.cc
+++ b/chrome/browser/ash/crosapi/audio_service_ash.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ash/crosapi/audio_service_ash.h"
+#include <algorithm>
+
#include "base/check.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "extensions/browser/api/audio/audio_device_id_calculator.h"
#include "extensions/browser/api/audio/audio_service_utils.h"
@@ -38,8 +39,8 @@
const extensions::DeviceInfoList& devices) {
for (auto& observer : observers_) {
std::vector<mojom::AudioDeviceInfoPtr> result;
- base::ranges::transform(devices, std::back_inserter(result),
- extensions::ConvertAudioDeviceInfoToMojom);
+ std::ranges::transform(devices, std::back_inserter(result),
+ extensions::ConvertAudioDeviceInfoToMojom);
observer->OnDeviceListChanged(std::move(result));
}
}
@@ -87,9 +88,9 @@
if (success) {
result.emplace(); // construct empty vector in-place
result->reserve(devices_src.size());
- base::ranges::transform(devices_src,
- std::back_inserter(result.value()),
- extensions::ConvertAudioDeviceInfoToMojom);
+ std::ranges::transform(devices_src,
+ std::back_inserter(result.value()),
+ extensions::ConvertAudioDeviceInfoToMojom);
}
std::move(crosapi_callback).Run(std::move(result));
diff --git a/chrome/browser/ash/crosapi/cert_database_ash.cc b/chrome/browser/ash/crosapi/cert_database_ash.cc
index 03ec22e..65dfaf6 100644
--- a/chrome/browser/ash/crosapi/cert_database_ash.cc
+++ b/chrome/browser/ash/crosapi/cert_database_ash.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/system/sys_info.h"
#include "chrome/browser/ash/kcer/kcer_factory_ash.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
@@ -209,11 +208,11 @@
// nullptr. We ignore such certificates to avoid closing the mojo pipe.
chromeos::certificate_provider::CertificateInfoList
filtered_certificate_infos;
- base::ranges::copy_if(certificate_infos,
- std::back_inserter(filtered_certificate_infos),
- [&](const auto& certificate_info) {
- return certificate_info.certificate != nullptr;
- });
+ std::ranges::copy_if(certificate_infos,
+ std::back_inserter(filtered_certificate_infos),
+ [&](const auto& certificate_info) {
+ return certificate_info.certificate != nullptr;
+ });
Profile* profile = ProfileManager::GetPrimaryUserProfile();
chromeos::CertificateProviderService* certificate_provider_service =
chromeos::CertificateProviderServiceFactory::GetForBrowserContext(
diff --git a/chrome/browser/ash/crosapi/desk_profiles_ash.cc b/chrome/browser/ash/crosapi/desk_profiles_ash.cc
index 13f6271..2441688 100644
--- a/chrome/browser/ash/crosapi/desk_profiles_ash.cc
+++ b/chrome/browser/ash/crosapi/desk_profiles_ash.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/crosapi/desk_profiles_ash.h"
+#include <algorithm>
#include <cstddef>
#include <utility>
#include <vector>
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
-#include "base/ranges/algorithm.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace crosapi {
@@ -106,8 +106,8 @@
ash::LacrosProfileSummary& DeskProfilesAsh::UpsertProfile(
ash::LacrosProfileSummary&& summary) {
- auto existing = base::ranges::find(profiles_, summary.profile_id,
- &ash::LacrosProfileSummary::profile_id);
+ auto existing = std::ranges::find(profiles_, summary.profile_id,
+ &ash::LacrosProfileSummary::profile_id);
// If we have this profile, update it.
if (existing != profiles_.end()) {
*existing = std::move(summary);
diff --git a/chrome/browser/ash/crosapi/download_controller_ash.cc b/chrome/browser/ash/crosapi/download_controller_ash.cc
index c3b89e4..e3fa472 100644
--- a/chrome/browser/ash/crosapi/download_controller_ash.cc
+++ b/chrome/browser/ash/crosapi/download_controller_ash.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ash/crosapi/download_controller_ash.h"
+#include <functional>
+
#include "base/barrier_callback.h"
#include "base/containers/extend.h"
-#include "base/ranges/functional.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
namespace crosapi {
@@ -76,8 +77,8 @@
// Sort aggregated downloads chronologically by start time.
// `start_time` equal to `std::nullopt` is by default less than any
// non-empty `start_time`.
- base::ranges::sort(aggregated_downloads, base::ranges::less{},
- &mojom::DownloadItem::start_time);
+ std::ranges::sort(aggregated_downloads, std::ranges::less{},
+ &mojom::DownloadItem::start_time);
return aggregated_downloads;
}).Then(std::move(callback)));
diff --git a/chrome/browser/ash/crostini/crostini_disk.cc b/chrome/browser/ash/crostini/crostini_disk.cc
index 031258b..c777468 100644
--- a/chrome/browser/ash/crostini/crostini_disk.cc
+++ b/chrome/browser/ash/crostini/crostini_disk.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ash/crostini/crostini_disk.h"
+#include <algorithm>
#include <cmath>
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/crostini/crostini_features.h"
@@ -139,8 +139,8 @@
return;
}
auto disk_info = std::make_unique<CrostiniDiskInfo>();
- auto image = base::ranges::find(response->images(), vm_name,
- &vm_tools::concierge::VmDiskInfo::name);
+ auto image = std::ranges::find(response->images(), vm_name,
+ &vm_tools::concierge::VmDiskInfo::name);
if (image == response->images().end()) {
// No match found for the VM:
LOG(ERROR) << "No VM found with name " << vm_name;
diff --git a/chrome/browser/ash/crostini/crostini_manager.cc b/chrome/browser/ash/crostini/crostini_manager.cc
index b341677..678fc31 100644
--- a/chrome/browser/ash/crostini/crostini_manager.cc
+++ b/chrome/browser/ash/crostini/crostini_manager.cc
@@ -23,7 +23,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/notimplemented.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
diff --git a/chrome/browser/ash/crostini/crostini_port_forwarder.cc b/chrome/browser/ash/crostini/crostini_port_forwarder.cc
index 42dc0eb..723b287 100644
--- a/chrome/browser/ash/crostini/crostini_port_forwarder.cc
+++ b/chrome/browser/ash/crostini/crostini_port_forwarder.cc
@@ -6,9 +6,10 @@
#include <fcntl.h>
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/crostini/crostini_manager.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/browser/ash/crostini/crostini_util.h"
@@ -106,7 +107,7 @@
ScopedListPrefUpdate update(pref_service,
crostini::prefs::kCrostiniPortForwarding);
base::Value::List& update_list = update.Get();
- auto it = base::ranges::find_if(update_list, [&key, this](const auto& dict) {
+ auto it = std::ranges::find_if(update_list, [&key, this](const auto& dict) {
return MatchPortRuleDict(dict, key);
});
if (it == update_list.end()) {
@@ -121,7 +122,7 @@
PrefService* pref_service = profile_->GetPrefs();
const base::Value::List& all_ports =
pref_service->GetList(crostini::prefs::kCrostiniPortForwarding);
- auto it = base::ranges::find_if(all_ports, [&key, this](const auto& dict) {
+ auto it = std::ranges::find_if(all_ports, [&key, this](const auto& dict) {
return MatchPortRuleDict(dict, key);
});
if (it == all_ports.end()) {
diff --git a/chrome/browser/ash/crostini/crostini_reporting_util.cc b/chrome/browser/ash/crostini/crostini_reporting_util.cc
index 2d96807..e4ff229 100644
--- a/chrome/browser/ash/crostini/crostini_reporting_util.cc
+++ b/chrome/browser/ash/crostini/crostini_reporting_util.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ash/crostini/crostini_reporting_util.h"
+#include <algorithm>
#include <vector>
#include "base/check.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
@@ -67,8 +67,8 @@
// Define a UTF16 version of imageloader::kTerminaComponentName for the string
// comparison below. Assert that it is equal to the ASCII component name.
static constexpr char16_t kTerminaComponentName16[] = u"cros-termina";
- DCHECK(base::ranges::equal(imageloader::kTerminaComponentName,
- kTerminaComponentName16));
+ DCHECK(std::ranges::equal(imageloader::kTerminaComponentName,
+ kTerminaComponentName16));
const std::vector<component_updater::ComponentInfo> component_list =
update_service->GetComponents();
diff --git a/chrome/browser/ash/customization/customization_document.cc b/chrome/browser/ash/customization/customization_document.cc
index f308c08..8aaa3a6 100644
--- a/chrome/browser/ash/customization/customization_document.cc
+++ b/chrome/browser/ash/customization/customization_document.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/customization/customization_document.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string_view>
@@ -21,7 +22,6 @@
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/pattern.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -402,7 +402,7 @@
initial_locale_, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Convert ICU locale to chrome ("en_US" to "en-US", etc.).
- base::ranges::for_each(configured_locales_, base::i18n::GetCanonicalLocale);
+ std::ranges::for_each(configured_locales_, base::i18n::GetCanonicalLocale);
// Let's always have configured_locales_.front() a valid entry.
if (configured_locales_.size() == 0)
diff --git a/chrome/browser/ash/customization/customization_wallpaper_downloader_browsertest.cc b/chrome/browser/ash/customization/customization_wallpaper_downloader_browsertest.cc
index b28f8c0..42fdbf7 100644
--- a/chrome/browser/ash/customization/customization_wallpaper_downloader_browsertest.cc
+++ b/chrome/browser/ash/customization/customization_wallpaper_downloader_browsertest.cc
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/ash/customization/customization_wallpaper_downloader.h"
+
#include <stddef.h>
+#include <algorithm>
#include <vector>
#include "ash/constants/ash_switches.h"
@@ -11,13 +14,11 @@
#include "ash/public/cpp/wallpaper/wallpaper_controller_observer.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "chrome/browser/ash/customization/customization_document.h"
-#include "chrome/browser/ash/customization/customization_wallpaper_downloader.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/testing_browser_process.h"
#include "content/public/test/browser_test.h"
@@ -173,7 +174,7 @@
std::vector<uint8_t> oem_wallpaper = CreateJPEGImage(
kWallpaperSize, kWallpaperSize, kCustomizedDefaultWallpaperColor);
jpeg_data_.resize(oem_wallpaper.size());
- base::ranges::copy(oem_wallpaper, jpeg_data_.begin());
+ std::ranges::copy(oem_wallpaper, jpeg_data_.begin());
// Set up the test server.
embedded_test_server()->RegisterRequestHandler(base::BindRepeating(
diff --git a/chrome/browser/ash/dbus/chrome_features_service_provider.cc b/chrome/browser/ash/dbus/chrome_features_service_provider.cc
index 3a5e48e..996e8f0 100644
--- a/chrome/browser/ash/dbus/chrome_features_service_provider.cc
+++ b/chrome/browser/ash/dbus/chrome_features_service_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/dbus/chrome_features_service_provider.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <string>
@@ -14,7 +15,6 @@
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/field_trial.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/crostini/crostini_features.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/browser/ash/plugin_vm/plugin_vm_features.h"
@@ -209,7 +209,7 @@
}
auto* const* it =
- base::ranges::find(kFeatureLookup, feature_name, &base::Feature::name);
+ std::ranges::find(kFeatureLookup, feature_name, &base::Feature::name);
if (it != std::end(kFeatureLookup)) {
SendResponse(method_call, std::move(response_sender),
base::FeatureList::IsEnabled(**it));
diff --git a/chrome/browser/ash/dbus/vm/vm_permission_service_provider.cc b/chrome/browser/ash/dbus/vm/vm_permission_service_provider.cc
index deb7fe05..8e32aa2 100644
--- a/chrome/browser/ash/dbus/vm/vm_permission_service_provider.cc
+++ b/chrome/browser/ash/dbus/vm/vm_permission_service_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/dbus/vm/vm_permission_service_provider.h"
+#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/containers/adapters.h"
#include "base/feature_list.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/ash/borealis/borealis_prefs.h"
#include "chrome/browser/ash/bruschetta/bruschetta_pref_names.h"
@@ -44,7 +44,7 @@
uint64_t high = 0, low = 0;
int count = 0;
- base::ranges::for_each(base::Reversed(bytes), [&](auto byte) {
+ std::ranges::for_each(base::Reversed(bytes), [&](auto byte) {
auto* p = count < kBytesPerUint64 ? &low : &high;
int pos = count < kBytesPerUint64 ? count : count - kBytesPerUint64;
*p += static_cast<uint64_t>(byte) << (pos * 8);
@@ -79,7 +79,7 @@
VmPermissionServiceProvider::VmMap::iterator
VmPermissionServiceProvider::FindVm(const std::string& owner_id,
const std::string& name) {
- return base::ranges::find_if(vms_, [&](const auto& vm) {
+ return std::ranges::find_if(vms_, [&](const auto& vm) {
return vm.second->owner_id == owner_id && vm.second->name == name;
});
}
diff --git a/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc b/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc
index ab74d94..d633e23 100644
--- a/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc
+++ b/chrome/browser/ash/extensions/autotest_private/autotest_private_api.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ash/extensions/autotest_private/autotest_private_api.h"
+#include <algorithm>
#include <deque>
#include <map>
#include <memory>
@@ -66,7 +67,6 @@
#include "base/metrics/field_trial.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/strcat.h"
@@ -803,7 +803,7 @@
aura::Window* FindAppWindowById(const int64_t id) {
auto list = ash::GetAppWindowList();
- auto iter = base::ranges::find(list, id, &aura::Window::GetId);
+ auto iter = std::ranges::find(list, id, &aura::Window::GetId);
if (iter == list.end()) {
return nullptr;
}
@@ -815,7 +815,7 @@
const BrowserList* list = BrowserList::GetInstance();
const web_app::AppBrowserController* (Browser::*app_controller)() const =
&Browser::app_controller;
- auto iter = base::ranges::find(*list, nullptr, app_controller);
+ auto iter = std::ranges::find(*list, nullptr, app_controller);
if (iter == list->end()) {
return nullptr;
}
@@ -6848,8 +6848,8 @@
&kEnabledFeatureForTest,
// clang-format on
};
- auto* const* it = base::ranges::find(kAllowList, params->feature_name,
- &base::Feature::name);
+ auto* const* it =
+ std::ranges::find(kAllowList, params->feature_name, &base::Feature::name);
if (it == std::end(kAllowList)) {
std::string error = base::StrCat(
{"feature ", params->feature_name,
diff --git a/chrome/browser/ash/extensions/extensions_permissions_tracker.cc b/chrome/browser/ash/extensions/extensions_permissions_tracker.cc
index df8a7c8f..3ae2bbe1 100644
--- a/chrome/browser/ash/extensions/extensions_permissions_tracker.cc
+++ b/chrome/browser/ash/extensions/extensions_permissions_tracker.cc
@@ -265,7 +265,7 @@
}
void ExtensionsPermissionsTracker::UpdateLocalState() {
- bool any_unsafe = base::ranges::any_of(
+ bool any_unsafe = std::ranges::any_of(
extension_safety_ratings_,
[](const auto& key_value) { return !key_value.second; });
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc b/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc
index fc4f9dd..952f4be0 100644
--- a/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc
+++ b/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc
@@ -28,7 +28,6 @@
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
@@ -1105,8 +1104,8 @@
for (const auto& [level, urls, components] : dlp_restriction_details) {
DlpRestrictionDetails details;
details.level = DlpRulesManagerLevelToApiEnum(level);
- base::ranges::move(urls.begin(), urls.end(),
- std::back_inserter(details.urls));
+ std::ranges::move(urls.begin(), urls.end(),
+ std::back_inserter(details.urls));
for (const auto& component : components) {
details.components.push_back(
DlpRulesManagerComponentToApiEnum(component));
diff --git a/chrome/browser/ash/extensions/file_manager/search_by_pattern.cc b/chrome/browser/ash/extensions/file_manager/search_by_pattern.cc
index 6e1a2711..1d68fec 100644
--- a/chrome/browser/ash/extensions/file_manager/search_by_pattern.cc
+++ b/chrome/browser/ash/extensions/file_manager/search_by_pattern.cc
@@ -64,7 +64,7 @@
continue;
}
// Reject files that have path in excluded paths.
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
excluded_paths, [&path](const base::FilePath& excluded_path) {
DCHECK(!path.EndsWithSeparator());
DCHECK(!excluded_path.EndsWithSeparator());
diff --git a/chrome/browser/ash/extensions/users_private/users_private_apitest.cc b/chrome/browser/ash/extensions/users_private/users_private_apitest.cc
index 096adc3e..c8fcbf640 100644
--- a/chrome/browser/ash/extensions/users_private/users_private_apitest.cc
+++ b/chrome/browser/ash/extensions/users_private/users_private_apitest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include <vector>
@@ -9,7 +10,6 @@
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/ash/extensions/users_private/users_private_delegate.h"
@@ -82,7 +82,7 @@
if (value.is_string())
email = value.GetString();
- auto iter = base::ranges::find(user_list_, email);
+ auto iter = std::ranges::find(user_list_, email);
if (iter != user_list_.end())
user_list_.erase(iter);
diff --git a/chrome/browser/ash/file_manager/app_service_file_tasks.cc b/chrome/browser/ash/file_manager/app_service_file_tasks.cc
index 51abd5c2..83a4a076 100644
--- a/chrome/browser/ash/file_manager/app_service_file_tasks.cc
+++ b/chrome/browser/ash/file_manager/app_service_file_tasks.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_manager/app_service_file_tasks.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <string_view>
@@ -18,7 +19,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
diff --git a/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc b/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
index a8265ab9..786348cb 100644
--- a/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
+++ b/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_manager/app_service_file_tasks.h"
+#include <functional>
#include <memory>
#include <optional>
#include <string>
@@ -11,7 +12,6 @@
#include "ash/constants/ash_features.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/functional.h"
#include "base/strings/escape.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@@ -141,8 +141,8 @@
file_tasks::FindAppServiceTasks(profile(), entries, file_urls,
dlp_source_urls, &resulting_tasks->tasks);
// Sort by app ID so we don't rely on ordering.
- base::ranges::sort(
- resulting_tasks->tasks, base::ranges::less(),
+ std::ranges::sort(
+ resulting_tasks->tasks, std::ranges::less(),
[](const auto& task) { return task.task_descriptor.app_id; });
return resulting_tasks;
diff --git a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.cc b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.cc
index c361f7dc..5a22c24 100644
--- a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.cc
+++ b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -14,7 +15,6 @@
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/file_manager/copy_or_move_io_task_impl.h"
#include "chrome/browser/ash/file_manager/file_manager_copy_or_move_hook_delegate.h"
#include "chrome/browser/ash/file_manager/file_manager_copy_or_move_hook_file_check_delegate.h"
@@ -179,7 +179,7 @@
if (!settings_.empty()) {
// The value of `block_until_verdict` is consistent for all settings, so we
// just check the value for the first valid setting.
- auto valid_setting = base::ranges::find_if(
+ auto valid_setting = std::ranges::find_if(
settings_,
[](const std::optional<enterprise_connectors::AnalysisSettings>&
setting) { return setting.has_value(); });
@@ -431,7 +431,7 @@
// delegates as the number of sources. A delegate in
// `file_transfer_analysis_delegates_` is valid if for the
// source-destination-pair scanning is enabled, nullptr otherwise.
- auto delegate_it = base::ranges::find_if(
+ auto delegate_it = std::ranges::find_if(
file_transfer_analysis_delegates_,
[](const std::unique_ptr<
enterprise_connectors::FileTransferAnalysisDelegate>& delegate) {
@@ -477,12 +477,12 @@
// If the user has proceeded the warning, then we need to notify the
// `FileTransferAnalysisDelegate`s to report the bypass of the warning and to
// mark warned files as allowed for a transfer.
- base::ranges::for_each(file_transfer_analysis_delegates_,
- [&user_justification](const auto& delegate) {
- if (delegate) {
- delegate->BypassWarnings(user_justification);
- }
- });
+ std::ranges::for_each(file_transfer_analysis_delegates_,
+ [&user_justification](const auto& delegate) {
+ if (delegate) {
+ delegate->BypassWarnings(user_justification);
+ }
+ });
StartTransfer();
}
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
index 22a4142..833e31e 100644
--- a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
+++ b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <compare>
#include <iterator>
#include <map>
@@ -53,7 +54,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
#include "base/process/process_handle.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/escape.h"
@@ -3736,7 +3736,7 @@
if (name == "getVolumesCount") {
file_manager::VolumeManager* volume_manager = VolumeManager::Get(profile());
- *output = base::NumberToString(base::ranges::count_if(
+ *output = base::NumberToString(std::ranges::count_if(
volume_manager->GetVolumeList(),
[](const auto& volume) { return !volume->hidden(); }));
return;
diff --git a/chrome/browser/ash/file_manager/file_manager_test_util.cc b/chrome/browser/ash/file_manager/file_manager_test_util.cc
index 84880aa6..2fd5513d 100644
--- a/chrome/browser/ash/file_manager/file_manager_test_util.cc
+++ b/chrome/browser/ash/file_manager/file_manager_test_util.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ash/file_manager/file_manager_test_util.h"
+#include <algorithm>
+
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/to_string.h"
#include "base/test/bind.h"
#include "chrome/browser/apps/app_service/app_service_proxy_ash.h"
@@ -66,7 +67,7 @@
OpenOperationResult FolderInMyFiles::Open(const base::FilePath& file) {
const auto& it =
- base::ranges::find(files_, file.BaseName(), &base::FilePath::BaseName);
+ std::ranges::find(files_, file.BaseName(), &base::FilePath::BaseName);
EXPECT_FALSE(it == files_.end());
if (it == files_.end()) {
return platform_util::OPEN_FAILED_PATH_NOT_FOUND;
diff --git a/chrome/browser/ash/file_manager/file_tasks.cc b/chrome/browser/ash/file_manager/file_tasks.cc
index 7a1651f..bad56155 100644
--- a/chrome/browser/ash/file_manager/file_tasks.cc
+++ b/chrome/browser/ash/file_manager/file_tasks.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <cstddef>
#include <iterator>
#include <map>
@@ -28,7 +29,6 @@
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -173,8 +173,8 @@
// Returns true if path_mime_set contains a Google document.
bool ContainsGoogleDocument(const std::vector<extensions::EntryInfo>& entries) {
- return base::ranges::any_of(entries, &drive::util::HasHostedDocumentExtension,
- &extensions::EntryInfo::path);
+ return std::ranges::any_of(entries, &drive::util::HasHostedDocumentExtension,
+ &extensions::EntryInfo::path);
}
// Removes all tasks except tasks handled by file manager.
@@ -208,7 +208,7 @@
// over chrome://media-app.
void AdjustTasksForMediaApp(const std::vector<extensions::EntryInfo>& entries,
std::vector<FullTaskDescriptor>* tasks) {
- const auto media_app_task = base::ranges::find(
+ const auto media_app_task = std::ranges::find(
*tasks, ash::kMediaAppId,
[](const auto& task) { return task.task_descriptor.app_id; });
@@ -596,7 +596,7 @@
std::set<std::string> mime_types_to_set = mime_types;
std::set<std::string> suffixes_to_set;
// Suffixes are case insensitive.
- base::ranges::transform(
+ std::ranges::transform(
suffixes, std::inserter(suffixes_to_set, suffixes_to_set.begin()),
[](const std::string& suffix) { return base::ToLowerASCII(suffix); });
@@ -650,7 +650,7 @@
std::set<std::string> suffixes_to_remove;
// Suffixes are case insensitive.
- base::ranges::transform(
+ std::ranges::transform(
suffixes, std::inserter(suffixes_to_remove, suffixes_to_remove.begin()),
[](const std::string& suffix) { return base::ToLowerASCII(suffix); });
@@ -922,8 +922,8 @@
FindTasksCallback callback) {
DCHECK(profile);
auto resulting_tasks = std::make_unique<ResultingTasks>();
- bool has_encrypted_item = base::ranges::any_of(entries, &IsEncryptedEntry);
- bool all_encrypted_items = base::ranges::all_of(entries, &IsEncryptedEntry);
+ bool has_encrypted_item = std::ranges::any_of(entries, &IsEncryptedEntry);
+ bool all_encrypted_items = std::ranges::all_of(entries, &IsEncryptedEntry);
if (has_encrypted_item) {
if (all_encrypted_items) {
resulting_tasks->tasks.emplace_back(FullTaskDescriptor(
diff --git a/chrome/browser/ash/file_manager/file_tasks_browsertest.cc b/chrome/browser/ash/file_manager/file_tasks_browsertest.cc
index c379219..43ae8ea 100644
--- a/chrome/browser/ash/file_manager/file_tasks_browsertest.cc
+++ b/chrome/browser/ash/file_manager/file_tasks_browsertest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_manager/file_tasks.h"
+#include <algorithm>
#include <cstring>
#include <memory>
#include <string_view>
@@ -19,7 +20,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
@@ -147,8 +147,8 @@
ASSERT_TRUE(resulting_tasks) << expectation.file_extensions;
--*remaining;
- auto default_task = base::ranges::find_if(resulting_tasks->tasks,
- &FullTaskDescriptor::is_default);
+ auto default_task = std::ranges::find_if(resulting_tasks->tasks,
+ &FullTaskDescriptor::is_default);
// Early exit for the uncommon situation where no default should be set.
if (!expectation.app_id) {
@@ -164,8 +164,8 @@
<< " for extension: " << expectation.file_extensions;
// Verify no other task is set as default.
- EXPECT_EQ(1, base::ranges::count_if(resulting_tasks->tasks,
- &FullTaskDescriptor::is_default))
+ EXPECT_EQ(1, std::ranges::count_if(resulting_tasks->tasks,
+ &FullTaskDescriptor::is_default))
<< expectation.file_extensions;
}
@@ -766,8 +766,8 @@
bool expect_dlp_blocked =
test.dlp_source_url && strcmp(test.dlp_source_url, blockedUrl) == 0;
EXPECT_EQ(expect_dlp_blocked,
- base::ranges::all_of(resulting_tasks.tasks,
- &FullTaskDescriptor::is_dlp_blocked));
+ std::ranges::all_of(resulting_tasks.tasks,
+ &FullTaskDescriptor::is_dlp_blocked));
}
}
@@ -994,7 +994,7 @@
std::vector<FullTaskDescriptor> tasks =
file_manager::test::GetTasksForFile(profile, test_file_path);
- const size_t google_workspace_task_count = base::ranges::count_if(
+ const size_t google_workspace_task_count = std::ranges::count_if(
tasks, &IsWebDriveOfficeTask, &FullTaskDescriptor::task_descriptor);
EXPECT_EQ(
google_workspace_task_count,
@@ -1002,7 +1002,7 @@
? 1U
: 0U);
- const size_t microsoft_office_task_count = base::ranges::count_if(
+ const size_t microsoft_office_task_count = std::ranges::count_if(
tasks, &IsOpenInOfficeTask, &FullTaskDescriptor::task_descriptor);
EXPECT_EQ(microsoft_office_task_count,
chromeos::cloud_upload::IsMicrosoftOfficeCloudUploadAllowed(
diff --git a/chrome/browser/ash/file_manager/file_tasks_unittest.cc b/chrome/browser/ash/file_manager/file_tasks_unittest.cc
index ae559f7..35350cd 100644
--- a/chrome/browser/ash/file_manager/file_tasks_unittest.cc
+++ b/chrome/browser/ash/file_manager/file_tasks_unittest.cc
@@ -17,7 +17,6 @@
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
@@ -284,9 +283,9 @@
void CheckCorrectPolicyAssignment(std::string_view default_app_id) {
ASSERT_EQ(resulting_tasks()->policy_default_handler_status,
PolicyDefaultHandlerStatus::kDefaultHandlerAssignedByPolicy);
- ASSERT_EQ(base::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
+ ASSERT_EQ(std::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
1);
- ASSERT_EQ(base::ranges::find_if(resulting_tasks()->tasks, &IsDefaultTask)
+ ASSERT_EQ(std::ranges::find_if(resulting_tasks()->tasks, &IsDefaultTask)
->task_descriptor.app_id,
default_app_id);
}
@@ -295,10 +294,10 @@
std::string_view virtual_task_id) {
ASSERT_EQ(resulting_tasks()->policy_default_handler_status,
PolicyDefaultHandlerStatus::kDefaultHandlerAssignedByPolicy);
- ASSERT_EQ(base::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
+ ASSERT_EQ(std::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
1);
const auto& task =
- base::ranges::find_if(resulting_tasks()->tasks, &IsDefaultTask)
+ std::ranges::find_if(resulting_tasks()->tasks, &IsDefaultTask)
->task_descriptor;
ASSERT_TRUE(IsVirtualTask(task));
ASSERT_THAT(task.action_id, testing::EndsWith(virtual_task_id));
@@ -307,13 +306,13 @@
void CheckConflictingPolicyAssignment() {
ASSERT_EQ(resulting_tasks()->policy_default_handler_status,
PolicyDefaultHandlerStatus::kIncorrectAssignment);
- ASSERT_EQ(base::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
+ ASSERT_EQ(std::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
0);
}
void CheckNoPolicyAssignment() {
ASSERT_FALSE(resulting_tasks()->policy_default_handler_status);
- ASSERT_EQ(base::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
+ ASSERT_EQ(std::ranges::count_if(resulting_tasks()->tasks, &IsDefaultTask),
0);
}
diff --git a/chrome/browser/ash/file_manager/office_file_tasks.cc b/chrome/browser/ash/file_manager/office_file_tasks.cc
index 0bb9b38..70066da 100644
--- a/chrome/browser/ash/file_manager/office_file_tasks.cc
+++ b/chrome/browser/ash/file_manager/office_file_tasks.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/file_manager/office_file_tasks.h"
+#include <algorithm>
#include <initializer_list>
#include <string_view>
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/types/cxx23_to_underlying.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@@ -112,7 +112,7 @@
bool AnyFileNeedsUploadToDrive(
Profile* profile,
const std::vector<storage::FileSystemURL>& file_urls) {
- return !base::ranges::all_of(file_urls, [profile](const auto& url) {
+ return !std::ranges::all_of(file_urls, [profile](const auto& url) {
return ash::cloud_upload::PathIsOnDriveFS(profile, url.path());
});
}
diff --git a/chrome/browser/ash/file_manager/trash_io_task.cc b/chrome/browser/ash/file_manager/trash_io_task.cc
index ae8f5fd..44c1722 100644
--- a/chrome/browser/ash/file_manager/trash_io_task.cc
+++ b/chrome/browser/ash/file_manager/trash_io_task.cc
@@ -6,12 +6,13 @@
#include <sys/xattr.h>
+#include <algorithm>
+
#include "ash/metrics/histogram_macros.h"
#include "base/containers/adapters.h"
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/i18n/time_formatting.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/system/sys_info.h"
@@ -190,10 +191,10 @@
// however in the case of nested directories, reverse lexicographical order is
// preferred to ensure the closer parent path by depth is chosen.
const trash::TrashPathsMap::reverse_iterator& trash_parent_path_it =
- base::ranges::find_if(base::Reversed(free_space_map_),
- [&source_path](const auto& it) {
- return it.first.IsParent(source_path);
- });
+ std::ranges::find_if(base::Reversed(free_space_map_),
+ [&source_path](const auto& it) {
+ return it.first.IsParent(source_path);
+ });
if (trash_parent_path_it == free_space_map_.rend()) {
// The `source_path` is not parented at a supported Trash location, bail
diff --git a/chrome/browser/ash/file_manager/virtual_file_tasks.cc b/chrome/browser/ash/file_manager/virtual_file_tasks.cc
index 09e4f202..7542e1e 100644
--- a/chrome/browser/ash/file_manager/virtual_file_tasks.cc
+++ b/chrome/browser/ash/file_manager/virtual_file_tasks.cc
@@ -47,10 +47,10 @@
bool AllEntriesMatchAtLeastOneMimeType(
const std::vector<extensions::EntryInfo>& entries,
const std::vector<std::string>& mime_types) {
- return base::ranges::all_of(
+ return std::ranges::all_of(
entries,
[&](const std::string& entry_mime_type) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
mime_types, [&](const std::string& mime_type) {
return apps_util::MimeTypeMatched(entry_mime_type, mime_type);
});
@@ -63,10 +63,10 @@
bool AllUrlsMatchAtLeastOneFileExtension(
const std::vector<GURL>& file_urls,
const std::vector<std::string>& file_extensions) {
- return base::ranges::all_of(
+ return std::ranges::all_of(
file_urls,
[&](const std::string& file_name) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
file_extensions, [&](const std::string& file_extension) {
return apps_util::ExtensionMatched(file_name, file_extension);
});
@@ -121,7 +121,7 @@
return nullptr;
}
const auto& tasks = GetVirtualTasks();
- auto itr = base::ranges::find(tasks, task.action_id, &VirtualTask::id);
+ auto itr = std::ranges::find(tasks, task.action_id, &VirtualTask::id);
if (itr == tasks.end()) {
return nullptr;
}
diff --git a/chrome/browser/ash/file_manager/virtual_tasks/install_isolated_web_app_virtual_task_unittest.cc b/chrome/browser/ash/file_manager/virtual_tasks/install_isolated_web_app_virtual_task_unittest.cc
index 4beeb0f7..fed7efa 100644
--- a/chrome/browser/ash/file_manager/virtual_tasks/install_isolated_web_app_virtual_task_unittest.cc
+++ b/chrome/browser/ash/file_manager/virtual_tasks/install_isolated_web_app_virtual_task_unittest.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ash/file_manager/virtual_tasks/install_isolated_web_app_virtual_task.h"
+#include <algorithm>
#include <memory>
#include <vector>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "chrome/browser/ash/file_manager/file_tasks.h"
@@ -66,7 +66,7 @@
bool Matches(const std::vector<GURL>& file_urls) {
std::vector<extensions::EntryInfo> entries;
- base::ranges::transform(
+ std::ranges::transform(
file_urls, std::back_inserter(entries), [](const GURL& file_url) {
return extensions::EntryInfo(base::FilePath(file_url.path()),
"application/octet-stream",
@@ -85,12 +85,12 @@
std::vector<FileSystemURL> file_system_urls;
auto storage_key =
blink::StorageKey::CreateFromStringForTesting("https://example.com/");
- base::ranges::transform(file_urls, std::back_inserter(file_system_urls),
- [&](const GURL& url) {
- return storage::FileSystemURL::CreateForTest(
- storage_key, storage::kFileSystemTypeLocal,
- base::FilePath::FromUTF8Unsafe(url.path()));
- });
+ std::ranges::transform(file_urls, std::back_inserter(file_system_urls),
+ [&](const GURL& url) {
+ return storage::FileSystemURL::CreateForTest(
+ storage_key, storage::kFileSystemTypeLocal,
+ base::FilePath::FromUTF8Unsafe(url.path()));
+ });
return ExecuteVirtualTask(
&profile_, {kFileManagerSwaAppId, TASK_TYPE_WEB_APP, task_.id()},
diff --git a/chrome/browser/ash/file_manager/volume_manager_unittest.cc b/chrome/browser/ash/file_manager/volume_manager_unittest.cc
index 88df250..ec8f1ac 100644
--- a/chrome/browser/ash/file_manager/volume_manager_unittest.cc
+++ b/chrome/browser/ash/file_manager/volume_manager_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <string>
@@ -19,7 +20,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_command_line.h"
@@ -1104,7 +1104,7 @@
volume_manager()->GetVolumeList();
ASSERT_GT(volume_list.size(), 0u);
auto volume =
- base::ranges::find(volume_list, "downloads:MyFiles", &Volume::volume_id);
+ std::ranges::find(volume_list, "downloads:MyFiles", &Volume::volume_id);
EXPECT_FALSE(volume == volume_list.end());
EXPECT_EQ(VOLUME_TYPE_DOWNLOADS_DIRECTORY, (*volume)->type());
}
@@ -1523,8 +1523,8 @@
if (volume_list.size() == 0u) {
return false;
}
- auto volume = base::ranges::find(volume_list, "downloads:MyFiles",
- &Volume::volume_id);
+ auto volume =
+ std::ranges::find(volume_list, "downloads:MyFiles", &Volume::volume_id);
return volume != volume_list.end() &&
(*volume)->type() == VOLUME_TYPE_DOWNLOADS_DIRECTORY;
}
@@ -1536,7 +1536,7 @@
return false;
}
auto volume =
- base::ranges::find(volume_list, "android_files:0", &Volume::volume_id);
+ std::ranges::find(volume_list, "android_files:0", &Volume::volume_id);
return volume != volume_list.end() &&
(*volume)->type() == VOLUME_TYPE_ANDROID_FILES;
}
diff --git a/chrome/browser/ash/file_suggest/drive_recent_file_suggestion_provider.cc b/chrome/browser/ash/file_suggest/drive_recent_file_suggestion_provider.cc
index 8ca30a35..9b727eae 100644
--- a/chrome/browser/ash/file_suggest/drive_recent_file_suggestion_provider.cc
+++ b/chrome/browser/ash/file_suggest/drive_recent_file_suggestion_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_suggest/drive_recent_file_suggestion_provider.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/functional/callback.h"
#include "base/i18n/time_formatting.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "chrome/browser/ash/app_list/search/files/justifications.h"
@@ -410,7 +410,7 @@
}
}
- base::ranges::sort(results, [](const auto& lhs, const auto& rhs) {
+ std::ranges::sort(results, [](const auto& lhs, const auto& rhs) {
if ((lhs.modified_time || rhs.modified_time) &&
lhs.modified_time != rhs.modified_time) {
return lhs.modified_time.value_or(base::Time()) >
diff --git a/chrome/browser/ash/file_suggest/local_file_suggestion_provider.cc b/chrome/browser/ash/file_suggest/local_file_suggestion_provider.cc
index 101d58d..dce24307 100644
--- a/chrome/browser/ash/file_suggest/local_file_suggestion_provider.cc
+++ b/chrome/browser/ash/file_suggest/local_file_suggestion_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/file_suggest/local_file_suggestion_provider.h"
+#include <algorithm>
#include <optional>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/ash/app_list/search/files/justifications.h"
#include "chrome/browser/ash/app_list/search/ranking/util.h"
@@ -53,10 +53,10 @@
const auto& path = base::FilePath::FromUTF8Unsafe(path_score.first);
// Exclude any paths that are parented at an enabled trash location.
- if (base::ranges::any_of(trash_paths,
- [&path](const base::FilePath& trash_path) {
- return trash_path.IsParent(path);
- })) {
+ if (std::ranges::any_of(trash_paths,
+ [&path](const base::FilePath& trash_path) {
+ return trash_path.IsParent(path);
+ })) {
invalid_results.emplace_back(path);
continue;
}
diff --git a/chrome/browser/ash/file_system_provider/fake_provided_file_system.cc b/chrome/browser/ash/file_system_provider/fake_provided_file_system.cc
index 507d6e7d..3d21d72 100644
--- a/chrome/browser/ash/file_system_provider/fake_provided_file_system.cc
+++ b/chrome/browser/ash/file_system_provider/fake_provided_file_system.cc
@@ -408,7 +408,7 @@
// path in `entries_`.
if (!recursive) {
const Entries::const_iterator it =
- base::ranges::find_if(entries_, [entry_path](auto& entry_it) {
+ std::ranges::find_if(entries_, [entry_path](auto& entry_it) {
return entry_path.IsParent(entry_it.first);
});
if (it != entries_.end()) {
diff --git a/chrome/browser/ash/file_system_provider/operations/get_metadata.cc b/chrome/browser/ash/file_system_provider/operations/get_metadata.cc
index f71b7b5..960e010 100644
--- a/chrome/browser/ash/file_system_provider/operations/get_metadata.cc
+++ b/chrome/browser/ash/file_system_provider/operations/get_metadata.cc
@@ -6,12 +6,12 @@
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <string>
#include <tuple>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/ash/file_system_provider/provided_file_system_interface.h"
#include "chrome/common/extensions/api/file_system_provider.h"
@@ -136,8 +136,8 @@
const std::string expected_prefix = "data:";
std::string thumbnail_prefix =
metadata.thumbnail->substr(0, expected_prefix.size());
- base::ranges::transform(thumbnail_prefix, thumbnail_prefix.begin(),
- ::tolower);
+ std::ranges::transform(thumbnail_prefix, thumbnail_prefix.begin(),
+ ::tolower);
if (expected_prefix != thumbnail_prefix)
return false;
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
index e4cb99f..8bd7068 100644
--- a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
+++ b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/ash/floating_workspace/floating_workspace_service.h"
+#include <algorithm>
#include <memory>
#include "ash/constants/ash_features.h"
@@ -14,7 +15,6 @@
#include "ash/wm/desks/templates/saved_desk_metrics_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
@@ -211,10 +211,10 @@
std::vector<raw_ptr<const sync_sessions::SyncedSession,
VectorExperimental>>* sessions) override {
*sessions = foreign_sessions_;
- base::ranges::sort(*sessions, std::greater(),
- [](const sync_sessions::SyncedSession* session) {
- return session->GetModifiedTime();
- });
+ std::ranges::sort(*sessions, std::greater(),
+ [](const sync_sessions::SyncedSession* session) {
+ return session->GetModifiedTime();
+ });
return !sessions->empty();
}
diff --git a/chrome/browser/ash/guest_os/guest_id.cc b/chrome/browser/ash/guest_os/guest_id.cc
index fb1adb1..672fc0d 100644
--- a/chrome/browser/ash/guest_os/guest_id.cc
+++ b/chrome/browser/ash/guest_os/guest_id.cc
@@ -12,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/ash/guest_os/guest_os_pref_names.h"
@@ -149,7 +148,7 @@
const GuestId& container_id,
base::Value::Dict properties) {
ScopedListPrefUpdate updater(profile->GetPrefs(), prefs::kGuestOsContainers);
- if (base::ranges::any_of(*updater, [&container_id](const auto& dict) {
+ if (std::ranges::any_of(*updater, [&container_id](const auto& dict) {
return MatchContainerDict(dict, container_id);
})) {
return;
@@ -168,7 +167,7 @@
auto* pref_service = profile->GetPrefs();
ScopedListPrefUpdate updater(pref_service, prefs::kGuestOsContainers);
base::Value::List& update_list = updater.Get();
- auto it = base::ranges::find_if(update_list, [&](const auto& dict) {
+ auto it = std::ranges::find_if(update_list, [&](const auto& dict) {
return MatchContainerDict(dict, container_id);
});
if (it != update_list.end()) {
@@ -180,7 +179,7 @@
auto* pref_service = profile->GetPrefs();
ScopedListPrefUpdate updater(pref_service, prefs::kGuestOsContainers);
base::Value::List& update_list = updater.Get();
- auto it = base::ranges::find(update_list, vm_type, &VmTypeFromPref);
+ auto it = std::ranges::find(update_list, vm_type, &VmTypeFromPref);
if (it != update_list.end()) {
update_list.erase(it);
}
@@ -204,7 +203,7 @@
const std::string& key,
base::Value value) {
ScopedListPrefUpdate updater(profile->GetPrefs(), prefs::kGuestOsContainers);
- auto it = base::ranges::find_if(*updater, [&](const auto& dict) {
+ auto it = std::ranges::find_if(*updater, [&](const auto& dict) {
return MatchContainerDict(dict, container_id);
});
if (it != updater->end()) {
@@ -221,7 +220,7 @@
const std::string& key,
base::Value::Dict dict) {
ScopedListPrefUpdate updater(profile->GetPrefs(), prefs::kGuestOsContainers);
- auto it = base::ranges::find_if(*updater, [&](const auto& dict) {
+ auto it = std::ranges::find_if(*updater, [&](const auto& dict) {
return MatchContainerDict(dict, container_id);
});
if (it != updater->end()) {
diff --git a/chrome/browser/ash/guest_os/guest_os_launcher.cc b/chrome/browser/ash/guest_os/guest_os_launcher.cc
index d7858bf..1ec49d1 100644
--- a/chrome/browser/ash/guest_os/guest_os_launcher.cc
+++ b/chrome/browser/ash/guest_os/guest_os_launcher.cc
@@ -199,8 +199,8 @@
request.set_display_scaling(
vm_tools::cicerone::LaunchContainerApplicationRequest::SCALED);
}
- base::ranges::copy(files, google::protobuf::RepeatedFieldBackInserter(
- request.mutable_files()));
+ std::ranges::copy(files, google::protobuf::RepeatedFieldBackInserter(
+ request.mutable_files()));
const std::vector<vm_tools::cicerone::ContainerFeature> container_features =
crostini::GetContainerFeatures();
diff --git a/chrome/browser/ash/guest_os/guest_os_share_path.cc b/chrome/browser/ash/guest_os/guest_os_share_path.cc
index 6d8a7b5..c4ec487 100644
--- a/chrome/browser/ash/guest_os/guest_os_share_path.cc
+++ b/chrome/browser/ash/guest_os/guest_os_share_path.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/guest_os/guest_os_share_path.h"
+#include <algorithm>
#include <optional>
#include "base/barrier_callback.h"
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/crostini/crostini_manager.h"
#include "chrome/browser/ash/crostini/crostini_util.h"
@@ -125,7 +125,7 @@
<< " for VM " << vm_name;
return;
}
- auto it = base::ranges::find(*found, base::Value(vm_name));
+ auto it = std::ranges::find(*found, base::Value(vm_name));
if (it == found->end()) {
LOG(WARNING) << "VM not in prefs to unshare path " << path.value()
<< " for VM " << vm_name;
diff --git a/chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry_unittest.cc b/chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry_unittest.cc
index 72f8ca0..00ae4f7 100644
--- a/chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry_unittest.cc
+++ b/chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry_unittest.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry.h"
+#include <algorithm>
#include <vector>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/guest_os/guest_os_test_helpers.h"
#include "chrome/browser/ash/guest_os/public/guest_os_mount_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,7 +25,7 @@
ids_.push_back(id);
}
void OnUnregistered(Id id) override {
- auto pos = base::ranges::find(ids_, id);
+ auto pos = std::ranges::find(ids_, id);
if (pos != ids_.end()) {
ids_.erase(pos);
}
diff --git a/chrome/browser/ash/input_method/input_method_engine.cc b/chrome/browser/ash/input_method/input_method_engine.cc
index 1ccfbca..9588891 100644
--- a/chrome/browser/ash/input_method/input_method_engine.cc
+++ b/chrome/browser/ash/input_method/input_method_engine.cc
@@ -1101,7 +1101,7 @@
return true;
}
- const bool any_non_empty_label = base::ranges::any_of(
+ const bool any_non_empty_label = std::ranges::any_of(
candidates,
[](const Candidate& candidate) { return !candidate.label.empty(); });
return any_non_empty_label;
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl.cc b/chrome/browser/ash/input_method/input_method_manager_impl.cc
index ee1c06c2..b7c34f4 100644
--- a/chrome/browser/ash/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/ash/input_method/input_method_manager_impl.cc
@@ -11,6 +11,7 @@
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <sstream>
@@ -25,7 +26,6 @@
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -671,7 +671,7 @@
}
const auto currently_enabled_iter =
- base::ranges::find(enabled_input_method_ids_, entry.first);
+ std::ranges::find(enabled_input_method_ids_, entry.first);
bool currently_enabled =
currently_enabled_iter != enabled_input_method_ids_.end();
@@ -787,8 +787,8 @@
GetEnabledInputMethodsSortedByLocalizedDisplayNames();
auto iter =
- base::ranges::find(sorted_enabled_input_methods, current_input_method_id,
- &InputMethodDescriptor::id);
+ std::ranges::find(sorted_enabled_input_methods, current_input_method_id,
+ &InputMethodDescriptor::id);
if (iter != sorted_enabled_input_methods.end()) {
++iter;
@@ -813,7 +813,7 @@
}
const auto iter =
- base::ranges::find(enabled_input_method_ids_, last_used_input_method_id_);
+ std::ranges::find(enabled_input_method_ids_, last_used_input_method_id_);
if (iter == enabled_input_method_ids_.end()) {
// last_used_input_method_id_ is not supported.
SwitchToNextInputMethod();
diff --git a/chrome/browser/ash/input_method/input_method_syncer.cc b/chrome/browser/ash/input_method/input_method_syncer.cc
index 94a0f705..255d373 100644
--- a/chrome/browser/ash/input_method/input_method_syncer.cc
+++ b/chrome/browser/ash/input_method/input_method_syncer.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/input_method/input_method_syncer.h"
+#include <algorithm>
#include <set>
#include <string_view>
#include <vector>
#include "ash/constants/ash_features.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/task/task_runner.h"
@@ -41,8 +41,8 @@
}
// Convert engine IDs to input method extension IDs.
- base::ranges::transform(values->begin(), values->end(), values->begin(),
- extension_ime_util::GetInputMethodIDByEngineID);
+ std::ranges::transform(values->begin(), values->end(), values->begin(),
+ extension_ime_util::GetInputMethodIDByEngineID);
// Remove values that aren't found in the set of supported input method IDs.
auto it = values->begin();
@@ -203,8 +203,8 @@
std::vector<std::string> new_token_values;
new_token_values = base::SplitString(
preload_engines, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
- base::ranges::transform(new_token_values, new_token_values.begin(),
- extension_ime_util::GetComponentIDByInputMethodID);
+ std::ranges::transform(new_token_values, new_token_values.begin(),
+ extension_ime_util::GetComponentIDByInputMethodID);
std::string preload_engines_syncable = preload_engines_syncable_.GetValue();
synced_tokens =
base::SplitStringPiece(preload_engines_syncable, ",",
@@ -301,8 +301,8 @@
std::vector<std::string> engines =
base::SplitString(preload_engines_.GetValue(), ",", base::TRIM_WHITESPACE,
base::SPLIT_WANT_ALL);
- base::ranges::transform(engines, engines.begin(),
- extension_ime_util::GetComponentIDByInputMethodID);
+ std::ranges::transform(engines, engines.begin(),
+ extension_ime_util::GetComponentIDByInputMethodID);
preload_engines_syncable_.SetValue(base::JoinString(engines, ","));
}
diff --git a/chrome/browser/ash/input_method/native_input_method_engine_observer.cc b/chrome/browser/ash/input_method/native_input_method_engine_observer.cc
index c3761b4..f96151d 100644
--- a/chrome/browser/ash/input_method/native_input_method_engine_observer.cc
+++ b/chrome/browser/ash/input_method/native_input_method_engine_observer.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/input_method/native_input_method_engine_observer.h"
+#include <algorithm>
#include <utility>
#include "ash/constants/ash_features.h"
@@ -17,7 +18,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_offset_string_conversions.h"
@@ -644,7 +644,7 @@
return true;
}
- const bool any_non_empty_label = base::ranges::any_of(
+ const bool any_non_empty_label = std::ranges::any_of(
candidates, [](const ime::mojom::CandidatePtr& candidate) {
return !candidate->label->empty();
});
diff --git a/chrome/browser/ash/kerberos/kerberos_credentials_manager.cc b/chrome/browser/ash/kerberos/kerberos_credentials_manager.cc
index d8725bd..8501fd4b 100644
--- a/chrome/browser/ash/kerberos/kerberos_credentials_manager.cc
+++ b/chrome/browser/ash/kerberos/kerberos_credentials_manager.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/kerberos/kerberos_credentials_manager.h"
+#include <algorithm>
#include <vector>
#include "ash/webui/settings/public/constants/routes.mojom.h"
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -471,8 +471,8 @@
kerberos::ErrorType error) {
// Reset the |runner|. Note that |updated_principal| is passed by value,
// not by reference, since |runner| owns the reference.
- auto it = base::ranges::find(add_account_runners_, runner,
- &std::unique_ptr<KerberosAddAccountRunner>::get);
+ auto it = std::ranges::find(add_account_runners_, runner,
+ &std::unique_ptr<KerberosAddAccountRunner>::get);
// Semantically, this `CHECK()` should never trigger. However, it protects
// the `erase()` call from semantically incorrect changes to this class.
diff --git a/chrome/browser/ash/login/existing_user_controller.cc b/chrome/browser/ash/login/existing_user_controller.cc
index 07bbc29..0d7d154b 100644
--- a/chrome/browser/ash/login/existing_user_controller.cc
+++ b/chrome/browser/ash/login/existing_user_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/login/existing_user_controller.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <tuple>
@@ -27,7 +28,6 @@
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -274,7 +274,7 @@
AccountId GetPublicSessionAutoLoginAccountId(
const std::vector<policy::DeviceLocalAccount>& device_local_accounts,
const std::string& auto_login_account_id) {
- const auto& it = base::ranges::find_if(
+ const auto& it = std::ranges::find_if(
device_local_accounts, [&auto_login_account_id](const auto& account) {
return account.account_id == auto_login_account_id;
});
diff --git a/chrome/browser/ash/login/lock/screen_locker.cc b/chrome/browser/ash/login/lock/screen_locker.cc
index cc1da9aa..74f6206 100644
--- a/chrome/browser/ash/login/lock/screen_locker.cc
+++ b/chrome/browser/ash/login/lock/screen_locker.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/login/lock/screen_locker.h"
+#include <algorithm>
#include <optional>
#include "ash/constants/ash_features.h"
@@ -19,7 +20,6 @@
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/current_thread.h"
@@ -516,11 +516,11 @@
user_manager::UserList ScreenLocker::GetUsersToShow() const {
user_manager::UserList users_to_show;
// Filter out Managed Guest Session users as they should not appear on the UI.
- base::ranges::copy_if(users_, std::back_inserter(users_to_show),
- [](const user_manager::User* user) {
- return user->GetType() !=
- user_manager::UserType::kPublicAccount;
- });
+ std::ranges::copy_if(users_, std::back_inserter(users_to_show),
+ [](const user_manager::User* user) {
+ return user->GetType() !=
+ user_manager::UserType::kPublicAccount;
+ });
return users_to_show;
}
diff --git a/chrome/browser/ash/login/oobe_quick_start/connectivity/advertising_id.cc b/chrome/browser/ash/login/oobe_quick_start/connectivity/advertising_id.cc
index 92ad7e1..4b631f2 100644
--- a/chrome/browser/ash/login/oobe_quick_start/connectivity/advertising_id.cc
+++ b/chrome/browser/ash/login/oobe_quick_start/connectivity/advertising_id.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ash/login/oobe_quick_start/connectivity/advertising_id.h"
+#include <algorithm>
+
#include "base/base64url.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "chromeos/ash/components/quick_start/logging.h"
#include "crypto/random.h"
@@ -47,7 +48,7 @@
}
AdvertisingId::AdvertisingId(base::span<const uint8_t, kLength> bytes) {
- base::ranges::copy(bytes, bytes_.begin());
+ std::ranges::copy(bytes, bytes_.begin());
}
std::string AdvertisingId::ToString() const {
diff --git a/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc b/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc
index 096c870..6df61cb 100644
--- a/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc
+++ b/chrome/browser/ash/login/saml/saml_lockscreen_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <array>
#include <memory>
#include <optional>
@@ -15,7 +16,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/test/bind.h"
@@ -1239,7 +1239,7 @@
run_loop.Run();
EXPECT_GT(cookie_list_.size(), 0u);
- const auto saml_cookie_iterator = base::ranges::find(
+ const auto saml_cookie_iterator = std::ranges::find(
cookie_list_, cookie_name,
[](const net::CanonicalCookie& cookie) { return cookie.Name(); });
EXPECT_NE(saml_cookie_iterator, cookie_list_.end());
diff --git a/chrome/browser/ash/login/test/auth_ui_utils.cc b/chrome/browser/ash/login/test/auth_ui_utils.cc
index fc574124..a69c7a8 100644
--- a/chrome/browser/ash/login/test/auth_ui_utils.cc
+++ b/chrome/browser/ash/login/test/auth_ui_utils.cc
@@ -346,7 +346,7 @@
PinSetupPageActor::~PinSetupPageActor() = default;
void PinSetupPageActor::EnterPin(const std::string& pin) {
- EXPECT_TRUE(base::ranges::all_of(pin, ::isdigit));
+ EXPECT_TRUE(std::ranges::all_of(pin, ::isdigit));
test::OobeJS().TypeIntoPath(pin, kPinSetupKeyboardInput);
}
diff --git a/chrome/browser/ash/login/users/fake_chrome_user_manager.cc b/chrome/browser/ash/login/users/fake_chrome_user_manager.cc
index 2f638b3..dfdd30f 100644
--- a/chrome/browser/ash/login/users/fake_chrome_user_manager.cc
+++ b/chrome/browser/ash/login/users/fake_chrome_user_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
@@ -12,7 +13,6 @@
#include "ash/constants/ash_switches.h"
#include "base/command_line.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/system/sys_info.h"
#include "chrome/browser/ash/login/users/chrome_user_manager_util.h"
#include "chrome/browser/ash/login/users/default_user_image/default_user_images.h"
diff --git a/chrome/browser/ash/login/users/profile_user_manager_controller.cc b/chrome/browser/ash/login/users/profile_user_manager_controller.cc
index 0b2a274d..fc6032cc 100644
--- a/chrome/browser/ash/login/users/profile_user_manager_controller.cc
+++ b/chrome/browser/ash/login/users/profile_user_manager_controller.cc
@@ -32,7 +32,7 @@
// Hereafter, we can use AnnotatedAccountId::Get() to find the User.
if (ash::IsUserBrowserContext(profile)) {
auto logged_in_users = user_manager_->GetLoggedInUsers();
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
logged_in_users,
ash::BrowserContextHelper::GetUserIdHashFromBrowserContext(profile),
[](const user_manager::User* user) { return user->username_hash(); });
diff --git a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc
index f45fc12e..49486304 100644
--- a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc
+++ b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ash/net/network_diagnostics/http_firewall_routine.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/storage_partition.h"
@@ -156,7 +156,7 @@
if (probe_exit_enum == TlsProber::ProbeExitEnum::kDnsFailure) {
dns_resolution_failures_++;
} else {
- const auto* iter = base::ranges::find(kRetryResponseCodes, result);
+ const auto* iter = std::ranges::find(kRetryResponseCodes, result);
if (iter != std::end(kRetryResponseCodes) && num_retries_ > 0) {
num_retries_--;
AttemptProbe(url);
diff --git a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc
index a961708..131acb8 100644
--- a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc
+++ b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ash/net/network_diagnostics/https_firewall_routine.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/storage_partition.h"
@@ -136,7 +136,7 @@
if (probe_exit_enum == TlsProber::ProbeExitEnum::kDnsFailure) {
dns_resolution_failures_++;
} else {
- const auto* iter = base::ranges::find(kRetryResponseCodes, result);
+ const auto* iter = std::ranges::find(kRetryResponseCodes, result);
if (iter != std::end(kRetryResponseCodes) && num_retries_ > 0) {
num_retries_--;
AttemptProbe(url);
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc
index 137d318..ed4d7027 100644
--- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc
+++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h"
+#include <algorithm>
#include <string>
#include <vector>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -38,7 +38,7 @@
util::GetRandomHosts(num_hosts, prefix_length);
// Ensure |random_hosts| has unique entries.
std::sort(random_hosts.begin(), random_hosts.end());
- EXPECT_TRUE(base::ranges::adjacent_find(random_hosts) == random_hosts.end());
+ EXPECT_TRUE(std::ranges::adjacent_find(random_hosts) == random_hosts.end());
}
TEST(NetworkDiagnosticsUtilTest, TestGetRandomHostsWithScheme) {
@@ -48,7 +48,7 @@
util::GetRandomHostsWithScheme(num_hosts, prefix_length, kHttpsScheme);
// Ensure |random_hosts| has unique entries.
std::sort(random_hosts.begin(), random_hosts.end());
- EXPECT_TRUE(base::ranges::adjacent_find(random_hosts) == random_hosts.end());
+ EXPECT_TRUE(std::ranges::adjacent_find(random_hosts) == random_hosts.end());
// Ensure hosts in |random_hosts| start with |kHttpsScheme|.
for (const auto& host : random_hosts) {
EXPECT_TRUE(host.rfind(kHttpsScheme, 0) == 0);
@@ -64,7 +64,7 @@
kHttpsScheme);
// Ensure |random_hosts| has unique entries.
std::sort(random_hosts.begin(), random_hosts.end());
- EXPECT_TRUE(base::ranges::adjacent_find(random_hosts) == random_hosts.end());
+ EXPECT_TRUE(std::ranges::adjacent_find(random_hosts) == random_hosts.end());
// Ensure:
// (1) hosts in |random_hosts| start with |kHttpsScheme|.
// (2) hosts in |random_hosts| end with |kGenerate204Path|.
diff --git a/chrome/browser/ash/net/network_portal_detector_test_utils.cc b/chrome/browser/ash/net/network_portal_detector_test_utils.cc
index bdab1a56..cef447c6 100644
--- a/chrome/browser/ash/net/network_portal_detector_test_utils.cc
+++ b/chrome/browser/ash/net/network_portal_detector_test_utils.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include "base/logging.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
-#include "base/ranges/algorithm.h"
namespace ash {
@@ -30,7 +30,7 @@
bool EnumHistogramChecker::Check() {
bool empty = false;
- size_t num_zeroes = static_cast<size_t>(base::ranges::count(expect_, 0));
+ size_t num_zeroes = static_cast<size_t>(std::ranges::count(expect_, 0));
if (num_zeroes == expect_.size())
empty = true;
base::HistogramBase* histogram =
diff --git a/chrome/browser/ash/net/secure_dns_manager.cc b/chrome/browser/ash/net/secure_dns_manager.cc
index 8556e9d..9afb5cf1 100644
--- a/chrome/browser/ash/net/secure_dns_manager.cc
+++ b/chrome/browser/ash/net/secure_dns_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/net/secure_dns_manager.h"
+#include <algorithm>
#include <map>
#include <string>
#include <string_view>
@@ -13,7 +14,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -231,9 +231,8 @@
for (const net::DohProviderEntry* provider : local_providers) {
std::vector<std::string> ip_addrs;
- base::ranges::transform(provider->ip_addresses,
- std::back_inserter(ip_addrs),
- &net::IPAddress::ToString);
+ std::ranges::transform(provider->ip_addresses, std::back_inserter(ip_addrs),
+ &net::IPAddress::ToString);
local_doh_providers_[provider->doh_server_config] =
base::JoinString(ip_addrs, ",");
}
diff --git a/chrome/browser/ash/plugin_vm/plugin_vm_files.cc b/chrome/browser/ash/plugin_vm/plugin_vm_files.cc
index 68d5664..c7e68fc 100644
--- a/chrome/browser/ash/plugin_vm/plugin_vm_files.cc
+++ b/chrome/browser/ash/plugin_vm/plugin_vm_files.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/plugin_vm/plugin_vm_files.h"
+#include <algorithm>
#include <utility>
#include "ash/public/cpp/shelf_model.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/location.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
@@ -104,8 +104,8 @@
request.set_vm_name(registration->VmName());
request.set_container_name(registration->ContainerName());
request.set_desktop_file_id(registration->DesktopFileId());
- base::ranges::move(file_paths, google::protobuf::RepeatedFieldBackInserter(
- request.mutable_files()));
+ std::ranges::move(file_paths, google::protobuf::RepeatedFieldBackInserter(
+ request.mutable_files()));
ash::CiceroneClient::Get()->LaunchContainerApplication(
std::move(request),
diff --git a/chrome/browser/ash/policy/core/reporting_user_tracker.cc b/chrome/browser/ash/policy/core/reporting_user_tracker.cc
index 70a0658..8cc017dc 100644
--- a/chrome/browser/ash/policy/core/reporting_user_tracker.cc
+++ b/chrome/browser/ash/policy/core/reporting_user_tracker.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ash/policy/core/reporting_user_tracker.h"
+#include <algorithm>
#include <utility>
#include "base/check_is_test.h"
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
#include "components/account_id/account_id.h"
@@ -92,7 +92,7 @@
void ReportingUserTracker::RemoveReportingUser(const AccountId& account_id) {
ScopedListPrefUpdate users_update(local_state_, ::prefs::kReportingUsers);
base::Value::List& update_list = users_update.Get();
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
update_list, base::Value(FullyCanonicalize(account_id.GetUserEmail())));
if (it == update_list.end()) {
return;
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc
index a92b74c..9653530 100644
--- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc
+++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc
@@ -80,7 +80,7 @@
// Find the first valid delegate, since every delegate contains the same copy
// of custom messaging settings.
- auto delegate = base::ranges::find_if(
+ auto delegate = std::ranges::find_if(
file_transfer_analysis_delegates,
[](const std::unique_ptr<
enterprise_connectors::FileTransferAnalysisDelegate>& delegate) {
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller_ash.cc b/chrome/browser/ash/policy/dlp/dlp_files_controller_ash.cc
index 29f7549..c1d206d 100644
--- a/chrome/browser/ash/policy/dlp/dlp_files_controller_ash.cc
+++ b/chrome/browser/ash/policy/dlp/dlp_files_controller_ash.cc
@@ -29,7 +29,6 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
@@ -581,7 +580,7 @@
return;
}
std::vector<base::FilePath> warning_files_paths;
- base::ranges::for_each(warned_files, [&](auto& warned_file) {
+ std::ranges::for_each(warned_files, [&](auto& warned_file) {
warning_files_paths.push_back(warned_file.path);
});
fpnm->ShowDlpWarning(
@@ -609,13 +608,13 @@
for (const auto& [level, urls] : aggregated_destinations) {
DlpFileRestrictionDetails details;
details.level = level;
- base::ranges::move(urls.begin(), urls.end(),
- std::back_inserter(details.urls));
+ std::ranges::move(urls.begin(), urls.end(),
+ std::back_inserter(details.urls));
// Add the components for this level, if any.
const auto it = aggregated_components.find(level);
if (it != aggregated_components.end()) {
- base::ranges::move(it->second.begin(), it->second.end(),
- std::back_inserter(details.components));
+ std::ranges::move(it->second.begin(), it->second.end(),
+ std::back_inserter(details.components));
}
result.emplace_back(std::move(details));
}
@@ -629,8 +628,8 @@
}
DlpFileRestrictionDetails details;
details.level = level;
- base::ranges::move(components.begin(), components.end(),
- std::back_inserter(details.components));
+ std::ranges::move(components.begin(), components.end(),
+ std::back_inserter(details.components));
result.emplace_back(std::move(details));
}
@@ -647,8 +646,8 @@
std::vector<data_controls::Component> result;
const auto it = aggregated_components.find(DlpRulesManager::Level::kBlock);
if (it != aggregated_components.end()) {
- base::ranges::move(it->second.begin(), it->second.end(),
- std::back_inserter(result));
+ std::ranges::move(it->second.begin(), it->second.end(),
+ std::back_inserter(result));
}
return result;
}
@@ -838,7 +837,7 @@
std::erase_if(
selected_files,
[&restricted_files](const ui::SelectedFileInfo& selected_file) -> bool {
- return base::ranges::any_of(
+ return std::ranges::any_of(
restricted_files, [&](const base::FilePath& restricted_file) {
return selected_file.file_path == restricted_file ||
selected_file.file_path.IsParent(restricted_file);
diff --git a/chrome/browser/ash/policy/external_data/cloud_external_data_manager_base.cc b/chrome/browser/ash/policy/external_data/cloud_external_data_manager_base.cc
index d68951e..341e7a9 100644
--- a/chrome/browser/ash/policy/external_data/cloud_external_data_manager_base.cc
+++ b/chrome/browser/ash/policy/external_data/cloud_external_data_manager_base.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <map>
#include <memory>
#include <string>
@@ -21,7 +22,6 @@
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
@@ -377,10 +377,10 @@
// Extract the list of (key, hash) pairs from the Metadata map to tell the
// store which data should be kept.
CloudExternalDataStore::PruningData key_hash_pairs;
- base::ranges::transform(metadata_, std::back_inserter(key_hash_pairs),
- [](const std::pair<MetadataKey, MetadataEntry>& p) {
- return make_pair(p.first.ToString(), p.second.hash);
- });
+ std::ranges::transform(metadata_, std::back_inserter(key_hash_pairs),
+ [](const std::pair<MetadataKey, MetadataEntry>& p) {
+ return make_pair(p.first.ToString(), p.second.hash);
+ });
external_data_store_->Prune(key_hash_pairs);
}
diff --git a/chrome/browser/ash/policy/networking/euicc_status_uploader_unittest.cc b/chrome/browser/ash/policy/networking/euicc_status_uploader_unittest.cc
index 7cbf8e48..7eb4770 100644
--- a/chrome/browser/ash/policy/networking/euicc_status_uploader_unittest.cc
+++ b/chrome/browser/ash/policy/networking/euicc_status_uploader_unittest.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ash/policy/networking/euicc_status_uploader.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "ash/constants/ash_pref_names.h"
#include "base/json/json_string_value_serializer.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/values_test_util.h"
@@ -75,8 +76,8 @@
return std::tie(profile.iccid(), profile.smdp_address());
};
return lhs.euicc_count() == rhs.euicc_count() &&
- base::ranges::equal(lhs.esim_profiles(), rhs.esim_profiles(),
- std::equal_to<>(), proj, proj) &&
+ std::ranges::equal(lhs.esim_profiles(), rhs.esim_profiles(),
+ std::equal_to<>(), proj, proj) &&
lhs.clear_profile_list() == rhs.clear_profile_list();
}
diff --git a/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc b/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc
index e818248..c5aedc6 100644
--- a/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc
+++ b/chrome/browser/ash/policy/networking/network_policy_application_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <map>
#include <memory>
#include <optional>
@@ -21,7 +22,6 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
@@ -362,8 +362,8 @@
const std::vector<network_mojom::NetworkStatePropertiesPtr>&
network_states) {
std::set<std::string> guids;
- base::ranges::transform(network_states, std::inserter(guids, guids.begin()),
- &network_mojom::NetworkStateProperties::guid);
+ std::ranges::transform(network_states, std::inserter(guids, guids.begin()),
+ &network_mojom::NetworkStateProperties::guid);
return guids;
}
diff --git a/chrome/browser/ash/policy/remote_commands/device_command_fetch_support_packet_job.cc b/chrome/browser/ash/policy/remote_commands/device_command_fetch_support_packet_job.cc
index 70edc77..64f7155 100644
--- a/chrome/browser/ash/policy/remote_commands/device_command_fetch_support_packet_job.cc
+++ b/chrome/browser/ash/policy/remote_commands/device_command_fetch_support_packet_job.cc
@@ -398,8 +398,8 @@
std::set<SupportToolError> errors) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const auto export_error =
- base::ranges::find(errors, SupportToolErrorCode::kDataExportError,
- &SupportToolError::error_code);
+ std::ranges::find(errors, SupportToolErrorCode::kDataExportError,
+ &SupportToolError::error_code);
if (export_error != errors.end()) {
base::UmaHistogramEnumeration(kFetchSupportPacketFailureHistogramName,
diff --git a/chrome/browser/ash/policy/reporting/event_based_logs/event_based_log_uploader.cc b/chrome/browser/ash/policy/reporting/event_based_logs/event_based_log_uploader.cc
index 6ab4945..f5fe469 100644
--- a/chrome/browser/ash/policy/reporting/event_based_logs/event_based_log_uploader.cc
+++ b/chrome/browser/ash/policy/reporting/event_based_logs/event_based_log_uploader.cc
@@ -165,8 +165,8 @@
std::set<SupportToolError> errors) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const auto export_error =
- base::ranges::find(errors, SupportToolErrorCode::kDataExportError,
- &SupportToolError::error_code);
+ std::ranges::find(errors, SupportToolErrorCode::kDataExportError,
+ &SupportToolError::error_code);
if (export_error != errors.end()) {
LOG(ERROR) << "The device couldn't export the collected data "
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_telemetry_sampler.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_telemetry_sampler.cc
index ce8a4768..a288051 100644
--- a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_telemetry_sampler.cc
+++ b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_telemetry_sampler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/policy/reporting/metrics_reporting/network/network_telemetry_sampler.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/containers/queue.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/ash/policy/reporting/metrics_reporting/network/wifi_signal_strength_rssi_fetcher.h"
@@ -60,7 +60,7 @@
const auto& interface_info_list =
cros_healthd_telemetry->network_interface_result
->get_network_interface_info();
- const auto& interface_info_it = base::ranges::find_if(
+ const auto& interface_info_it = std::ranges::find_if(
interface_info_list,
[&interface_name](const NetworkInterfaceInfoPtr& interface_info) {
return !interface_info.is_null() &&
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
index 17cab429..85facd6 100644
--- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
+++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -12,6 +12,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <functional>
#include <iterator>
#include <memory>
@@ -33,8 +34,6 @@
#include "base/memory/raw_ref.h"
#include "base/notreached.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -4150,11 +4149,11 @@
iface->device_path() == dev.device_path &&
iface->mdn() == dev.mdn && iface->iccid() == dev.iccid &&
(iface->type() != em::NetworkInterface::TYPE_CELLULAR ||
- base::ranges::equal(iface->eids().begin(), iface->eids().end(),
- kFakeSimSlots,
- kFakeSimSlots + std::size(kFakeSimSlots),
- base::ranges::equal_to(), std::identity(),
- &FakeSimSlotInfo::eid))) {
+ std::ranges::equal(iface->eids().begin(), iface->eids().end(),
+ kFakeSimSlots,
+ kFakeSimSlots + std::size(kFakeSimSlots),
+ std::ranges::equal_to(), std::identity(),
+ &FakeSimSlotInfo::eid))) {
found_match = true;
break;
}
diff --git a/chrome/browser/ash/preferences/preferences_unittest.cc b/chrome/browser/ash/preferences/preferences_unittest.cc
index 573bfb1..8e420ba 100644
--- a/chrome/browser/ash/preferences/preferences_unittest.cc
+++ b/chrome/browser/ash/preferences/preferences_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/preferences/preferences.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/json/json_string_value_serializer.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ash/input_method/input_method_configuration.h"
diff --git a/chrome/browser/ash/printing/enterprise/enterprise_printers_provider.cc b/chrome/browser/ash/printing/enterprise/enterprise_printers_provider.cc
index 871b5af3..d24337f 100644
--- a/chrome/browser/ash/printing/enterprise/enterprise_printers_provider.cc
+++ b/chrome/browser/ash/printing/enterprise/enterprise_printers_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/printing/enterprise/enterprise_printers_provider.h"
+#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/printing/enterprise/bulk_printers_calculator.h"
#include "chrome/browser/ash/printing/enterprise/bulk_printers_calculator_factory.h"
#include "chrome/browser/ash/printing/enterprise/calculators_policies_binder.h"
@@ -222,8 +222,8 @@
// Update `printers_` with the recalculated result.
printers_.clear();
printers_.reserve(all_printers.size());
- base::ranges::transform(all_printers, std::back_inserter(printers_),
- [](const auto& p) { return p.second; });
+ std::ranges::transform(all_printers, std::back_inserter(printers_),
+ [](const auto& p) { return p.second; });
for (auto& observer : observers_) {
observer.OnPrintersChanged(complete_, printers_);
diff --git a/chrome/browser/ash/printing/enterprise/enterprise_printers_provider_unittest.cc b/chrome/browser/ash/printing/enterprise/enterprise_printers_provider_unittest.cc
index 74e0336..0d1ee78 100644
--- a/chrome/browser/ash/printing/enterprise/enterprise_printers_provider_unittest.cc
+++ b/chrome/browser/ash/printing/enterprise/enterprise_printers_provider_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/printing/enterprise/enterprise_printers_provider.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -11,7 +12,6 @@
#include "base/containers/to_vector.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/values.h"
diff --git a/chrome/browser/ash/printing/oauth2/authorization_zone_impl.cc b/chrome/browser/ash/printing/oauth2/authorization_zone_impl.cc
index fa0326e..a9dac58 100644
--- a/chrome/browser/ash/printing/oauth2/authorization_zone_impl.cc
+++ b/chrome/browser/ash/printing/oauth2/authorization_zone_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/printing/oauth2/authorization_zone_impl.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <type_traits>
@@ -16,7 +17,6 @@
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/types/expected.h"
@@ -371,7 +371,7 @@
StatusCode status,
std::string data) {
// Find the session for which the request was completed.
- auto it_session = base::ranges::find(
+ auto it_session = std::ranges::find(
sessions_, session, &std::unique_ptr<AuthorizationServerSession>::get);
DCHECK(it_session != sessions_.end());
@@ -523,7 +523,7 @@
const std::string& state,
base::flat_set<std::string>& scopes,
std::string& code_verifier) {
- std::list<PendingAuthorization>::iterator it = base::ranges::find(
+ std::list<PendingAuthorization>::iterator it = std::ranges::find(
pending_authorizations_, state, &PendingAuthorization::state);
if (it == pending_authorizations_.end()) {
return false;
diff --git a/chrome/browser/ash/printing/printer_info_cups.cc b/chrome/browser/ash/printing/printer_info_cups.cc
index 5b60e26..02ad474 100644
--- a/chrome/browser/ash/printing/printer_info_cups.cc
+++ b/chrome/browser/ash/printing/printer_info_cups.cc
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ash/printing/printer_info.h"
-
+#include <algorithm>
#include <array>
#include <string>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/version.h"
+#include "chrome/browser/ash/printing/printer_info.h"
#include "chromeos/printing/cups_printer_status.h"
#include "printing/backend/cups_jobs.h"
#include "printing/printer_status.h"
@@ -33,7 +32,7 @@
// Returns true if any of the |ipp_versions| are greater than or equal to 2.0.
bool AllowedIpp(const std::vector<base::Version>& ipp_versions) {
- return base::ranges::any_of(ipp_versions, [](const base::Version& version) {
+ return std::ranges::any_of(ipp_versions, [](const base::Version& version) {
return version.IsValid() && version.components()[0] >= 2;
});
}
@@ -46,7 +45,7 @@
// Returns true if |formats| contains one of the supported printer description
// languages for an autoconf printer identified by MIME type.
bool SupportsRequiredPDLS(const std::vector<std::string>& formats) {
- return base::ranges::any_of(formats, &SupportedMime);
+ return std::ranges::any_of(formats, &SupportedMime);
}
// Returns true if |info| describes a printer for which we want to attempt
diff --git a/chrome/browser/ash/printing/zeroconf_printer_detector.cc b/chrome/browser/ash/printing/zeroconf_printer_detector.cc
index 230e7db..f7287c4 100644
--- a/chrome/browser/ash/printing/zeroconf_printer_detector.cc
+++ b/chrome/browser/ash/printing/zeroconf_printer_detector.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ash/printing/zeroconf_printer_detector.h"
+#include <algorithm>
#include <string>
#include <string_view>
#include <utility>
@@ -17,7 +18,6 @@
#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/hash/md5.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -263,7 +263,7 @@
// Prune any empty splits.
std::erase_if(media_types, [](std::string_view s) { return s.empty(); });
- base::ranges::transform(
+ std::ranges::transform(
media_types,
std::back_inserter(
detected_printer->ppd_search_data.supported_document_formats),
diff --git a/chrome/browser/ash/profiles/profile_helper.cc b/chrome/browser/ash/profiles/profile_helper.cc
index dc76b4b..c2d7adc 100644
--- a/chrome/browser/ash/profiles/profile_helper.cc
+++ b/chrome/browser/ash/profiles/profile_helper.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/profiles/profile_helper.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <string>
@@ -16,7 +17,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
diff --git a/chrome/browser/ash/remote_apps/remote_apps_impl.cc b/chrome/browser/ash/remote_apps/remote_apps_impl.cc
index 8820879..3c2d195 100644
--- a/chrome/browser/ash/remote_apps/remote_apps_impl.cc
+++ b/chrome/browser/ash/remote_apps/remote_apps_impl.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/remote_apps/remote_apps_impl.h"
+#include <algorithm>
#include <optional>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/remote_apps/remote_apps_manager.h"
#include "chrome/browser/ash/remote_apps/remote_apps_manager_factory.h"
#include "chrome/browser/ash/remote_apps/remote_apps_types.h"
@@ -213,8 +213,8 @@
}
void RemoteAppsImpl::DisconnectHandler(mojo::RemoteSetElementId id) {
- const auto& it = base::ranges::find(source_id_to_remote_id_map_, id,
- &SourceToRemoteIds::value_type::second);
+ const auto& it = std::ranges::find(source_id_to_remote_id_map_, id,
+ &SourceToRemoteIds::value_type::second);
if (it == source_id_to_remote_id_map_.end())
return;
diff --git a/chrome/browser/ash/system_web_apps/apps/help_app/help_app_integration_browsertest.cc b/chrome/browser/ash/system_web_apps/apps/help_app/help_app_integration_browsertest.cc
index 125e5e1..a9e0f77 100644
--- a/chrome/browser/ash/system_web_apps/apps/help_app/help_app_integration_browsertest.cc
+++ b/chrome/browser/ash/system_web_apps/apps/help_app/help_app_integration_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <optional>
#include <string>
#include <vector>
@@ -19,7 +20,6 @@
#include "ash/webui/web_applications/test/sandboxed_web_ui_test_base.h"
#include "base/command_line.h"
#include "base/containers/to_vector.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
@@ -1177,7 +1177,7 @@
auto& tasks = GetManager().GetBackgroundTasksForTesting();
// Find the help app's background task.
- const auto& help_task = base::ranges::find(
+ const auto& help_task = std::ranges::find(
tasks, bg_task_url, &SystemWebAppBackgroundTask::url_for_testing);
ASSERT_NE(help_task, tasks.end());
diff --git a/chrome/browser/ash/system_web_apps/apps/media_app/media_app_integration_browsertest.cc b/chrome/browser/ash/system_web_apps/apps/media_app/media_app_integration_browsertest.cc
index 0d5bb05d..52d0130 100644
--- a/chrome/browser/ash/system_web_apps/apps/media_app/media_app_integration_browsertest.cc
+++ b/chrome/browser/ash/system_web_apps/apps/media_app/media_app_integration_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
@@ -19,7 +20,6 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
@@ -606,7 +606,7 @@
GetAppsForMimeType(proxy, "application/octet-stream");
// Media App should not be in the returned list of handlers.
- EXPECT_FALSE(base::ranges::any_of(
+ EXPECT_FALSE(std::ranges::any_of(
intent_launch_info,
[&media_app_id](const apps::IntentLaunchInfo& info) {
return info.app_id == media_app_id;
@@ -624,7 +624,7 @@
// Media App should be in the returned list of handlers.
EXPECT_FALSE(intent_launch_info.empty()) << " at " << accept.mime_type;
- EXPECT_TRUE(base::ranges::any_of(
+ EXPECT_TRUE(std::ranges::any_of(
intent_launch_info,
[&media_app_id](const apps::IntentLaunchInfo& info) {
return info.app_id == media_app_id;
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.cc
index abf719a..52a9d69 100644
--- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.cc
+++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -34,7 +35,6 @@
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/ash/system_web_apps/apps/personalization_app/ambient_video_albums.h"
#include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_manager.h"
@@ -687,8 +687,8 @@
AmbientBackendController::Get()->GetTimeOfDayVideoPreviewImageUrls(
video.value());
std::vector<GURL> previews;
- base::ranges::transform(url_arr, std::back_inserter(previews),
- [](const char* url) { return GURL(url); });
+ std::ranges::transform(url_arr, std::back_inserter(previews),
+ [](const char* url) { return GURL(url); });
OnPreviewsFetched(std::move(previews));
return;
}
@@ -709,8 +709,8 @@
ash::PersonalAlbum*
PersonalizationAppAmbientProviderImpl::FindPersonalAlbumById(
const std::string& album_id) {
- auto it = base::ranges::find(personal_albums_.albums, album_id,
- &ash::PersonalAlbum::album_id);
+ auto it = std::ranges::find(personal_albums_.albums, album_id,
+ &ash::PersonalAlbum::album_id);
if (it == personal_albums_.albums.end()) {
return nullptr;
@@ -721,8 +721,8 @@
ash::ArtSetting* PersonalizationAppAmbientProviderImpl::FindArtAlbumById(
const std::string& album_id) {
- auto it = base::ranges::find(settings_->art_settings, album_id,
- &ash::ArtSetting::album_id);
+ auto it = std::ranges::find(settings_->art_settings, album_id,
+ &ash::ArtSetting::album_id);
// Album does not exist any more.
if (it == settings_->art_settings.end()) {
return nullptr;
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl_unittest.cc
index c50ea84..69da706c 100644
--- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl_unittest.cc
+++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_ambient_provider_impl.h"
+#include <algorithm>
#include <memory>
#include <string_view>
#include <vector>
@@ -26,7 +27,6 @@
#include "ash/webui/personalization_app/mojom/personalization_app.mojom.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/test_future.h"
@@ -972,7 +972,7 @@
// The fake data has art setting '0' as enabled.
std::vector<ash::ArtSetting> art_settings = ArtSettings();
- auto it = base::ranges::find_if(art_settings, &ash::ArtSetting::enabled);
+ auto it = std::ranges::find_if(art_settings, &ash::ArtSetting::enabled);
EXPECT_NE(it, art_settings.end());
EXPECT_EQ(it->album_id, "0");
@@ -984,7 +984,7 @@
SetAlbumSelected(album->id, album->topic_source, album->checked);
art_settings = ArtSettings();
- EXPECT_TRUE(base::ranges::none_of(art_settings, &ash::ArtSetting::enabled));
+ EXPECT_TRUE(std::ranges::none_of(art_settings, &ash::ArtSetting::enabled));
album = ash::personalization_app::mojom::AmbientModeAlbum::New();
album->id = '1';
@@ -993,7 +993,7 @@
SetAlbumSelected(album->id, album->topic_source, album->checked);
art_settings = ArtSettings();
- it = base::ranges::find_if(art_settings, &ash::ArtSetting::enabled);
+ it = std::ranges::find_if(art_settings, &ash::ArtSetting::enabled);
EXPECT_NE(it, art_settings.end());
EXPECT_EQ(it->album_id, "1");
}
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_time_of_day_browsertest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_time_of_day_browsertest.cc
index cd00317..bb29f2c 100644
--- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_time_of_day_browsertest.cc
+++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_time_of_day_browsertest.cc
@@ -26,7 +26,6 @@
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/time_formatting.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/task/sequenced_task_runner.h"
@@ -238,8 +237,8 @@
std::vector<base::Time> GenerateTimesToTest() {
const auto& timestamps = GetParam().timestamps_to_test;
std::vector<base::Time> times;
- base::ranges::transform(timestamps, std::back_inserter(times),
- TimeFromString);
+ std::ranges::transform(timestamps, std::back_inserter(times),
+ TimeFromString);
return times;
}
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.cc
index 0938052..6be87b08 100644
--- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.cc
+++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.cc
@@ -860,11 +860,11 @@
std::optional<std::vector<backdrop::Image>> result;
if (success && !images.empty()) {
// Do first pass to clear all unit_id associated with the images.
- base::ranges::for_each(images, [&](auto& proto_image) {
+ std::ranges::for_each(images, [&](auto& proto_image) {
image_unit_id_map_.erase(proto_image.unit_id());
});
// Do second pass to repopulate the map with fresh data.
- base::ranges::for_each(images, [&](auto& proto_image) {
+ std::ranges::for_each(images, [&](auto& proto_image) {
if (proto_image.has_asset_id() && proto_image.has_unit_id() &&
proto_image.has_image_url()) {
image_unit_id_map_[proto_image.unit_id()].push_back(
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc
index c97a680..bd2816b 100644
--- a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc
+++ b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ash/system_web_apps/system_web_app_manager.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <optional>
@@ -32,7 +33,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/one_shot_event.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
@@ -208,7 +208,7 @@
delegate.ShouldHandleFileOpenIntents();
const auto& search_terms = delegate.GetAdditionalSearchTerms();
- base::ranges::transform(
+ std::ranges::transform(
search_terms, std::back_inserter(install_options.additional_search_terms),
&l10n_util::GetStringUTF8);
return install_options;
@@ -657,7 +657,7 @@
// the install success rate.
std::map<GURL, web_app::ExternallyManagedAppManager::InstallResult>
results_to_report;
- base::ranges::copy_if(
+ std::ranges::copy_if(
install_results,
std::inserter(results_to_report, results_to_report.end()),
[](const auto& url_and_result) {
diff --git a/chrome/browser/ash/system_web_apps/test_support/system_web_app_browsertest_base.cc b/chrome/browser/ash/system_web_apps/test_support/system_web_app_browsertest_base.cc
index fbf6d0e..e78e58e 100644
--- a/chrome/browser/ash/system_web_apps/test_support/system_web_app_browsertest_base.cc
+++ b/chrome/browser/ash/system_web_apps/test_support/system_web_app_browsertest_base.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ash/system_web_apps/test_support/system_web_app_browsertest_base.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -146,7 +147,7 @@
size_t SystemWebAppBrowserTestBase::GetSystemWebAppBrowserCount(
SystemWebAppType type) {
auto* browser_list = BrowserList::GetInstance();
- return base::ranges::count_if(*browser_list, [&](Browser* browser) {
+ return std::ranges::count_if(*browser_list, [&](Browser* browser) {
return ash::IsBrowserForSystemWebApp(browser, type);
});
}
diff --git a/chrome/browser/ash/wallpaper/wallpaper_enumerator.cc b/chrome/browser/ash/wallpaper/wallpaper_enumerator.cc
index 34378c51..635660b3 100644
--- a/chrome/browser/ash/wallpaper/wallpaper_enumerator.cc
+++ b/chrome/browser/ash/wallpaper/wallpaper_enumerator.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ash/wallpaper/wallpaper_enumerator.h"
+#include <algorithm>
#include <string>
#include <vector>
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/file_manager/path_util.h"
@@ -36,7 +36,7 @@
for (base::FilePath image_path = image_enumerator.Next();
!image_path.empty() && out->size() < kMaximumImageCount;
image_path = image_enumerator.Next()) {
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
trash_paths, [&image_path](const base::FilePath& trash_path) {
// Equivalent to
// image_path.value().starts_with(trash_path.value()).
diff --git a/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc b/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc
index d22d4b31..2f79c3f1 100644
--- a/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc
+++ b/chrome/browser/autofill/autofill_captured_sites_interactive_uitest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <map>
#include <optional>
#include <sstream>
@@ -16,7 +17,6 @@
#include "base/metrics/histogram_base.h"
#include "base/metrics/statistics_recorder.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -200,7 +200,7 @@
histogram_names.push_back(name);
}
}
- base::ranges::sort(histogram_names);
+ std::ranges::sort(histogram_names);
// Output the samples of all `histogram_names` to `output_file`.
std::stringstream output;
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc
index 016eb78b..41bc45b 100644
--- a/chrome/browser/autofill/autofill_interactive_uitest.cc
+++ b/chrome/browser/autofill/autofill_interactive_uitest.cc
@@ -787,7 +787,7 @@
content::DOMMessageQueue msg_queue(GetWebContents());
for (char16_t character : value) {
ui::DomKey dom_key = ui::DomKey::FromCharacter(character);
- const ui::PrintableCodeEntry* code_entry = base::ranges::find_if(
+ const ui::PrintableCodeEntry* code_entry = std::ranges::find_if(
ui::kPrintableCodeMap,
[character](const ui::PrintableCodeEntry& entry) {
return entry.character[0] == character ||
diff --git a/chrome/browser/autofill_ai/autofill_ai_browsertest.cc b/chrome/browser/autofill_ai/autofill_ai_browsertest.cc
index cadd00d8..43bc141 100644
--- a/chrome/browser/autofill_ai/autofill_ai_browsertest.cc
+++ b/chrome/browser/autofill_ai/autofill_ai_browsertest.cc
@@ -254,7 +254,7 @@
for (int i = 0; i < request.form_data().fields().size(); ++i) {
const optimization_guide::proto::FormFieldData& field =
request.form_data().fields(i);
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
request.entries(), field.field_label(),
&optimization_guide::proto::UserAnnotationsEntry::key);
if (it == request.entries().end()) {
diff --git a/chrome/browser/background/background_mode_manager_unittest.cc b/chrome/browser/background/background_mode_manager_unittest.cc
index 7d2afac..d8e7b2f 100644
--- a/chrome/browser/background/background_mode_manager_unittest.cc
+++ b/chrome/browser/background/background_mode_manager_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_simple_task_runner.h"
@@ -149,16 +149,16 @@
// TestBackgroundModeManager:
bool HasPersistentBackgroundClient() const override {
- return base::ranges::any_of(
+ return std::ranges::any_of(
profile_app_counts_, [](const auto& profile_count_pair) {
return profile_count_pair.second.persistent > 0;
});
}
bool HasAnyBackgroundClient() const override {
- return base::ranges::any_of(profile_app_counts_,
- [](const auto& profile_count_pair) {
- return profile_count_pair.second.any > 0;
- });
+ return std::ranges::any_of(profile_app_counts_,
+ [](const auto& profile_count_pair) {
+ return profile_count_pair.second.any > 0;
+ });
}
bool HasPersistentBackgroundClientForProfile(
const Profile* profile) const override {
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index d48ae1c..a7e2b50c 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -320,7 +320,7 @@
// Get the latest time of a given type, across a list of folders.
std::string GetLatestTime(const std::vector<base::Value::Dict*>& folders,
std::string_view time_type_key) {
- CHECK(base::ranges::any_of(
+ CHECK(std::ranges::any_of(
folders, [](const base::Value::Dict* folder) { return folder; }));
int64_t latest_time = 0;
diff --git a/chrome/browser/bookmarks/managed_bookmark_service_unittest.cc b/chrome/browser/bookmarks/managed_bookmark_service_unittest.cc
index 2f31a572e..7027080 100644
--- a/chrome/browser/bookmarks/managed_bookmark_service_unittest.cc
+++ b/chrome/browser/bookmarks/managed_bookmark_service_unittest.cc
@@ -4,11 +4,11 @@
#include "components/bookmarks/managed/managed_bookmark_service.h"
+#include <algorithm>
#include <memory>
#include <utility>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
@@ -153,7 +153,7 @@
if (node->is_folder()) {
const base::Value::List* children = dict.FindList("children");
return children &&
- base::ranges::equal(
+ std::ranges::equal(
*children, node->children(),
[](const base::Value& child, const auto& child_node) {
return child.is_dict() &&
diff --git a/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc b/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
index f4dd157..4c961e9e 100644
--- a/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
+++ b/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
@@ -11,13 +11,12 @@
#include <stdlib.h>
+#include <algorithm>
#include <string_view>
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/process/launch.h"
-#include "base/ranges/algorithm.h"
-
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
@@ -123,7 +122,7 @@
#if BUILDFLAG(IS_MAC)
bool ContainsUrlVarName(const std::vector<std::string>& tokens) {
- return base::ranges::any_of(tokens, [](const std::string& token) {
+ return std::ranges::any_of(tokens, [](const std::string& token) {
return token.find(kUrlVarName) != std::string::npos;
});
}
diff --git a/chrome/browser/browser_switcher/browser_switcher_service.cc b/chrome/browser/browser_switcher/browser_switcher_service.cc
index ba0ee13..9ad8e24 100644
--- a/chrome/browser/browser_switcher/browser_switcher_service.cc
+++ b/chrome/browser/browser_switcher/browser_switcher_service.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/browser_switcher/browser_switcher_service.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/syslog_logging.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/browser_switcher/alternative_browser_driver.h"
@@ -121,7 +121,7 @@
XmlDownloader::~XmlDownloader() = default;
bool XmlDownloader::HasValidSources() const {
- return base::ranges::any_of(sources_, [](const RulesetSource& source) {
+ return std::ranges::any_of(sources_, [](const RulesetSource& source) {
return source.url.is_valid();
});
}
@@ -356,7 +356,7 @@
// Record |BrowserSwitcher.AlternativeBrowser| when the
// |BrowserSwitcherEnabled| or |AlternativeBrowserPath| policies change.
bool should_record_metrics =
- base::ranges::any_of(changed_prefs, [](const std::string& pref) {
+ std::ranges::any_of(changed_prefs, [](const std::string& pref) {
return pref == prefs::kEnabled ||
pref == prefs::kAlternativeBrowserPath;
});
@@ -369,14 +369,14 @@
// Re-download if one of the URLs or the ParsingMode changed. O(n^2), but n<=3
// so it's fast.
- auto it = base::ranges::find(changed_prefs, prefs::kParsingMode);
+ auto it = std::ranges::find(changed_prefs, prefs::kParsingMode);
bool parsing_mode_changed = it != changed_prefs.end();
bool should_redownload =
parsing_mode_changed ||
- base::ranges::any_of(
+ std::ranges::any_of(
sources,
[&changed_prefs](const std::string& pref_name) {
- auto it = base::ranges::find(changed_prefs, pref_name);
+ auto it = std::ranges::find(changed_prefs, pref_name);
return it != changed_prefs.end();
},
&RulesetSource::pref_name);
diff --git a/chrome/browser/browser_switcher/browser_switcher_sitelist.cc b/chrome/browser/browser_switcher/browser_switcher_sitelist.cc
index d650606..a37a44c 100644
--- a/chrome/browser/browser_switcher/browser_switcher_sitelist.cc
+++ b/chrome/browser/browser_switcher/browser_switcher_sitelist.cc
@@ -6,6 +6,7 @@
#include <string.h>
+#include <algorithm>
#include <optional>
#include <sstream>
#include <string>
@@ -15,7 +16,6 @@
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/values.h"
@@ -497,7 +497,7 @@
void BrowserSwitcherSitelistImpl::OnPrefsChanged(
BrowserSwitcherPrefs* prefs,
const std::vector<std::string>& changed_prefs) {
- auto it = base::ranges::find(changed_prefs, prefs::kParsingMode);
+ auto it = std::ranges::find(changed_prefs, prefs::kParsingMode);
if (it != changed_prefs.end()) {
// ParsingMode changed, re-canonicalize rules.
StoreRules(ieem_sitelist_, original_ieem_sitelist_);
diff --git a/chrome/browser/browsing_data/browsing_data_remover_browsertest_base.cc b/chrome/browser/browsing_data/browsing_data_remover_browsertest_base.cc
index 108b2c71f..ad1e54f 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_browsertest_base.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover_browsertest_base.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/browsing_data/browsing_data_remover_browsertest_base.h"
+#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
index f135a8c..4195ab0 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <set>
#include <string>
#include <utility>
@@ -24,7 +25,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/thread_pool.h"
@@ -1474,7 +1474,7 @@
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
type_to_clear, [&](const ContentSettingPatternSource& setting) {
return setting.metadata.decided_by_related_website_sets() &&
- base::ranges::any_of(
+ std::ranges::any_of(
filter_builder->GetOrigins(),
[&](const url::Origin& origin) -> bool {
return setting.primary_pattern.Matches(
diff --git a/chrome/browser/browsing_data/counters/downloads_counter.cc b/chrome/browser/browsing_data/counters/downloads_counter.cc
index ca58be4..48107008 100644
--- a/chrome/browser/browsing_data/counters/downloads_counter.cc
+++ b/chrome/browser/browsing_data/counters/downloads_counter.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/browsing_data/counters/downloads_counter.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/download/download_history.h"
#include "chrome/browser/profiles/profile.h"
#include "components/browsing_data/core/pref_names.h"
@@ -26,7 +27,7 @@
download_manager->GetAllDownloads(&downloads);
base::Time begin_time = GetPeriodStart();
- ReportResult(base::ranges::count_if(
+ ReportResult(std::ranges::count_if(
downloads, [begin_time](const download::DownloadItem* item) {
return item->GetStartTime() >= begin_time &&
DownloadHistory::IsPersisted(item);
diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc
index c0972d9..655b6bc9 100644
--- a/chrome/browser/captive_portal/captive_portal_browsertest.cc
+++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <atomic>
#include <iterator>
#include <map>
@@ -19,7 +20,6 @@
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/sequence_checker.h"
#include "base/strings/stringprintf.h"
@@ -179,8 +179,8 @@
// Returns the total number of loading tabs across all Browsers, for all
// Profiles.
int NumLoadingTabs() {
- return base::ranges::count_if(AllTabContentses(),
- &content::WebContents::IsLoading);
+ return std::ranges::count_if(AllTabContentses(),
+ &content::WebContents::IsLoading);
}
bool IsLoginTab(WebContents* web_contents) {
@@ -358,7 +358,7 @@
FailLoadsAfterLoginObserver::FailLoadsAfterLoginObserver()
: waiting_for_navigation_(false) {
- base::ranges::copy_if(
+ std::ranges::copy_if(
AllTabContentses(),
std::inserter(tabs_needing_navigation_, tabs_needing_navigation_.end()),
&content::WebContents::IsLoading);
@@ -1191,10 +1191,10 @@
int CaptivePortalBrowserTest::NumTabsWithState(
captive_portal::CaptivePortalTabReloader::State state) const {
- return base::ranges::count(AllTabContentses(), state,
- [this](content::WebContents* web_contents) {
- return GetStateOfTabReloader(web_contents);
- });
+ return std::ranges::count(AllTabContentses(), state,
+ [this](content::WebContents* web_contents) {
+ return GetStateOfTabReloader(web_contents);
+ });
}
int CaptivePortalBrowserTest::NumBrokenTabs() const {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bada252..b86a836 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chrome_content_browser_client.h"
+#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
@@ -33,7 +34,6 @@
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
diff --git a/chrome/browser/chrome_origin_trials_browsertest.cc b/chrome/browser/chrome_origin_trials_browsertest.cc
index 8d85945..33f7cc6 100644
--- a/chrome/browser/chrome_origin_trials_browsertest.cc
+++ b/chrome/browser/chrome_origin_trials_browsertest.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <bitset>
#include <string_view>
#include <vector>
#include "base/base64.h"
#include "base/command_line.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -204,7 +204,7 @@
DisabledTokensInPolicy) {
// Convert the uint8_t[] from generate_token.py into strings.
std::vector<std::string> expected_signatures;
- base::ranges::transform(
+ std::ranges::transform(
GetParam().expected_list, std::back_inserter(expected_signatures),
[](const uint8_t bytes[]) {
return std::string(reinterpret_cast<const char*>(bytes),
diff --git a/chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc b/chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc
index 5fe0d95..f9bc750 100644
--- a/chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc
+++ b/chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/chromeos/arc/arc_external_protocol_dialog.h"
+#include <algorithm>
#include <map>
#include "base/functional/bind.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/apps/link_capturing/link_capturing_navigation_throttle.h"
@@ -381,7 +381,7 @@
}
const auto it =
- base::ranges::find(devices, device_guid, &SharingTargetDeviceInfo::guid);
+ std::ranges::find(devices, device_guid, &SharingTargetDeviceInfo::guid);
CHECK(it != devices.end(), base::NotFatalUntil::M130);
const SharingTargetDeviceInfo& device = *it;
diff --git a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc
index 2bc4fe05..1b39666 100644
--- a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc
+++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.h"
+
+#include <algorithm>
#include <iterator>
#include <string_view>
#include <utility>
#include "base/check.h"
-#include "base/ranges/algorithm.h"
-#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_utils.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -28,16 +29,16 @@
std::vector<url::Origin> new_origins;
new_origins.reserve(additions.size());
- base::ranges::transform(additions, std::back_inserter(new_origins),
- [](std::string_view str) {
- auto ret = url::Origin::Create(GURL(str));
- // The provided literal string be the same as the
- // parsed origin. It shouldn't contain extra parts
- // (e.g. URL path and query) that aren't part of the
- // origin.
- CHECK_EQ(ret.GetURL().spec(), str);
- return ret;
- });
+ std::ranges::transform(additions, std::back_inserter(new_origins),
+ [](std::string_view str) {
+ auto ret = url::Origin::Create(GURL(str));
+ // The provided literal string be the same as the
+ // parsed origin. It shouldn't contain extra parts
+ // (e.g. URL path and query) that aren't part of the
+ // origin.
+ CHECK_EQ(ret.GetURL().spec(), str);
+ return ret;
+ });
AddAllowlistedOrigins(std::move(new_origins));
return *this;
@@ -55,8 +56,8 @@
std::vector<url::Origin> merged_origins;
merged_origins.reserve(allowed_origins_.size() + additions.size());
- base::ranges::copy(allowed_origins_, std::back_inserter(merged_origins));
- base::ranges::copy(additions, std::back_inserter(merged_origins));
+ std::ranges::copy(allowed_origins_, std::back_inserter(merged_origins));
+ std::ranges::copy(additions, std::back_inserter(merged_origins));
allowed_origins_ = std::move(merged_origins);
return *this;
diff --git a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_mutable_registry.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_mutable_registry.cc
index c250373..318c31c3 100644
--- a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_mutable_registry.cc
+++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_mutable_registry.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_mutable_registry.h"
+#include <algorithm>
#include <memory>
#include "base/check_is_test.h"
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_infos.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_utils.h"
@@ -47,7 +47,7 @@
bool CrosAppsApiMutableRegistry::CanEnableApi(
const CrosAppsApiInfo& api_info) const {
- const bool are_required_features_enabled = base::ranges::all_of(
+ const bool are_required_features_enabled = std::ranges::all_of(
api_info.required_features(), [](const auto& base_feature) {
return base::FeatureList::IsEnabled(base_feature);
});
@@ -81,7 +81,7 @@
return false;
}
- const bool is_allowlisted_origin = base::ranges::any_of(
+ const bool is_allowlisted_origin = std::ranges::any_of(
api_info.allowed_origins(),
[&url](const auto& origin) { return origin.IsSameOriginWith(url); });
diff --git a/chrome/browser/chromeos/gemini_app/gemini_app_tab_helper_unittest.cc b/chrome/browser/chromeos/gemini_app/gemini_app_tab_helper_unittest.cc
index c9af526..7d9bd96 100644
--- a/chrome/browser/chromeos/gemini_app/gemini_app_tab_helper_unittest.cc
+++ b/chrome/browser/chromeos/gemini_app/gemini_app_tab_helper_unittest.cc
@@ -141,7 +141,7 @@
// (b) the profile is not off the record.
bool record = IsGeminiAppPreinstallEnabled() && !IsProfileOffTheRecord();
for (const auto& [url, page] : page_urls) {
- auto histogram_buckets_it = base::ranges::find(
+ auto histogram_buckets_it = std::ranges::find(
histogram_buckets, static_cast<base::HistogramBase::Sample32>(page),
&Bucket::min);
{
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc
index ad74afb2..18e0929 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc
+++ b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h"
+#include <algorithm>
#include <memory>
#include <vector>
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
@@ -140,7 +140,7 @@
const DlpConfidentialContents& other) {
contents_.insert(other.contents_.begin(), other.contents_.end());
for (auto other_content : other.contents_) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
contents_, [&other_content](const DlpConfidentialContent& content) {
return content == other_content &&
content.title != other_content.title;
@@ -188,7 +188,7 @@
content::WebContents* web_contents,
DlpRulesManager::Restriction restriction) const {
const GURL url = web_contents->GetLastCommittedURL();
- return base::ranges::any_of(
+ return std::ranges::any_of(
entries_, [&](const std::unique_ptr<Entry>& entry) {
return entry->restriction == restriction &&
entry->content.url.EqualsIgnoringRef(url);
@@ -198,7 +198,7 @@
bool DlpConfidentialContentsCache::Contains(
const DlpConfidentialContent& content,
DlpRulesManager::Restriction restriction) const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
entries_, [&](const std::unique_ptr<Entry>& entry) {
return entry->restriction == restriction &&
entry->content.url.EqualsIgnoringRef(content.url);
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h
index bfe6c03..e39d132 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h
+++ b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h
@@ -5,12 +5,12 @@
#ifndef CHROME_BROWSER_CHROMEOS_POLICY_DLP_DLP_CONFIDENTIAL_CONTENTS_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_DLP_DLP_CONFIDENTIAL_CONTENTS_H_
+#include <algorithm>
#include <list>
#include <string>
#include <vector>
#include "base/containers/flat_set.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
@@ -83,7 +83,7 @@
// in titles, even if the set of the confidential contents hasn't changed.
friend bool EqualWithTitles(const DlpConfidentialContents& a,
const DlpConfidentialContents& b) {
- return base::ranges::equal(
+ return std::ranges::equal(
a.contents_, b.contents_,
[](const DlpConfidentialContent& x, const DlpConfidentialContent& y) {
return x == y && x.title == y.title;
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents_unittest.cc b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents_unittest.cc
index 7e0c15f..e29c566 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents_unittest.cc
+++ b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h"
+#include <algorithm>
#include <sstream>
#include <string>
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/test_mock_time_task_runner.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h"
@@ -63,11 +63,11 @@
// |web_contents|.
bool Contains(const DlpConfidentialContents& contents,
content::WebContents* web_contents) {
- return base::ranges::any_of(contents.GetContents(),
- [&](const DlpConfidentialContent& content) {
- return content.url.EqualsIgnoringRef(
- web_contents->GetLastCommittedURL());
- });
+ return std::ranges::any_of(contents.GetContents(),
+ [&](const DlpConfidentialContent& content) {
+ return content.url.EqualsIgnoringRef(
+ web_contents->GetLastCommittedURL());
+ });
}
protected:
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc b/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc
index fa89a72..50a3bfd 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc
+++ b/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/policy/dlp/dlp_content_manager.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -16,7 +17,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/policy/dlp/dialogs/dlp_warn_notifier.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h"
@@ -710,7 +710,7 @@
base::RepeatingClosure stop_callback,
content::MediaStreamUI::StateChangeCallback state_change_callback,
content::MediaStreamUI::SourceCallback source_callback) {
- auto screen_share_it = base::ranges::find_if(
+ auto screen_share_it = std::ranges::find_if(
running_screen_shares_,
[&label, media_id](const std::unique_ptr<ScreenShareInfo>& info) {
return info && info->label() == label &&
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.cc b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.cc
index 9ebae83..cecbbd2 100644
--- a/chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.cc
+++ b/chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.cc
@@ -52,7 +52,7 @@
return nullptr;
auto profiles = profile_manager->GetLoadedProfiles();
const auto profile_it =
- base::ranges::find_if(profiles, &Profile::IsMainProfile);
+ std::ranges::find_if(profiles, &Profile::IsMainProfile);
if (profile_it == profiles.end())
return nullptr;
return *profile_it;
diff --git a/chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_unittest.cc b/chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_unittest.cc
index 85d5148..f8dfc72 100644
--- a/chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_unittest.cc
+++ b/chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager.h"
+#include <algorithm>
#include <optional>
#include "base/containers/to_vector.h"
@@ -11,7 +12,6 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_macros_local.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_factory.h"
#include "chrome/browser/persisted_state_db/session_proto_db_factory.h"
diff --git a/chrome/browser/component_updater/cros_component_installer_chromeos.cc b/chrome/browser/component_updater/cros_component_installer_chromeos.cc
index ce423fe..a639f17 100644
--- a/chrome/browser/component_updater/cros_component_installer_chromeos.cc
+++ b/chrome/browser/component_updater/cros_component_installer_chromeos.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/component_updater/cros_component_installer_chromeos.h"
+#include <algorithm>
#include <map>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/functional/callback.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/to_string.h"
#include "base/task/thread_pool.h"
@@ -61,7 +61,7 @@
const ComponentConfig* FindConfig(const std::string& name) {
const ComponentConfig* config =
- base::ranges::find(kConfigs, name, &ComponentConfig::name);
+ std::ranges::find(kConfigs, name, &ComponentConfig::name);
if (config == std::end(kConfigs)) {
return nullptr;
}
diff --git a/chrome/browser/component_updater/metadata_table_chromeos.cc b/chrome/browser/component_updater/metadata_table_chromeos.cc
index bde8522..6135151b 100644
--- a/chrome/browser/component_updater/metadata_table_chromeos.cc
+++ b/chrome/browser/component_updater/metadata_table_chromeos.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/component_updater/metadata_table_chromeos.h"
+#include <algorithm>
#include <memory>
#include <string_view>
#include <utility>
@@ -11,7 +12,6 @@
#include "base/hash/sha1.h"
#include "base/memory/ptr_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "components/component_updater/component_updater_paths.h"
@@ -128,7 +128,7 @@
bool MetadataTable::HasComponentForAnyUser(
const std::string& component_name) const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
installed_items_, [&component_name](const base::Value& item) {
const std::string& name =
GetRequiredStringFromDict(item, kMetadataContentItemComponentKey);
diff --git a/chrome/browser/component_updater/pki_metadata_component_installer.cc b/chrome/browser/component_updater/pki_metadata_component_installer.cc
index b1602d9..b56e186 100644
--- a/chrome/browser/component_updater/pki_metadata_component_installer.cc
+++ b/chrome/browser/component_updater/pki_metadata_component_installer.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/component_updater/pki_metadata_component_installer.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -22,7 +23,6 @@
#include "base/memory/ref_counted.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
@@ -458,7 +458,7 @@
google::protobuf::RepeatedPtrField<std::string> proto_bytes) {
std::vector<std::vector<uint8_t>> bytes;
bytes.reserve(proto_bytes.size());
- base::ranges::transform(
+ std::ranges::transform(
proto_bytes, std::back_inserter(bytes), [](std::string element) {
const auto bytes = base::as_byte_span(element);
return std::vector<uint8_t>(bytes.begin(), bytes.end());
diff --git a/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc b/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc
index 9d6433c..0b0622e 100644
--- a/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc
+++ b/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/component_updater/third_party_module_list_component_installer_win.h"
+#include <algorithm>
#include <iterator>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/win/conflicts/module_blocklist_cache_util.h"
@@ -35,7 +35,7 @@
DCHECK(component_update_service);
auto components = component_update_service->GetComponents();
- auto iter = base::ranges::find(components, kComponentId, &ComponentInfo::id);
+ auto iter = std::ranges::find(components, kComponentId, &ComponentInfo::id);
CHECK(iter != components.end(), base::NotFatalUntil::M130);
return iter->version;
diff --git a/chrome/browser/component_updater/translate_kit_language_pack_component_installer.cc b/chrome/browser/component_updater/translate_kit_language_pack_component_installer.cc
index a9589a2..4cfe277 100644
--- a/chrome/browser/component_updater/translate_kit_language_pack_component_installer.cc
+++ b/chrome/browser/component_updater/translate_kit_language_pack_component_installer.cc
@@ -14,7 +14,6 @@
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/on_device_translation/constants.h"
@@ -48,7 +47,7 @@
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const {
// Check that the sub-directories of the package install directory exist.
- return base::ranges::all_of(
+ return std::ranges::all_of(
GetPackageInstallSubDirNamesForVerification(language_pack_key_),
[&install_dir](const std::string& sub_dir_name) {
return base::PathExists(install_dir.AppendASCII(sub_dir_name));
diff --git a/chrome/browser/component_updater/zxcvbn_data_component_installer.cc b/chrome/browser/component_updater/zxcvbn_data_component_installer.cc
index 905b39dc..c366e4c 100644
--- a/chrome/browser/component_updater/zxcvbn_data_component_installer.cc
+++ b/chrome/browser/component_updater/zxcvbn_data_component_installer.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/component_updater/zxcvbn_data_component_installer.h"
+#include <algorithm>
#include <array>
#include <bit>
#include <cstdint>
@@ -23,7 +24,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
@@ -100,7 +100,7 @@
return false;
}
- if (base::ranges::any_of(kFileNames, [&install_dir](const auto& file_name) {
+ if (std::ranges::any_of(kFileNames, [&install_dir](const auto& file_name) {
return !base::PathExists(install_dir.Append(file_name));
})) {
return false;
diff --git a/chrome/browser/content_settings/generated_cookie_prefs_unittest.cc b/chrome/browser/content_settings/generated_cookie_prefs_unittest.cc
index 73dc56d..cb30a51 100644
--- a/chrome/browser/content_settings/generated_cookie_prefs_unittest.cc
+++ b/chrome/browser/content_settings/generated_cookie_prefs_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/content_settings/generated_cookie_prefs.h"
+#include <algorithm>
#include <memory>
#include <tuple>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/extensions/api/settings_private/generated_pref.h"
#include "chrome/browser/extensions/api/settings_private/generated_pref_test_base.h"
diff --git a/chrome/browser/content_settings/one_time_permission_provider.cc b/chrome/browser/content_settings/one_time_permission_provider.cc
index 7e72c46..c1147b1 100644
--- a/chrome/browser/content_settings/one_time_permission_provider.cc
+++ b/chrome/browser/content_settings/one_time_permission_provider.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/content_settings/one_time_permission_provider.h"
+#include <algorithm>
#include <memory>
#include <set>
#include "base/power_monitor/power_monitor.h"
-#include "base/ranges/algorithm.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/device_notifications/device_status_icon_unittest.cc b/chrome/browser/device_notifications/device_status_icon_unittest.cc
index a5ae208..4f53e09 100644
--- a/chrome/browser/device_notifications/device_status_icon_unittest.cc
+++ b/chrome/browser/device_notifications/device_status_icon_unittest.cc
@@ -117,7 +117,7 @@
// pointer. This is necessary because the menu items are created by
// iterating through a structure of flat_map<Profile*, bool>.
auto sorted_profile_connection_counts = profile_connection_counts;
- base::ranges::sort(sorted_profile_connection_counts);
+ std::ranges::sort(sorted_profile_connection_counts);
size_t total_connection_count = 0;
size_t total_origin_count = 0;
auto* menu_item = status_icon->menu_item();
@@ -131,7 +131,7 @@
// Sort the |origin_items| by origin. This is necessary because the origin
// items for each profile in the menu are created by iterating through a
// structure of flat_map<url::Origin, ...>.
- base::ranges::sort(sorted_origin_items);
+ std::ranges::sort(sorted_origin_items);
auto* connection_tracker = GetDeviceConnectionTracker(profile,
/*create=*/false);
ASSERT_TRUE(connection_tracker);
@@ -212,7 +212,7 @@
// count.
profile_connection_counts.push_back(
{profile, {{extension->origin(), 1, extension->name()}}});
- base::ranges::sort(profile_connection_counts);
+ std::ranges::sort(profile_connection_counts);
profile_connection_counts.back().second.clear();
// The total connection count in the title still captures all of the origins
override_title_total_connection_count_ = 20;
@@ -251,7 +251,7 @@
// Sort the |profiles| by the address of the profile pointer. This is
// necessary because the menu items are created by iterating through a
// structure of flat_map<Profile*, bool>.
- base::ranges::sort(profiles);
+ std::ranges::sort(profiles);
// The below is status icon items layout, profile1 name is on [3] and profile2
// name is on [7].
diff --git a/chrome/browser/devtools/device/devtools_android_bridge.cc b/chrome/browser/devtools/device/devtools_android_bridge.cc
index 7d9534b..6dd14a47 100644
--- a/chrome/browser/devtools/device/devtools_android_bridge.cc
+++ b/chrome/browser/devtools/device/devtools_android_bridge.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <map>
#include <memory>
#include <set>
@@ -21,7 +22,6 @@
#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -198,7 +198,7 @@
void DevToolsAndroidBridge::RemoveDeviceListListener(
DeviceListListener* listener) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- auto it = base::ranges::find(device_list_listeners_, listener);
+ auto it = std::ranges::find(device_list_listeners_, listener);
CHECK(it != device_list_listeners_.end(), base::NotFatalUntil::M130);
device_list_listeners_.erase(it);
if (!NeedsDeviceListPolling())
@@ -215,7 +215,7 @@
void DevToolsAndroidBridge::RemoveDeviceCountListener(
DeviceCountListener* listener) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- auto it = base::ranges::find(device_count_listeners_, listener);
+ auto it = std::ranges::find(device_count_listeners_, listener);
CHECK(it != device_count_listeners_.end(), base::NotFatalUntil::M130);
device_count_listeners_.erase(it);
if (device_count_listeners_.empty())
@@ -232,7 +232,7 @@
void DevToolsAndroidBridge::RemovePortForwardingListener(
PortForwardingListener* listener) {
- auto it = base::ranges::find(port_forwarding_listeners_, listener);
+ auto it = std::ranges::find(port_forwarding_listeners_, listener);
CHECK(it != port_forwarding_listeners_.end(), base::NotFatalUntil::M130);
port_forwarding_listeners_.erase(it);
if (!NeedsDeviceListPolling())
diff --git a/chrome/browser/devtools/device/devtools_android_bridge_browsertest.cc b/chrome/browser/devtools/device/devtools_android_bridge_browsertest.cc
index c308ff9..7027af8 100644
--- a/chrome/browser/devtools/device/devtools_android_bridge_browsertest.cc
+++ b/chrome/browser/devtools/device/devtools_android_bridge_browsertest.cc
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/devtools/device/devtools_android_bridge.h"
+
+#include <algorithm>
#include <array>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
-#include "chrome/browser/devtools/device/devtools_android_bridge.h"
#include "chrome/browser/devtools/device/tcp_device_provider.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -30,7 +31,7 @@
static std::string SetToString(const std::set<std::string>& values) {
std::ostringstream result;
- base::ranges::copy(values, std::ostream_iterator<std::string>(result, ", "));
+ std::ranges::copy(values, std::ostream_iterator<std::string>(result, ", "));
std::string result_string = result.str();
return result_string.substr(0, result_string.length() - 2);
}
diff --git a/chrome/browser/devtools/device/usb/android_usb_device.cc b/chrome/browser/devtools/device/usb/android_usb_device.cc
index 59ca1e5..4b75e73 100644
--- a/chrome/browser/devtools/device/usb/android_usb_device.cc
+++ b/chrome/browser/devtools/device/usb/android_usb_device.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/devtools/device/usb/android_usb_device.h"
+#include <algorithm>
#include <set>
#include <utility>
#include <vector>
@@ -19,7 +20,6 @@
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
@@ -489,7 +489,7 @@
DCHECK(task_runner_->BelongsToCurrentThread());
// Remove this AndroidUsbDevice from |g_devices|.
- auto it = base::ranges::find(g_devices.Get(), this);
+ auto it = std::ranges::find(g_devices.Get(), this);
if (it != g_devices.Get().end())
g_devices.Get().erase(it);
diff --git a/chrome/browser/devtools/devtools_file_system_indexer.cc b/chrome/browser/devtools/devtools_file_system_indexer.cc
index cbba8c5..8e82362 100644
--- a/chrome/browser/devtools/devtools_file_system_indexer.cc
+++ b/chrome/browser/devtools/devtools_file_system_indexer.cc
@@ -11,6 +11,7 @@
#include <stddef.h>
+#include <algorithm>
#include <iterator>
#include <memory>
#include <set>
@@ -22,7 +23,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/lazy_instance.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
@@ -221,8 +221,8 @@
for (; it != trigrams.end(); ++it) {
Trigram trigram = *it;
if (first) {
- base::ranges::copy(index_[trigram],
- std::inserter(file_ids, file_ids.begin()));
+ std::ranges::copy(index_[trigram],
+ std::inserter(file_ids, file_ids.begin()));
first = false;
continue;
}
diff --git a/chrome/browser/devtools/devtools_file_watcher.cc b/chrome/browser/devtools/devtools_file_watcher.cc
index d4c93f8..f629e4c 100644
--- a/chrome/browser/devtools/devtools_file_watcher.cc
+++ b/chrome/browser/devtools/devtools_file_watcher.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/devtools/devtools_file_watcher.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <set>
@@ -16,7 +17,6 @@
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/task/lazy_thread_pool_task_runner.h"
#include "base/task/sequenced_task_runner.h"
@@ -114,7 +114,7 @@
void DevToolsFileWatcher::SharedFileWatcher::RemoveListener(
DevToolsFileWatcher* watcher) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- auto it = base::ranges::find(listeners_, watcher);
+ auto it = std::ranges::find(listeners_, watcher);
listeners_.erase(it);
if (listeners_.empty()) {
file_path_times_.clear();
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index bb07a7a..1fbf00e 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <string_view>
#include <utility>
@@ -24,7 +25,6 @@
#include "base/metrics/user_metrics.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -347,7 +347,7 @@
return base::IsAsciiAlpha(ch) || base::IsAsciiDigit(ch) || ch == ';' ||
ch == '_';
};
- return base::ranges::all_of(value, is_legal) ? value : std::string();
+ return std::ranges::all_of(value, is_legal) ? value : std::string();
}
std::string SanitizeFrontendQueryParam(const std::string& key,
@@ -769,7 +769,7 @@
// Remove self from global list.
DevToolsUIBindingsList& instances =
DevToolsUIBindings::GetDevToolsUIBindings();
- auto it = base::ranges::find(instances, this);
+ auto it = std::ranges::find(instances, this);
CHECK(it != instances.end(), base::NotFatalUntil::M130);
instances.erase(it);
}
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc
index c6ed030..4f2fdafe 100644
--- a/chrome/browser/devtools/devtools_window.cc
+++ b/chrome/browser/devtools/devtools_window.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/devtools/devtools_window.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <string_view>
@@ -19,7 +20,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
@@ -487,7 +487,7 @@
owned_toolbox_web_contents_.reset();
DevToolsWindows* instances = g_devtools_window_instances.Pointer();
- auto it = base::ranges::find(*instances, this);
+ auto it = std::ranges::find(*instances, this);
CHECK(it != instances->end(), base::NotFatalUntil::M130);
instances->erase(it);
diff --git a/chrome/browser/devtools/devtools_window_testing.cc b/chrome/browser/devtools/devtools_window_testing.cc
index 49cf098f..d2fa937 100644
--- a/chrome/browser/devtools/devtools_window_testing.cc
+++ b/chrome/browser/devtools/devtools_window_testing.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/devtools/devtools_window_testing.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/lazy_instance.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
@@ -40,7 +41,7 @@
DevToolsWindowTesting::~DevToolsWindowTesting() {
DevToolsWindowTestings* instances =
g_devtools_window_testing_instances.Pointer();
- auto it = base::ranges::find(*instances, this);
+ auto it = std::ranges::find(*instances, this);
CHECK(it != instances->end());
instances->erase(it);
if (!close_callback_.is_null())
diff --git a/chrome/browser/devtools/protocol/cast_handler.cc b/chrome/browser/devtools/protocol/cast_handler.cc
index 831dfb8f..d7c6c98 100644
--- a/chrome/browser/devtools/protocol/cast_handler.cc
+++ b/chrome/browser/devtools/protocol/cast_handler.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/devtools/protocol/cast_handler.h"
+#include <algorithm>
#include <utility>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/ui/media_router/media_router_ui_helper.h"
#include "components/media_router/browser/media_router.h"
@@ -236,7 +236,7 @@
media_router::MediaSink::Id CastHandler::GetSinkIdByName(
const std::string& sink_name) const {
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
sinks_, sink_name, [](const media_router::MediaSinkWithCastModes& sink) {
return sink.sink.name();
});
@@ -246,7 +246,7 @@
MediaRoute::Id CastHandler::GetRouteIdForSink(
const media_router::MediaSink::Id& sink_id) const {
const auto& routes = routes_observer_->routes();
- auto it = base::ranges::find(routes, sink_id, &MediaRoute::media_sink_id);
+ auto it = std::ranges::find(routes, sink_id, &MediaRoute::media_sink_id);
return it == routes.end() ? MediaRoute::Id() : it->media_route_id();
}
@@ -277,9 +277,9 @@
auto protocol_sinks = std::make_unique<protocol::Array<Sink>>();
for (const media_router::MediaSinkWithCastModes& sink_with_modes : sinks_) {
- auto route_it = base::ranges::find(routes_observer_->routes(),
- sink_with_modes.sink.id(),
- &MediaRoute::media_sink_id);
+ auto route_it =
+ std::ranges::find(routes_observer_->routes(), sink_with_modes.sink.id(),
+ &MediaRoute::media_sink_id);
std::string session = route_it == routes_observer_->routes().end()
? std::string()
: route_it->description();
diff --git a/chrome/browser/downgrade/downgrade_manager.cc b/chrome/browser/downgrade/downgrade_manager.cc
index 8efbeb02..f66c7ae 100644
--- a/chrome/browser/downgrade/downgrade_manager.cc
+++ b/chrome/browser/downgrade/downgrade_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/downgrade/downgrade_manager.h"
+#include <algorithm>
#include <iterator>
#include <optional>
#include <string_view>
@@ -18,7 +19,6 @@
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/syslog_logging.h"
@@ -69,7 +69,7 @@
// Don't try to move the dir into which everything is being moved.
if (name.FinalExtension() == kDowngradeDeleteSuffix)
return true;
- return base::ranges::any_of(kFilesToKeep, [&name](const auto& keep) {
+ return std::ranges::any_of(kFilesToKeep, [&name](const auto& keep) {
return base::EqualsCaseInsensitiveASCII(name.value(), keep);
});
});
diff --git a/chrome/browser/download/android/dangerous_download_dialog_bridge.cc b/chrome/browser/download/android/dangerous_download_dialog_bridge.cc
index cf6b10d..100df18c 100644
--- a/chrome/browser/download/android/dangerous_download_dialog_bridge.cc
+++ b/chrome/browser/download/android/dangerous_download_dialog_bridge.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/download/android/dangerous_download_dialog_bridge.h"
+#include <algorithm>
#include <string>
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/android/android_theme_resources.h"
#include "chrome/browser/android/resource_mapper.h"
@@ -64,7 +64,7 @@
void DangerousDownloadDialogBridge::OnDownloadDestroyed(
download::DownloadItem* download_item) {
- auto iter = base::ranges::find(download_items_, download_item);
+ auto iter = std::ranges::find(download_items_, download_item);
if (iter != download_items_.end()) {
(*iter)->RemoveObserver(this);
download_items_.erase(iter);
diff --git a/chrome/browser/download/android/download_dialog_utils.cc b/chrome/browser/download/android/download_dialog_utils.cc
index 7af2361..1f38759 100644
--- a/chrome/browser/download/android/download_dialog_utils.cc
+++ b/chrome/browser/download/android/download_dialog_utils.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/download/android/download_dialog_utils.h"
+#include <algorithm>
#include <string>
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "components/url_formatter/url_formatter.h"
#include "ui/gfx/text_elider.h"
@@ -18,8 +18,8 @@
download::DownloadItem* DownloadDialogUtils::FindAndRemoveDownload(
std::vector<raw_ptr<download::DownloadItem, VectorExperimental>>* downloads,
const std::string& download_guid) {
- auto iter = base::ranges::find(*downloads, download_guid,
- &download::DownloadItem::GetGuid);
+ auto iter = std::ranges::find(*downloads, download_guid,
+ &download::DownloadItem::GetGuid);
if (iter == downloads->end())
return nullptr;
diff --git a/chrome/browser/download/android/download_manager_service.cc b/chrome/browser/download/android/download_manager_service.cc
index c7a77238..0085b32 100644
--- a/chrome/browser/download/android/download_manager_service.cc
+++ b/chrome/browser/download/android/download_manager_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/download/android/download_manager_service.h"
+#include <algorithm>
#include <memory>
#include <optional>
@@ -14,7 +15,6 @@
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/field_trial_params.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/default_clock.h"
@@ -571,8 +571,8 @@
is_pending_downloads_loaded_ = true;
auto result =
- base::ranges::find_if_not(coordinators_, &ProfileKey::IsOffTheRecord,
- &Coordinators::value_type::first);
+ std::ranges::find_if_not(coordinators_, &ProfileKey::IsOffTheRecord,
+ &Coordinators::value_type::first);
CHECK(result != coordinators_.end())
<< "A non-OffTheRecord coordinator should exist when "
"OnPendingDownloadsLoaded is triggered.";
diff --git a/chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.cc b/chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.cc
index 9a9f2f5..ed983e6 100644
--- a/chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.cc
+++ b/chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.h"
+#include <algorithm>
#include <string>
#include "base/android/path_utils.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/memory/singleton.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/android/android_theme_resources.h"
#include "chrome/browser/download/android/download_dialog_utils.h"
@@ -94,7 +94,7 @@
void DuplicateDownloadDialogBridgeDelegate::OnDownloadDestroyed(
download::DownloadItem* download_item) {
- auto iter = base::ranges::find(download_items_, download_item);
+ auto iter = std::ranges::find(download_items_, download_item);
if (iter != download_items_.end())
download_items_.erase(iter);
}
diff --git a/chrome/browser/download/android/open_download_dialog_bridge_delegate.cc b/chrome/browser/download/android/open_download_dialog_bridge_delegate.cc
index 56940042a..81712d3 100644
--- a/chrome/browser/download/android/open_download_dialog_bridge_delegate.cc
+++ b/chrome/browser/download/android/open_download_dialog_bridge_delegate.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/download/android/open_download_dialog_bridge_delegate.h"
+#include <algorithm>
#include <string>
#include "base/android/path_utils.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/android/android_theme_resources.h"
#include "chrome/browser/download/android/download_dialog_utils.h"
@@ -65,7 +65,7 @@
void OpenDownloadDialogBridgeDelegate::OnDownloadDestroyed(
download::DownloadItem* download_item) {
- auto iter = base::ranges::find(download_items_, download_item);
+ auto iter = std::ranges::find(download_items_, download_item);
if (iter != download_items_.end()) {
download_items_.erase(iter);
}
diff --git a/chrome/browser/download/download_status_updater.cc b/chrome/browser/download/download_status_updater.cc
index ff68835..067ce9b6 100644
--- a/chrome/browser/download/download_status_updater.cc
+++ b/chrome/browser/download/download_status_updater.cc
@@ -160,8 +160,8 @@
// Do we still need to hold a keepalive?
content::DownloadManager::DownloadVector items;
manager->GetAllDownloads(&items);
- auto items_it = base::ranges::find(items, download::DownloadItem::IN_PROGRESS,
- &download::DownloadItem::GetState);
+ auto items_it = std::ranges::find(items, download::DownloadItem::IN_PROGRESS,
+ &download::DownloadItem::GetState);
bool should_keep_alive = (items_it != items.end());
if (should_keep_alive == already_has_keep_alive) {
diff --git a/chrome/browser/download/download_warning_desktop_hats_utils.cc b/chrome/browser/download/download_warning_desktop_hats_utils.cc
index 81de150..768d0fd5 100644
--- a/chrome/browser/download/download_warning_desktop_hats_utils.cc
+++ b/chrome/browser/download/download_warning_desktop_hats_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/download/download_warning_desktop_hats_utils.h"
+#include <algorithm>
#include <cstdint>
#include <iterator>
#include <string>
@@ -12,7 +13,6 @@
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -142,7 +142,7 @@
std::vector<std::string> event_strings;
event_strings.reserve(events.size() + 1);
event_strings.push_back(std::move(first_event_string));
- base::ranges::transform(
+ std::ranges::transform(
events.begin(), events.end(), std::back_inserter(event_strings),
[](const DownloadItemWarningData::WarningActionEvent& event) {
return event.ToString();
diff --git a/chrome/browser/download/notification/multi_profile_download_notifier.cc b/chrome/browser/download/notification/multi_profile_download_notifier.cc
index 8f7a4aa..80858c4 100644
--- a/chrome/browser/download/notification/multi_profile_download_notifier.cc
+++ b/chrome/browser/download/notification/multi_profile_download_notifier.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/download/notification/multi_profile_download_notifier.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/profiles/profile_selections.h"
#include "components/download/public/common/simple_download_manager.h"
@@ -99,8 +100,8 @@
content::DownloadManager* manager) {
client_->OnManagerGoingDown(manager);
- auto it = base::ranges::find(download_notifiers_, manager,
- &download::AllDownloadItemNotifier::GetManager);
+ auto it = std::ranges::find(download_notifiers_, manager,
+ &download::AllDownloadItemNotifier::GetManager);
CHECK(it != download_notifiers_.end(), base::NotFatalUntil::M130);
download_notifiers_.erase(it);
}
diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc
index 08b8394..272ebe3 100644
--- a/chrome/browser/engagement/important_sites_util.cc
+++ b/chrome/browser/engagement/important_sites_util.cc
@@ -14,7 +14,6 @@
#include "base/containers/contains.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
@@ -279,7 +278,7 @@
// Process the bookmarks and optionally trim them if we have too many.
std::vector<UrlAndTitle> result_bookmarks;
if (untrimmed_bookmarks.size() > kMaxBookmarks) {
- base::ranges::copy_if(
+ std::ranges::copy_if(
untrimmed_bookmarks, std::back_inserter(result_bookmarks),
[&engagement_map](const UrlAndTitle& entry) {
auto it = engagement_map.find(entry.url.DeprecatedGetOriginAsURL());
diff --git a/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc b/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc
index 71df0137..5ab382f 100644
--- a/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc
+++ b/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/enterprise/connectors/analysis/files_request_handler.h"
+#include <algorithm>
+
#include "base/check_op.h"
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
@@ -11,7 +13,6 @@
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
@@ -168,7 +169,7 @@
base::FilePath path,
safe_browsing::BinaryUploadService::Result result,
enterprise_connectors::ContentAnalysisResponse response) {
- auto it = base::ranges::find(paths_, path);
+ auto it = std::ranges::find(paths_, path);
CHECK(it != paths_.end(), base::NotFatalUntil::M130);
size_t index = std::distance(paths_.begin(), it);
FileRequestCallback(index, result, response);
diff --git a/chrome/browser/enterprise/connectors/analysis/local_binary_upload_service.cc b/chrome/browser/enterprise/connectors/analysis/local_binary_upload_service.cc
index 1a7bf05..45ed0814 100644
--- a/chrome/browser/enterprise/connectors/analysis/local_binary_upload_service.cc
+++ b/chrome/browser/enterprise/connectors/analysis/local_binary_upload_service.cc
@@ -10,7 +10,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/syslog_logging.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
@@ -659,7 +658,7 @@
DVLOG(1) << __func__ << ": id=" << id << " not active";
}
- auto it2 = base::ranges::find(
+ auto it2 = std::ranges::find(
pending_requests_, id,
[](const RequestInfo& info) { return info.request->id(); });
if (it2 != pending_requests_.end()) {
diff --git a/chrome/browser/enterprise/connectors/common.cc b/chrome/browser/enterprise/connectors/common.cc
index 8a3f4e4f..2db34e5 100644
--- a/chrome/browser/enterprise/connectors/common.cc
+++ b/chrome/browser/enterprise/connectors/common.cc
@@ -452,7 +452,7 @@
return nullptr;
}
auto profiles = g_browser_process->profile_manager()->GetLoadedProfiles();
- const auto main_it = base::ranges::find_if(profiles, &Profile::IsMainProfile);
+ const auto main_it = std::ranges::find_if(profiles, &Profile::IsMainProfile);
if (main_it == profiles.end()) {
return nullptr;
}
diff --git a/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client.cc b/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client.cc
index 0d5f1f3..b3f839cc 100644
--- a/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client.cc
+++ b/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client.h"
+#include <algorithm>
#include <memory>
#include <utility>
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client_impl.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/shared_command_constants.h"
@@ -27,7 +27,7 @@
bool CheckEqual(base::span<const uint8_t> wrapped_label,
const std::string& label) {
auto label_span = base::as_byte_span(label);
- return base::ranges::equal(wrapped_label, label_span);
+ return std::ranges::equal(wrapped_label, label_span);
}
} // namespace
diff --git a/chrome/browser/enterprise/idle/action.cc b/chrome/browser/enterprise/idle/action.cc
index 2a1991e..36be82a 100644
--- a/chrome/browser/enterprise/idle/action.cc
+++ b/chrome/browser/enterprise/idle/action.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/enterprise/idle/action.h"
+#include <algorithm>
#include <cstring>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h"
@@ -45,7 +45,7 @@
bool ProfileHasBrowsers(const Profile* profile) {
DCHECK(profile);
profile = profile->GetOriginalProfile();
- return base::ranges::any_of(
+ return std::ranges::any_of(
*BrowserList::GetInstance(), [profile](Browser* browser) {
return browser->profile()->GetOriginalProfile() == profile;
});
@@ -424,7 +424,7 @@
}
#if !BUILDFLAG(IS_ANDROID)
- bool needs_dialog = base::ranges::any_of(actions, [profile](const auto& a) {
+ bool needs_dialog = std::ranges::any_of(actions, [profile](const auto& a) {
return a->ShouldNotifyUserOfPendingDestructiveAction(profile);
});
if (needs_dialog) {
diff --git a/chrome/browser/enterprise/idle/action_runner.cc b/chrome/browser/enterprise/idle/action_runner.cc
index 15ee12a..8dde559 100644
--- a/chrome/browser/enterprise/idle/action_runner.cc
+++ b/chrome/browser/enterprise/idle/action_runner.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/enterprise/idle/action_runner.h"
+#include <algorithm>
#include <iterator>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "components/enterprise/idle/idle_pref_names.h"
#include "components/enterprise/idle/metrics.h"
diff --git a/chrome/browser/enterprise/idle/dialog_manager.cc b/chrome/browser/enterprise/idle/dialog_manager.cc
index fc6752e..a9e0396d 100644
--- a/chrome/browser/enterprise/idle/dialog_manager.cc
+++ b/chrome/browser/enterprise/idle/dialog_manager.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/enterprise/idle/dialog_manager.h"
+#include <algorithm>
#include <utility>
#include "base/check.h"
#include "base/check_is_test.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -29,11 +29,11 @@
IdleDialog::ActionSet GetActionSet(PrefService* prefs) {
std::vector<ActionType> actions;
- base::ranges::transform(prefs->GetList(prefs::kIdleTimeoutActions),
- std::back_inserter(actions),
- [](const base::Value& action) {
- return static_cast<ActionType>(action.GetInt());
- });
+ std::ranges::transform(prefs->GetList(prefs::kIdleTimeoutActions),
+ std::back_inserter(actions),
+ [](const base::Value& action) {
+ return static_cast<ActionType>(action.GetInt());
+ });
return ActionsToActionSet(base::flat_set<ActionType>(std::move(actions)));
}
diff --git a/chrome/browser/enterprise/idle/idle_service.cc b/chrome/browser/enterprise/idle/idle_service.cc
index 5604366..3dfe074 100644
--- a/chrome/browser/enterprise/idle/idle_service.cc
+++ b/chrome/browser/enterprise/idle/idle_service.cc
@@ -76,11 +76,11 @@
IdleDialog::ActionSet GetActionSet(PrefService* prefs) {
std::vector<ActionType> actions;
- base::ranges::transform(prefs->GetList(prefs::kIdleTimeoutActions),
- std::back_inserter(actions),
- [](const base::Value& action) {
- return static_cast<ActionType>(action.GetInt());
- });
+ std::ranges::transform(prefs->GetList(prefs::kIdleTimeoutActions),
+ std::back_inserter(actions),
+ [](const base::Value& action) {
+ return static_cast<ActionType>(action.GetInt());
+ });
return ActionsToActionSet(base::flat_set<ActionType>(std::move(actions)));
}
diff --git a/chrome/browser/enterprise/platform_auth/platform_auth_provider_manager.cc b/chrome/browser/enterprise/platform_auth/platform_auth_provider_manager.cc
index 7c3e3eb..cf3c4420 100644
--- a/chrome/browser/enterprise/platform_auth/platform_auth_provider_manager.cc
+++ b/chrome/browser/enterprise/platform_auth/platform_auth_provider_manager.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <iterator>
#include <string>
#include <utility>
@@ -21,7 +22,6 @@
#include "base/no_destructor.h"
#include "base/numerics/clamped_math.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/chrome/browser/enterprise/reporting/extension_info.cc b/chrome/browser/enterprise/reporting/extension_info.cc
index cf7bed3..af34f79 100644
--- a/chrome/browser/enterprise/reporting/extension_info.cc
+++ b/chrome/browser/enterprise/reporting/extension_info.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/enterprise/reporting/extension_info.h"
+#include <algorithm>
#include <string>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "extensions/browser/extension_registry.h"
@@ -54,12 +54,12 @@
extension_info->add_permissions(permission);
};
- base::ranges::for_each(
+ std::ranges::for_each(
extensions::PermissionsParser::GetRequiredPermissions(extension)
.GetAPIsAsStrings(),
add_permission);
- base::ranges::for_each(
+ std::ranges::for_each(
extensions::PermissionsParser::GetOptionalPermissions(extension)
.GetAPIsAsStrings(),
add_permission);
@@ -72,12 +72,12 @@
extension_info->add_host_permissions(url.GetAsString());
};
- base::ranges::for_each(
+ std::ranges::for_each(
extensions::PermissionsParser::GetRequiredPermissions(extension)
.explicit_hosts(),
add_permission);
- base::ranges::for_each(
+ std::ranges::for_each(
extensions::PermissionsParser::GetOptionalPermissions(extension)
.explicit_hosts(),
add_permission);
diff --git a/chrome/browser/enterprise/signals/context_info_fetcher.cc b/chrome/browser/enterprise/signals/context_info_fetcher.cc
index 0f8906d..52bdc7a 100644
--- a/chrome/browser/enterprise/signals/context_info_fetcher.cc
+++ b/chrome/browser/enterprise/signals/context_info_fetcher.cc
@@ -9,11 +9,11 @@
#include "chrome/browser/enterprise/signals/context_info_fetcher.h"
+#include <algorithm>
#include <memory>
#include "base/command_line.h"
#include "base/files/file_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
@@ -91,7 +91,7 @@
return SettingValue::UNKNOWN;
}
base::SplitStringIntoKeyValuePairs(file_content, '=', '\n', &values);
- auto is_ufw_enabled = base::ranges::find(
+ auto is_ufw_enabled = std::ranges::find(
values, "ENABLED", &std::pair<std::string, std::string>::first);
if (is_ufw_enabled == values.end())
return SettingValue::UNKNOWN;
diff --git a/chrome/browser/enterprise/signals/device_info_fetcher_linux.cc b/chrome/browser/enterprise/signals/device_info_fetcher_linux.cc
index 83524ef..dbb3112 100644
--- a/chrome/browser/enterprise/signals/device_info_fetcher_linux.cc
+++ b/chrome/browser/enterprise/signals/device_info_fetcher_linux.cc
@@ -10,6 +10,7 @@
#include <sys/stat.h>
#include <sys/sysmacros.h>
+#include <algorithm>
#include <string>
#include "base/environment.h"
@@ -17,7 +18,6 @@
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/nix/xdg_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -49,7 +49,7 @@
if (base::PathExists(os_release_file) &&
base::ReadFileToStringWithMaxSize(os_release_file, &release_info, 8192) &&
base::SplitStringIntoKeyValuePairs(release_info, '=', '\n', &values)) {
- auto version_id = base::ranges::find(
+ auto version_id = std::ranges::find(
values, "VERSION_ID", &std::pair<std::string, std::string>::first);
if (version_id != values.end()) {
return std::string(
diff --git a/chrome/browser/enterprise/signin/enterprise_signin_service.cc b/chrome/browser/enterprise/signin/enterprise_signin_service.cc
index e7a7166..de25457 100644
--- a/chrome/browser/enterprise/signin/enterprise_signin_service.cc
+++ b/chrome/browser/enterprise/signin/enterprise_signin_service.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/enterprise/signin/enterprise_signin_service.h"
+#include <algorithm>
#include <string>
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/enterprise/signin/enterprise_signin_prefs.h"
#include "chrome/browser/profiles/profile.h"
diff --git a/chrome/browser/extensions/api/autofill_private/autofill_private_event_router.cc b/chrome/browser/extensions/api/autofill_private/autofill_private_event_router.cc
index cf8cdce..a56bff8 100644
--- a/chrome/browser/extensions/api/autofill_private/autofill_private_event_router.cc
+++ b/chrome/browser/extensions/api/autofill_private/autofill_private_event_router.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/autofill_private/autofill_private_event_router.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -11,7 +12,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/extensions/api/autofill_private/autofill_util.h"
diff --git a/chrome/browser/extensions/api/autofill_private/autofill_util.cc b/chrome/browser/extensions/api/autofill_private/autofill_util.cc
index 1dd3d841..1d3c1f2 100644
--- a/chrome/browser/extensions/api/autofill_private/autofill_util.cc
+++ b/chrome/browser/extensions/api/autofill_private/autofill_util.cc
@@ -73,7 +73,7 @@
// Add all address fields to the entry.
address.guid = profile.guid();
- base::ranges::transform(
+ std::ranges::transform(
autofill::GetDatabaseStoredTypesOfAutofillProfile(),
back_inserter(address.fields), [&profile](auto field_type) {
autofill_private::AddressField field;
diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
index 2b349b1..4f5e9f1 100644
--- a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
+++ b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
@@ -239,7 +239,7 @@
bool UsageInfosHasStorageKey(
const std::vector<storage::mojom::StorageUsageInfoPtr>& usage_infos,
const blink::StorageKey& key) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
usage_infos, [&key](const storage::mojom::StorageUsageInfoPtr& info) {
return info->storage_key == key;
});
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 34fe994c..c758634 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -8,6 +8,7 @@
#include <stddef.h>
+#include <algorithm>
#include <map>
#include <memory>
#include <optional>
@@ -23,7 +24,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/strings/string_number_conversions.h"
#include "base/types/optional_util.h"
@@ -750,7 +750,7 @@
// Re-use existing browser agent hosts.
const ExtensionId& extension_id = extension()->id();
AttachedClientHosts& hosts = g_attached_client_hosts.Get();
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
hosts, [&extension_id](ExtensionDevToolsClientHost* client_host) {
return client_host->extension_id() == extension_id &&
client_host->agent_host() &&
@@ -795,7 +795,7 @@
const ExtensionId& extension_id = extension()->id();
DevToolsAgentHost* agent_host = agent_host_.get();
AttachedClientHosts& hosts = g_attached_client_hosts.Get();
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
hosts,
[&agent_host, &extension_id](ExtensionDevToolsClientHost* client_host) {
return client_host->agent_host() == agent_host &&
diff --git a/chrome/browser/extensions/api/debugger/debugger_apitest.cc b/chrome/browser/extensions/api/debugger/debugger_apitest.cc
index a49193a5..4dd984b4 100644
--- a/chrome/browser/extensions/api/debugger/debugger_apitest.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_apitest.cc
@@ -4,6 +4,7 @@
#include <stddef.h>
+#include <algorithm>
#include <string>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
diff --git a/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc b/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
index cf18d96f..046f376a 100644
--- a/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
+++ b/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
@@ -24,7 +24,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/sequence_checker.h"
#include "base/strings/string_number_conversions.h"
@@ -413,7 +412,7 @@
void LoadExtensionWithRulesets(const std::vector<TestRulesetInfo>& rulesets,
const std::string& directory,
const std::vector<std::string>& hosts) {
- bool has_enabled_rulesets = base::ranges::any_of(
+ bool has_enabled_rulesets = std::ranges::any_of(
rulesets,
[](const TestRulesetInfo& ruleset) { return ruleset.enabled; });
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
index f476b38..73912cf 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <string>
#include <tuple>
@@ -21,7 +22,6 @@
#include "base/lazy_instance.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -845,7 +845,7 @@
WebContentsData* data = GetOrCreateWebContentsData(web_contents);
IdToPathMap& paths = data->allowed_unpacked_paths;
auto existing =
- base::ranges::find(paths, path, &IdToPathMap::value_type::second);
+ std::ranges::find(paths, path, &IdToPathMap::value_type::second);
if (existing != paths.end())
return existing->first;
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
index dad846a2..bd19f16 100644
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -992,7 +992,7 @@
// The permissions info should still show the set of granted API permissions
// which should include the notifications permission.
EXPECT_EQ(messages.size(), info->permissions.simple_permissions.size() - 1);
- EXPECT_TRUE(base::ranges::any_of(
+ EXPECT_TRUE(std::ranges::any_of(
info->permissions.simple_permissions,
[](api::developer_private::Permission& permission) {
return permission.message == "Display notifications";
diff --git a/chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.cc b/chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.cc
index d696f90..c6d3fa5a 100644
--- a/chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.cc
+++ b/chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.cc
@@ -4,20 +4,19 @@
#include "chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
-#include "chrome/common/extensions/api/enterprise_kiosk_input.h"
-#include "chromeos/crosapi/mojom/input_methods.mojom.h"
-
#include "chrome/browser/ash/crosapi/crosapi_ash.h"
#include "chrome/browser/ash/crosapi/crosapi_manager.h"
#include "chrome/browser/ash/crosapi/input_methods_ash.h"
+#include "chrome/common/extensions/api/enterprise_kiosk_input.h"
+#include "chromeos/crosapi/mojom/input_methods.mojom.h"
#include "ui/base/ime/ash/input_method_manager.h"
namespace {
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
index e932ade..76bc942 100644
--- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
+++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
@@ -903,7 +903,7 @@
extensions::ProcessManager::Get(browser()->profile());
std::set<content::RenderFrameHost*> hosts =
manager->GetRenderFrameHostsForExtension(extension->id());
- const auto& it = base::ranges::find_if(
+ const auto& it = std::ranges::find_if(
hosts, &content::RenderFrameHost::IsInPrimaryMainFrame);
content::RenderFrameHost* primary_render_frame_host =
(it != hosts.end()) ? *it : nullptr;
diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.cc b/chrome/browser/extensions/api/extension_action/extension_action_api.cc
index aaf28f1..73cab516 100644
--- a/chrome/browser/extensions/api/extension_action/extension_action_api.cc
+++ b/chrome/browser/extensions/api/extension_action/extension_action_api.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/extensions/extension_action_dispatcher.h"
@@ -114,8 +114,8 @@
const base::Value::List& color_list = color_value.GetList();
if (color_list.size() != 4 ||
- base::ranges::any_of(color_list,
- [](const auto& color) { return !color.is_int(); })) {
+ std::ranges::any_of(color_list,
+ [](const auto& color) { return !color.is_int(); })) {
return false;
}
diff --git a/chrome/browser/extensions/api/identity/identity_token_cache.cc b/chrome/browser/extensions/api/identity/identity_token_cache.cc
index 10a842d..fe05021 100644
--- a/chrome/browser/extensions/api/identity/identity_token_cache.cc
+++ b/chrome/browser/extensions/api/identity/identity_token_cache.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/extensions/api/identity/identity_token_cache.h"
+#include <algorithm>
#include <map>
#include <set>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/extensions/api/identity/identity_constants.h"
namespace extensions {
@@ -225,10 +225,10 @@
if (find_tokens_it != access_tokens_cache_.end()) {
const AccessTokensValue& cached_tokens = find_tokens_it->second;
auto matched_token_it =
- base::ranges::find_if(cached_tokens, [&key](const auto& cached_token) {
+ std::ranges::find_if(cached_tokens, [&key](const auto& cached_token) {
return key.scopes.size() <= cached_token.granted_scopes().size() &&
- base::ranges::includes(cached_token.granted_scopes(),
- key.scopes);
+ std::ranges::includes(cached_token.granted_scopes(),
+ key.scopes);
});
if (matched_token_it != cached_tokens.end()) {
diff --git a/chrome/browser/extensions/api/image_writer_private/xz_extractor.cc b/chrome/browser/extensions/api/image_writer_private/xz_extractor.cc
index 57cec37..20af8d3b 100644
--- a/chrome/browser/extensions/api/image_writer_private/xz_extractor.cc
+++ b/chrome/browser/extensions/api/image_writer_private/xz_extractor.cc
@@ -39,7 +39,7 @@
constexpr size_t kExpectedSize = sizeof(kExpectedMagic);
uint8_t actual_magic[kExpectedSize] = {};
return src_file.ReadAtCurrentPosAndCheck(actual_magic) &&
- base::ranges::equal(kExpectedMagic, actual_magic);
+ std::ranges::equal(kExpectedMagic, actual_magic);
}
// static
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
index c705e9e..6e2aad9 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <set>
@@ -15,7 +16,6 @@
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -882,7 +882,7 @@
input_method_ids, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
// Find and remove the matching input method id.
- const auto& pos = base::ranges::find(input_method_list, input_method_id);
+ const auto& pos = std::ranges::find(input_method_list, input_method_id);
if (pos != input_method_list.end()) {
input_method_list.erase(pos);
prefs->SetString(pref_name, base::JoinString(input_method_list, ","));
diff --git a/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc b/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
index 51e3a6a7..6e16cd1 100644
--- a/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
+++ b/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/extensions/api/notifications/extension_notification_display_helper.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/browser_process.h"
#include "chrome/browser/notifications/notification_display_service.h"
#include "chrome/browser/notifications/notification_display_service_factory.h"
@@ -59,8 +60,8 @@
bool ExtensionNotificationDisplayHelper::EraseDataForNotificationId(
const std::string& notification_id) {
- auto iter = base::ranges::find(notifications_, notification_id,
- &message_center::Notification::id);
+ auto iter = std::ranges::find(notifications_, notification_id,
+ &message_center::Notification::id);
if (iter == notifications_.end())
return false;
diff --git a/chrome/browser/extensions/api/offscreen/offscreen_apitest.cc b/chrome/browser/extensions/api/offscreen/offscreen_apitest.cc
index ce1dedb..bad379e 100644
--- a/chrome/browser/extensions/api/offscreen/offscreen_apitest.cc
+++ b/chrome/browser/extensions/api/offscreen/offscreen_apitest.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "build/build_config.h"
diff --git a/chrome/browser/extensions/api/passwords_private/password_check_delegate.cc b/chrome/browser/extensions/api/passwords_private/password_check_delegate.cc
index ba50023f..82732ae 100644
--- a/chrome/browser/extensions/api/passwords_private/password_check_delegate.cc
+++ b/chrome/browser/extensions/api/passwords_private/password_check_delegate.cc
@@ -20,7 +20,6 @@
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
index 2767a9a..5c5abda9 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
@@ -1285,20 +1285,20 @@
PasswordsPrivateDelegateImpl::CreatePasswordUiEntryFromCredentialUiEntry(
CredentialUIEntry credential) {
api::passwords_private::PasswordUiEntry entry;
- base::ranges::transform(credential.GetAffiliatedDomains(),
- std::back_inserter(entry.affiliated_domains),
- [](const CredentialUIEntry::DomainInfo& domain) {
- api::passwords_private::DomainInfo domain_info;
- // `domain.name` is used to redirect to the Password
- // Manager page for the password represented by the
- // current `CredentialUIEntry`.
- // LINT.IfChange
- domain_info.name = domain.name;
- // LINT.ThenChange(//chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc)
- domain_info.url = domain.url.spec();
- domain_info.signon_realm = domain.signon_realm;
- return domain_info;
- });
+ std::ranges::transform(credential.GetAffiliatedDomains(),
+ std::back_inserter(entry.affiliated_domains),
+ [](const CredentialUIEntry::DomainInfo& domain) {
+ api::passwords_private::DomainInfo domain_info;
+ // `domain.name` is used to redirect to the Password
+ // Manager page for the password represented by the
+ // current `CredentialUIEntry`.
+ // LINT.IfChange
+ domain_info.name = domain.name;
+ // LINT.ThenChange(//chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc)
+ domain_info.url = domain.url.spec();
+ domain_info.signon_realm = domain.signon_realm;
+ return domain_info;
+ });
entry.is_passkey = !credential.passkey_credential_id.empty();
entry.username = base::UTF16ToUTF8(credential.username);
if (entry.is_passkey) {
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc
index 4e49302..fc289ce 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
@@ -828,7 +828,7 @@
const PasswordsPrivateDelegate::UiEntries& credentials =
GetCredentials(*delegate);
EXPECT_EQ(credentials.size(), 2u);
- const auto account_credential_it = base::ranges::find(
+ const auto account_credential_it = std::ranges::find(
credentials, api::passwords_private::PasswordStoreSet::kAccount,
&PasswordUiEntry::stored_in);
ASSERT_NE(account_credential_it, credentials.end());
@@ -846,7 +846,7 @@
const PasswordsPrivateDelegate::UiEntries& updated_credentials =
GetCredentials(*delegate);
EXPECT_EQ(updated_credentials.size(), 2u);
- const auto refreshed_credential_it = base::ranges::find(
+ const auto refreshed_credential_it = std::ranges::find(
updated_credentials, api::passwords_private::PasswordStoreSet::kAccount,
&PasswordUiEntry::stored_in);
ASSERT_NE(account_credential_it, updated_credentials.end());
diff --git a/chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.cc b/chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.cc
index 85e4f275..364eef9 100644
--- a/chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.cc
+++ b/chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.h"
+#include <algorithm>
#include <optional>
#include <string>
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h"
@@ -113,8 +113,8 @@
bool TestPasswordsPrivateDelegate::ChangeCredential(
const api::passwords_private::PasswordUiEntry& credential) {
const auto existing =
- base::ranges::find(current_entries_, credential.id,
- &api::passwords_private::PasswordUiEntry::id);
+ std::ranges::find(current_entries_, credential.id,
+ &api::passwords_private::PasswordUiEntry::id);
if (existing == current_entries_.end()) {
return false;
}
diff --git a/chrome/browser/extensions/api/printing/printing_api_utils.cc b/chrome/browser/extensions/api/printing/printing_api_utils.cc
index 0106484fd..208d5a4 100644
--- a/chrome/browser/extensions/api/printing/printing_api_utils.cc
+++ b/chrome/browser/extensions/api/printing/printing_api_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/printing/printing_api_utils.h"
+#include <algorithm>
#include <memory>
#include <string_view>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/containers/flat_set.h"
#include "base/json/json_reader.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chromeos/crosapi/mojom/local_printer.mojom.h"
#include "chromeos/printing/printer_configuration.h"
@@ -324,7 +324,7 @@
const printing::PrintSettings::RequestedMedia& requested_media =
settings.requested_media();
- return base::ranges::any_of(
+ return std::ranges::any_of(
capabilities.papers,
[&requested_media](
const printing::PrinterSemanticCapsAndDefaults::Paper& paper) {
diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc
index 570bb5e..abadd84 100644
--- a/chrome/browser/extensions/api/processes/processes_api.cc
+++ b/chrome/browser/extensions/api/processes/processes_api.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/lazy_instance.h"
#include "base/metrics/histogram.h"
#include "base/process/process.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_tab_util.h"
@@ -640,7 +640,7 @@
if (specific_processes_requested) {
// Note: we can't use |!process_host_ids_.empty()| directly in the above
// condition as we will erase from |process_host_ids_| below.
- auto itr = base::ranges::find(process_host_ids_, child_process_host_id);
+ auto itr = std::ranges::find(process_host_ids_, child_process_host_id);
if (itr == process_host_ids_.end())
continue;
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc
index c973af5..de1169e 100644
--- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc
+++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -12,7 +13,6 @@
#include "ash/constants/ash_pref_names.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/login/quick_unlock/auth_token.h"
#include "chrome/browser/ash/login/quick_unlock/pin_backend.h"
#include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h"
@@ -111,7 +111,7 @@
}
bool IsPinNumeric(const std::string& pin) {
- return base::ranges::all_of(pin, ::isdigit);
+ return std::ranges::all_of(pin, ::isdigit);
}
// Reads and sanitizes the pin length policy.
diff --git a/chrome/browser/extensions/extension_action_runner.cc b/chrome/browser/extensions/extension_action_runner.cc
index 07d4a1d..099e4c69 100644
--- a/chrome/browser/extensions/extension_action_runner.cc
+++ b/chrome/browser/extensions/extension_action_runner.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/extension_action_runner.h"
+#include <algorithm>
#include <memory>
#include <tuple>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/extensions/api/side_panel/side_panel_service.h"
#include "chrome/browser/extensions/extension_action_dispatcher.h"
@@ -161,7 +161,7 @@
const std::vector<const Extension*>& extensions) {
SitePermissionsHelper permissions_helper(
Profile::FromBrowserContext(browser_context_));
- bool refresh_required = base::ranges::any_of(
+ bool refresh_required = std::ranges::any_of(
extensions, [this, &permissions_helper](const Extension* extension) {
return permissions_helper.PageNeedsRefreshToRun(
GetBlockedActions(extension->id()));
@@ -187,7 +187,7 @@
// hasn't been refreshed yet.
const GURL& url = web_contents()->GetLastCommittedURL();
auto* permissions_manager = PermissionsManager::Get(browser_context_);
- DCHECK(base::ranges::all_of(
+ DCHECK(std::ranges::all_of(
extensions, [url, &permissions_manager](const Extension* extension) {
return permissions_manager->GetUserSiteAccess(*extension, url) ==
PermissionsManager::UserSiteAccess::kOnClick;
diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc
index 72413e9..f5131c6 100644
--- a/chrome/browser/extensions/extension_prefs_unittest.cc
+++ b/chrome/browser/extensions/extension_prefs_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/extensions/extension_prefs_unittest.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
@@ -553,10 +553,10 @@
bool HasInfoForId(const ExtensionPrefs::ExtensionsInfo& info,
const std::string& id) {
- return base::ranges::find_if(info.begin(), info.end(),
- [&id](const ExtensionInfo& info) {
- return info.extension_id == id;
- }) != info.end();
+ return std::ranges::find_if(info.begin(), info.end(),
+ [&id](const ExtensionInfo& info) {
+ return info.extension_id == id;
+ }) != info.end();
}
void Initialize() override {
diff --git a/chrome/browser/extensions/extension_service_test_with_install.cc b/chrome/browser/extensions/extension_service_test_with_install.cc
index 7196ca5..d619800 100644
--- a/chrome/browser/extensions/extension_service_test_with_install.cc
+++ b/chrome/browser/extensions/extension_service_test_with_install.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/extensions/extension_service_test_with_install.h"
+#include <algorithm>
+
#include "base/files/file_util.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
@@ -401,7 +402,7 @@
UnloadedExtensionReason reason) {
unloaded_id_ = extension->id();
unloaded_reason_ = reason;
- auto i = base::ranges::find(loaded_extensions_, extension);
+ auto i = std::ranges::find(loaded_extensions_, extension);
// TODO(erikkay) fix so this can be an assert. Right now the tests
// are manually calling `ClearLoadedExtensions` since this method is not
// called by reloads, so this isn't doable.
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 900cffc..c2d2ab2a 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <array>
#include <map>
#include <memory>
@@ -28,7 +29,6 @@
#include "base/memory/ptr_util.h"
#include "base/one_shot_event.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
@@ -891,8 +891,8 @@
ExternalInstallError* GetError(const std::string& extension_id) {
std::vector<ExternalInstallError*> errors =
service_->external_install_manager()->GetErrorsForTesting();
- auto found = base::ranges::find(errors, extension_id,
- &ExternalInstallError::extension_id);
+ auto found = std::ranges::find(errors, extension_id,
+ &ExternalInstallError::extension_id);
return found == errors.end() ? nullptr : *found;
}
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index c58e166..3860900 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <iterator>
#include <set>
#include <string>
@@ -15,7 +16,6 @@
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
@@ -201,7 +201,7 @@
bool UpdateOverridesList(base::Value::List& overrides_list,
const std::string& override_url,
UpdateBehavior behavior) {
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
overrides_list, [&override_url](const base::Value& value) {
if (!value.is_dict())
return false;
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index 59a6f81..1a722f4 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/external_pref_loader.h"
+#include <algorithm>
#include <set>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -249,8 +249,8 @@
ExternalPrefLoader::PrioritySyncReadyWaiter* waiter) {
// Delete |waiter| from |pending_waiter_list_|.
pending_waiter_list_.erase(
- base::ranges::find(pending_waiter_list_, waiter,
- &std::unique_ptr<PrioritySyncReadyWaiter>::get));
+ std::ranges::find(pending_waiter_list_, waiter,
+ &std::unique_ptr<PrioritySyncReadyWaiter>::get));
// Continue loading.
GetExtensionFileTaskRunner()->PostTask(
FROM_HERE, base::BindOnce(&ExternalPrefLoader::LoadOnFileThread, this));
diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc
index e3ef1b7..324f3d86 100644
--- a/chrome/browser/extensions/install_verifier.cc
+++ b/chrome/browser/extensions/install_verifier.cc
@@ -15,7 +15,6 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/one_shot_event.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
@@ -230,7 +229,7 @@
if (!signature_.get() || !ShouldFetchSignature())
return;
- if (base::ranges::any_of(ids, [this](const std::string& id) {
+ if (std::ranges::any_of(ids, [this](const std::string& id) {
return base::Contains(signature_->ids, id) ||
base::Contains(signature_->invalid_ids, id);
})) {
@@ -333,7 +332,7 @@
void InstallVerifier::MaybeBootstrapSelf() {
ExtensionIdSet extension_ids = GetExtensionsToVerify();
if ((signature_.get() == nullptr && ShouldFetchSignature()) ||
- base::ranges::any_of(extension_ids, [this](const std::string& id) {
+ std::ranges::any_of(extension_ids, [this](const std::string& id) {
return !IsKnownId(id);
})) {
AddMany(extension_ids, ADD_ALL_BOOTSTRAP);
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index dd66a647..16e630c 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/menu_manager.h"
+#include <algorithm>
#include <memory>
#include <tuple>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/json/json_writer.h"
#include "base/notreached.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -461,7 +461,7 @@
}
MenuItem::OwnedList& list = i->second;
auto j =
- base::ranges::find(list, child_ptr, &std::unique_ptr<MenuItem>::get);
+ std::ranges::find(list, child_ptr, &std::unique_ptr<MenuItem>::get);
if (j == list.end()) {
NOTREACHED();
}
diff --git a/chrome/browser/extensions/omnibox_focus_interactive_test.cc b/chrome/browser/extensions/omnibox_focus_interactive_test.cc
index 7a50df2d..64f48525 100644
--- a/chrome/browser/extensions/omnibox_focus_interactive_test.cc
+++ b/chrome/browser/extensions/omnibox_focus_interactive_test.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <string_view>
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_browsertest.h"
@@ -406,7 +406,7 @@
subframe_url)));
const auto frames =
CollectAllRenderFrameHosts(web_contents->GetPrimaryPage());
- const auto it = base::ranges::find(
+ const auto it = std::ranges::find(
frames, subframe_url, &content::RenderFrameHost::GetLastCommittedURL);
ASSERT_NE(it, frames.cend());
content::RenderFrameHost* subframe = *it;
diff --git a/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc b/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc
index 4efbee77..15f70ea 100644
--- a/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc
+++ b/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <string>
#include <string_view>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/stringprintf.h"
diff --git a/chrome/browser/extensions/pending_extension_manager.cc b/chrome/browser/extensions/pending_extension_manager.cc
index 8a4f3b7..55cf41d0 100644
--- a/chrome/browser/extensions/pending_extension_manager.cc
+++ b/chrome/browser/extensions/pending_extension_manager.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/extensions/pending_extension_manager.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/version.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/preinstalled_web_apps/preinstalled_web_apps.h"
@@ -75,7 +76,7 @@
}
bool PendingExtensionManager::HasPendingExtensionFromSync() const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
pending_extensions_,
[](const std::pair<const std::string, PendingExtensionInfo>& it) {
return it.second.is_from_sync();
@@ -83,7 +84,7 @@
}
bool PendingExtensionManager::HasHighPriorityPendingExtension() const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
pending_extensions_,
[](const std::pair<const std::string, PendingExtensionInfo>& it) {
return it.second.install_source() ==
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 4af9c8c..5832506 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -189,7 +189,7 @@
SitePermissionsHelper permissions_helper(profile_);
const ExtensionSet& extensions =
ExtensionRegistry::Get(profile_)->enabled_extensions();
- reload_required_ = base::ranges::any_of(
+ reload_required_ = std::ranges::any_of(
extensions, [&permissions_helper,
web_contents](scoped_refptr<const Extension> extension) {
return permissions_helper.GetSiteInteraction(*extension,
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index c99e31f..18e68e0 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <array>
#include <list>
#include <map>
@@ -24,7 +25,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
@@ -599,7 +599,7 @@
const std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>>&
failures,
const ExtensionId& id) {
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
failures, id, [](const auto& failure) { return failure.first.id; });
return it == failures.end() ? nullptr : &it->second;
}
diff --git a/chrome/browser/extensions/window_controller_list.cc b/chrome/browser/extensions/window_controller_list.cc
index 21b7856..6774618e 100644
--- a/chrome/browser/extensions/window_controller_list.cc
+++ b/chrome/browser/extensions/window_controller_list.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/extensions/window_controller_list.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/extensions/api/tabs/windows_util.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/browser/extensions/window_controller_list_observer.h"
@@ -36,7 +37,7 @@
}
void WindowControllerList::RemoveExtensionWindow(WindowController* window) {
- auto iter = base::ranges::find(windows_, window);
+ auto iter = std::ranges::find(windows_, window);
if (iter != windows_.end()) {
windows_.erase(iter);
for (auto& observer : observers_)
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
index cf3674e5..fbe48d02 100644
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/file_system_access/chrome_file_system_access_permission_context.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <optional>
@@ -20,7 +21,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
@@ -605,10 +605,10 @@
bool PathInfosContains(const std::vector<content::PathInfo>& path_infos,
const base::FilePath& path) {
- return base::ranges::any_of(path_infos,
- [&path](const content::PathInfo& path_info) {
- return path_info.path == path;
- });
+ return std::ranges::any_of(path_infos,
+ [&path](const content::PathInfo& path_info) {
+ return path_info.path == path;
+ });
}
} // namespace
@@ -940,7 +940,7 @@
const content::PathInfo& new_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
auto entry_it =
- base::ranges::find_if(grants, [&old_path](const auto& entry) {
+ std::ranges::find_if(grants, [&old_path](const auto& entry) {
return entry.first == old_path.path;
});
@@ -1587,7 +1587,7 @@
std::vector<std::unique_ptr<Object>> all_objects;
for (const auto& origin : GetOriginsWithGrants()) {
auto objects = GetGrantedObjects(origin);
- base::ranges::move(objects, std::back_inserter(all_objects));
+ std::ranges::move(objects, std::back_inserter(all_objects));
}
return all_objects;
@@ -1613,12 +1613,12 @@
// Add origins that have active, granted permission grants.
for (const auto& it : active_permissions_map_) {
- if (base::ranges::any_of(it.second.read_grants,
- [&](const auto& grant) {
- return HasGrantedActivePermissionStatus(
- grant.second);
- }) ||
- base::ranges::any_of(it.second.write_grants, [&](const auto& grant) {
+ if (std::ranges::any_of(it.second.read_grants,
+ [&](const auto& grant) {
+ return HasGrantedActivePermissionStatus(
+ grant.second);
+ }) ||
+ std::ranges::any_of(it.second.write_grants, [&](const auto& grant) {
return HasGrantedActivePermissionStatus(grant.second);
})) {
origins.insert(it.first);
@@ -1984,7 +1984,7 @@
return;
}
- base::ranges::sort(entries);
+ std::ranges::sort(entries);
size_t entries_to_remove = entries.size() - max_ids_per_origin_;
for (size_t i = 0; i < entries_to_remove; ++i) {
bool did_remove_entry = dict.Remove(entries[i].second);
@@ -2310,7 +2310,7 @@
// First, check if an origin has read access granted via active permissions.
auto it = active_permissions_map_.find(origin);
if (it != active_permissions_map_.end()) {
- return base::ranges::any_of(it->second.read_grants, [&](const auto& grant) {
+ return std::ranges::any_of(it->second.read_grants, [&](const auto& grant) {
return HasGrantedActivePermissionStatus(grant.second);
});
}
@@ -2325,7 +2325,7 @@
if (extended_grant_objects.empty()) {
return false;
}
- return base::ranges::any_of(extended_grant_objects, [&](const auto& grant) {
+ return std::ranges::any_of(extended_grant_objects, [&](const auto& grant) {
return grant->value.FindBool(kPermissionReadableKey).value_or(false);
});
}
@@ -2337,10 +2337,9 @@
// First, check if an origin has write access granted via active permissions.
auto it = active_permissions_map_.find(origin);
if (it != active_permissions_map_.end()) {
- return base::ranges::any_of(
- it->second.write_grants, [&](const auto& grant) {
- return HasGrantedActivePermissionStatus(grant.second);
- });
+ return std::ranges::any_of(it->second.write_grants, [&](const auto& grant) {
+ return HasGrantedActivePermissionStatus(grant.second);
+ });
}
if (!base::FeatureList::IsEnabled(
features::kFileSystemAccessPersistentPermissions)) {
@@ -2353,7 +2352,7 @@
if (extended_grant_objects.empty()) {
return false;
}
- return base::ranges::any_of(extended_grant_objects, [&](const auto& grant) {
+ return std::ranges::any_of(extended_grant_objects, [&](const auto& grant) {
return grant->value.FindBool(kPermissionWritableKey).value_or(false);
});
}
@@ -2818,7 +2817,7 @@
GrantType grant_type) {
auto persisted_grants =
ObjectPermissionContextBase::GetGrantedObjects(origin);
- return base::ranges::any_of(persisted_grants, [&](const auto& object) {
+ return std::ranges::any_of(persisted_grants, [&](const auto& object) {
return HasMatchingValue(object->value, file_path, handle_type, grant_type);
});
}
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 16250ae..b1af8c1 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/first_run/first_run.h"
+#include <algorithm>
#include <memory>
#include <tuple>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/no_destructor.h"
#include "base/one_shot_event.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -183,7 +183,7 @@
const std::vector<std::string>& src,
std::vector<GURL>* ret) {
ret->resize(src.size());
- base::ranges::transform(src, ret->begin(), &UrlFromString);
+ std::ranges::transform(src, ret->begin(), &UrlFromString);
}
base::FilePath& GetInitialPrefsPathForTesting() {
diff --git a/chrome/browser/glic/launcher/glic_background_mode_manager.cc b/chrome/browser/glic/launcher/glic_background_mode_manager.cc
index 910cc307..bd834d6 100644
--- a/chrome/browser/glic/launcher/glic_background_mode_manager.cc
+++ b/chrome/browser/glic/launcher/glic_background_mode_manager.cc
@@ -21,7 +21,7 @@
namespace {
bool IsEnabledInAnyLoadedProfile() {
- return base::ranges::any_of(
+ return std::ranges::any_of(
g_browser_process->profile_manager()->GetLoadedProfiles(),
GlicEnabling::IsEnabledForProfile);
}
diff --git a/chrome/browser/google/google_brand.cc b/chrome/browser/google/google_brand.cc
index 60fb71e..70dea32d 100644
--- a/chrome/browser/google/google_brand.cc
+++ b/chrome/browser/google/google_brand.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/google/google_brand.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <string_view>
@@ -11,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -156,7 +156,7 @@
"GCT", "GCU", "GCV", "GCW",
};
return brand == "GGRV" ||
- base::ranges::any_of(kEnterpriseBrands, [&brand](const char* br) {
+ std::ranges::any_of(kEnterpriseBrands, [&brand](const char* br) {
return base::StartsWith(brand, br, base::CompareCase::SENSITIVE);
});
}
diff --git a/chrome/browser/hid/hid_pinned_notification_unittest.cc b/chrome/browser/hid/hid_pinned_notification_unittest.cc
index 5af21d77..c3defe9b 100644
--- a/chrome/browser/hid/hid_pinned_notification_unittest.cc
+++ b/chrome/browser/hid/hid_pinned_notification_unittest.cc
@@ -81,7 +81,7 @@
// Sort the |origin_items| by origin. This is necessary because the origin
// items for each profile in the pinned notification are created by
// iterating through a structure of flat_map<url::Origin, ...>.
- base::ranges::sort(sorted_origin_items);
+ std::ranges::sort(sorted_origin_items);
#if BUILDFLAG(ENABLE_EXTENSIONS)
std::vector<std::string> extension_names;
for (const auto& [origin, connection_count, name] : sorted_origin_items) {
diff --git a/chrome/browser/image_fetcher/image_decoder_impl.cc b/chrome/browser/image_fetcher/image_decoder_impl.cc
index 00d7f6a..0c0380e7e 100644
--- a/chrome/browser/image_fetcher/image_decoder_impl.cc
+++ b/chrome/browser/image_fetcher/image_decoder_impl.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/image_fetcher/image_decoder_impl.h"
+#include <algorithm>
#include <vector>
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
@@ -88,8 +88,8 @@
void ImageDecoderImpl::RemoveDecodeImageRequest(DecodeImageRequest* request) {
// Remove the finished request from the request queue.
auto request_it =
- base::ranges::find(decode_image_requests_, request,
- &std::unique_ptr<DecodeImageRequest>::get);
+ std::ranges::find(decode_image_requests_, request,
+ &std::unique_ptr<DecodeImageRequest>::get);
CHECK(request_it != decode_image_requests_.end(), base::NotFatalUntil::M130);
decode_image_requests_.erase(request_it);
}
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 41548af..7bb74192 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -6,11 +6,11 @@
#include <stddef.h>
+#include <algorithm>
#include <map>
#include <set>
#include <string>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h"
@@ -192,7 +192,7 @@
continue;
}
- const auto it = base::ranges::find_if(
+ const auto it = std::ranges::find_if(
parent->children(), [folder_name](const auto& node) {
return node->is_folder() && node->GetTitle() == *folder_name;
});
diff --git a/chrome/browser/install_verification/win/module_list.cc b/chrome/browser/install_verification/win/module_list.cc
index 1d7acc1f..16212fc 100644
--- a/chrome/browser/install_verification/win/module_list.cc
+++ b/chrome/browser/install_verification/win/module_list.cc
@@ -6,8 +6,9 @@
#include <Psapi.h>
+#include <algorithm>
+
#include "base/check.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/install_verification/win/module_info.h"
namespace {
@@ -20,7 +21,7 @@
} // namespace
ModuleList::~ModuleList() {
- base::ranges::for_each(modules_, &CheckFreeLibrary);
+ std::ranges::for_each(modules_, &CheckFreeLibrary);
}
std::unique_ptr<ModuleList> ModuleList::FromLoadedModuleSnapshot(
diff --git a/chrome/browser/ip_protection/ip_protection_core_host.cc b/chrome/browser/ip_protection/ip_protection_core_host.cc
index ebcac2b..df6a4a5 100644
--- a/chrome/browser/ip_protection/ip_protection_core_host.cc
+++ b/chrome/browser/ip_protection/ip_protection_core_host.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ip_protection/ip_protection_core_host.h"
+#include <algorithm>
#include <memory>
#include <optional>
@@ -12,7 +13,6 @@
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
diff --git a/chrome/browser/keyboard_accessory/android/accessory_sheet_data.cc b/chrome/browser/keyboard_accessory/android/accessory_sheet_data.cc
index ca891b19..efdc754 100644
--- a/chrome/browser/keyboard_accessory/android/accessory_sheet_data.cc
+++ b/chrome/browser/keyboard_accessory/android/accessory_sheet_data.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/keyboard_accessory/android/accessory_sheet_data.h"
+#include <algorithm>
+
#include "base/base64.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/types/cxx23_to_underlying.h"
#include "chrome/browser/keyboard_accessory/android/accessory_sheet_enums.h"
diff --git a/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl.cc
index 79737d65..2570ce7 100644
--- a/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl.cc
+++ b/chrome/browser/keyboard_accessory/android/address_accessory_controller_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/keyboard_accessory/android/address_accessory_controller_impl.h"
+#include <algorithm>
#include <utility>
#include "base/containers/fixed_flat_map.h"
@@ -11,7 +12,6 @@
#include "base/memory/ptr_util.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/android/preferences/autofill/settings_navigation_helper.h"
@@ -83,7 +83,7 @@
std::vector<UserInfo> UserInfosForProfiles(
const std::vector<const AutofillProfile*>& profiles) {
std::vector<UserInfo> infos(profiles.size());
- base::ranges::transform(profiles, infos.begin(), TranslateProfile);
+ std::ranges::transform(profiles, infos.begin(), TranslateProfile);
return infos;
}
diff --git a/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc
index 591e0be..886a22e 100644
--- a/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc
+++ b/chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/keyboard_accessory/android/password_accessory_controller_impl.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -20,7 +21,6 @@
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/android/resource_mapper.h"
@@ -186,7 +186,7 @@
base::span<const UiCredential>::iterator GetUiCredentialForSelection(
base::span<const UiCredential> matching_creds,
const AccessorySheetField& suggestion) {
- return base::ranges::find_if(matching_creds, [&](const auto& cred) {
+ return std::ranges::find_if(matching_creds, [&](const auto& cred) {
return suggestion.display_text() ==
(suggestion.is_obfuscated() ? cred.password() : cred.username());
});
@@ -294,11 +294,11 @@
origin),
GetPlusAddressTitle(!plus_address_info_to_add.empty(), origin),
std::move(info_to_add), CreateManagePasswordsFooter());
- base::ranges::for_each(std::move(passkeys_to_add),
- [&data](PasskeySection section) {
- data.add_passkey_section(std::move(section));
- });
- base::ranges::for_each(
+ std::ranges::for_each(std::move(passkeys_to_add),
+ [&data](PasskeySection section) {
+ data.add_passkey_section(std::move(section));
+ });
+ std::ranges::for_each(
std::move(plus_address_info_to_add),
[&data](autofill::PlusAddressInfo plus_address_info) {
data.add_plus_address_info(std::move(plus_address_info));
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
index 6f1b11c6..784499b 100644
--- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
+++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.h"
+#include <algorithm>
#include <iterator>
#include <utility>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/debug/dump_without_crashing.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/android/preferences/autofill/settings_navigation_helper.h"
@@ -201,10 +201,10 @@
if (!unmasked_cards.empty()) {
// Add the cached server cards first, so that they show up on the top of the
// manual filling view.
- base::ranges::transform(unmasked_cards, std::back_inserter(info_to_add),
- [allow_filling](const CachedServerCardInfo* data) {
- return TranslateCachedCard(data, allow_filling);
- });
+ std::ranges::transform(unmasked_cards, std::back_inserter(info_to_add),
+ [allow_filling](const CachedServerCardInfo* data) {
+ return TranslateCachedCard(data, allow_filling);
+ });
}
// Only add cards that are not present in the cache. Otherwise, we might
// show duplicates.
@@ -511,8 +511,8 @@
bool PaymentMethodAccessoryControllerImpl::FetchIfCreditCardId(
const std::string& selection_id) {
std::vector<CardOrVirtualCard> cards = GetAllCreditCards();
- auto card_iter = base::ranges::find_if(
- cards, [&selection_id](const auto& card_or_virtual) {
+ auto card_iter =
+ std::ranges::find_if(cards, [&selection_id](const auto& card_or_virtual) {
const CreditCard* card = UnwrapCardOrVirtualCard(card_or_virtual);
return card && card->guid() == selection_id;
});
@@ -532,7 +532,7 @@
const std::string& selection_id) {
std::vector<Iban> ibans = GetIbans();
auto iban_iter =
- base::ranges::find_if(ibans, [&selection_id](const Iban& available_iban) {
+ std::ranges::find_if(ibans, [&selection_id](const Iban& available_iban) {
return available_iban.record_type() == Iban::kServerIban &&
base::NumberToString(available_iban.instrument_id()) ==
selection_id;
diff --git a/chrome/browser/lifetime/browser_close_manager.cc b/chrome/browser/lifetime/browser_close_manager.cc
index ffa9f0ce..d805586c3 100644
--- a/chrome/browser/lifetime/browser_close_manager.cc
+++ b/chrome/browser/lifetime/browser_close_manager.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/lifetime/browser_close_manager.h"
+#include <algorithm>
#include <iterator>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process.h"
@@ -44,8 +44,8 @@
class BrowserListIterator : public BrowserListObserver {
public:
BrowserListIterator() {
- base::ranges::copy(*BrowserList::GetInstance(),
- std::inserter(browsers_, browsers_.begin()));
+ std::ranges::copy(*BrowserList::GetInstance(),
+ std::inserter(browsers_, browsers_.begin()));
BrowserList::GetInstance()->AddObserver(this);
}
BrowserListIterator(const BrowserListIterator&) = delete;
diff --git a/chrome/browser/media/capture_access_handler_base.cc b/chrome/browser/media/capture_access_handler_base.cc
index d08cbb3e..22513c4 100644
--- a/chrome/browser/media/capture_access_handler_base.cc
+++ b/chrome/browser/media/capture_access_handler_base.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/media/capture_access_handler_base.h"
+#include <algorithm>
#include <string>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/ui_features.h"
@@ -135,7 +135,7 @@
CaptureAccessHandlerBase::FindSession(int render_process_id,
int render_frame_id,
int page_request_id) {
- return base::ranges::find_if(
+ return std::ranges::find_if(
sessions_, [render_process_id, render_frame_id,
page_request_id](const Session& session) {
return session.request_process_id == render_process_id &&
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc
index 92b2ee6..35a4355 100644
--- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc
+++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h"
+#include <algorithm>
+
#include "base/barrier_closure.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
@@ -498,7 +499,7 @@
}
auto routes = media_router_->GetCurrentRoutes();
auto route_it =
- base::ranges::find(routes, sink_id, &MediaRoute::media_sink_id);
+ std::ranges::find(routes, sink_id, &MediaRoute::media_sink_id);
if (route_it == routes.end()) {
return std::nullopt;
}
diff --git a/chrome/browser/media/router/discovery/dial/device_description_service.cc b/chrome/browser/media/router/discovery/dial/device_description_service.cc
index 3b72b681..9cfe7d4 100644
--- a/chrome/browser/media/router/discovery/dial/device_description_service.cc
+++ b/chrome/browser/media/router/discovery/dial/device_description_service.cc
@@ -13,9 +13,10 @@
#include <sstream>
#endif
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media/router/discovery/dial/device_description_fetcher.h"
#include "chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.h"
#include "net/base/ip_address.h"
@@ -81,7 +82,7 @@
for (auto& fetcher_it : device_description_fetcher_map_) {
std::string device_label = fetcher_it.first;
const auto& device_it =
- base::ranges::find(devices, device_label, &DialDeviceData::label);
+ std::ranges::find(devices, device_label, &DialDeviceData::label);
if (device_it == devices.end() ||
device_it->device_description_url() ==
fetcher_it.second->device_description_url()) {
diff --git a/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
index c02b9f2..f0085b9 100644
--- a/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
+++ b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/media/router/discovery/discovery_network_list.h"
+#include <algorithm>
#include <iterator>
#include <set>
-#include "base/ranges/algorithm.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media_router {
@@ -22,10 +22,10 @@
// Also check that at most one ID is returned per interface name.
std::set<std::string> interface_name_set;
- base::ranges::transform(network_ids,
- std::insert_iterator<std::set<std::string>>{
- interface_name_set, end(interface_name_set)},
- &DiscoveryNetworkInfo::name);
+ std::ranges::transform(network_ids,
+ std::insert_iterator<std::set<std::string>>{
+ interface_name_set, end(interface_name_set)},
+ &DiscoveryNetworkInfo::name);
EXPECT_EQ(interface_name_set.size(), network_ids.size());
}
diff --git a/chrome/browser/media/router/discovery/discovery_network_monitor.cc b/chrome/browser/media/router/discovery/discovery_network_monitor.cc
index 827403cb..fa35e708 100644
--- a/chrome/browser/media/router/discovery/discovery_network_monitor.cc
+++ b/chrome/browser/media/router/discovery/discovery_network_monitor.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/media/router/discovery/discovery_network_monitor.h"
+#include <algorithm>
#include <memory>
#include <unordered_set>
@@ -12,7 +13,6 @@
#include "base/lazy_instance.h"
#include "base/memory/ptr_util.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/task_traits.h"
@@ -30,8 +30,8 @@
if (network_info_list.empty()) {
return DiscoveryNetworkMonitor::kNetworkIdDisconnected;
}
- if (base::ranges::all_of(network_info_list, &std::string::empty,
- &DiscoveryNetworkInfo::network_id)) {
+ if (std::ranges::all_of(network_info_list, &std::string::empty,
+ &DiscoveryNetworkInfo::network_id)) {
return DiscoveryNetworkMonitor::kNetworkIdUnknown;
}
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
index 3f2a69a..7500188 100644
--- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
+++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -357,7 +358,7 @@
// Remove existing cast sink from |sinks|. It will be added back if
// it can be successfully reconnected.
const auto& sinks = GetSinks();
- auto sink_it = base::ranges::find(sinks, socket_id, [](const auto& entry) {
+ auto sink_it = std::ranges::find(sinks, socket_id, [](const auto& entry) {
return entry.second.cast_data().cast_channel_id;
});
@@ -663,7 +664,7 @@
// IPEndPoint but different sink ID.
const net::IPEndPoint& ip_endpoint = extra_data.ip_endpoint;
const auto& sinks = GetSinks();
- auto old_sink_it = base::ranges::find_if(
+ auto old_sink_it = std::ranges::find_if(
sinks, [&cast_sink, &ip_endpoint](const auto& entry) {
return entry.first != cast_sink.sink().id() &&
entry.second.cast_data().ip_endpoint == ip_endpoint;
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
index cfeba978..b1d6bf37 100644
--- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
+++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
@@ -1194,9 +1194,9 @@
// CastMediaSinkServiceImpl generates a Cast sink based on |sink2_dial|.
const auto& sinks = media_sink_service_impl_.GetSinks();
- auto sink2_it = base::ranges::find(
- sinks, ip_endpoint2,
- [](const auto& entry) { return entry.second.cast_data().ip_endpoint; });
+ auto sink2_it = std::ranges::find(sinks, ip_endpoint2, [](const auto& entry) {
+ return entry.second.cast_data().ip_endpoint;
+ });
ASSERT_TRUE(sink2_it != sinks.end());
MediaSinkInternal sink2_cast_from_dial = sink2_it->second;
diff --git a/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc b/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc
index fb0cb6f..e9593f0 100644
--- a/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc
+++ b/chrome/browser/media/router/discovery/mdns/dns_sd_registry.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/media/router/discovery/mdns/dns_sd_registry.h"
+#include <algorithm>
#include <limits>
#include <utility>
#include "base/check.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/local_discovery/service_discovery_shared_client.h" // nogncheck
#include "chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h"
#include "chrome/common/buildflags.h"
@@ -38,8 +38,8 @@
bool DnsSdRegistry::ServiceTypeData::UpdateService(
bool added,
const DnsSdService& service) {
- auto it = base::ranges::find(service_list_, service.service_name,
- &DnsSdService::service_name);
+ auto it = std::ranges::find(service_list_, service.service_name,
+ &DnsSdService::service_name);
// Set to true when a service is updated in or added to the registry.
bool updated_or_added = added;
bool known = (it != service_list_.end());
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.cc b/chrome/browser/media/router/mojo/media_router_desktop.cc
index 0bcddc0..429df2c 100644
--- a/chrome/browser/media/router/mojo/media_router_desktop.cc
+++ b/chrome/browser/media/router/mojo/media_router_desktop.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <utility>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
@@ -901,8 +901,8 @@
for (const auto& provider_to_routes : routes_query_.providers_to_routes()) {
const mojom::MediaRouteProviderId provider_id = provider_to_routes.first;
const std::vector<MediaRoute>& routes = provider_to_routes.second;
- DCHECK_LE(base::ranges::count(routes, presentation_id,
- &MediaRoute::presentation_id),
+ DCHECK_LE(std::ranges::count(routes, presentation_id,
+ &MediaRoute::presentation_id),
1);
if (base::Contains(routes, presentation_id, &MediaRoute::presentation_id)) {
return provider_id;
@@ -939,8 +939,8 @@
for (const auto& sinks_query : sinks_queries_) {
const std::vector<MediaSink>& sinks =
sinks_query.second->cached_sink_list();
- DCHECK_LE(base::ranges::count(sinks, sink_id, &MediaSink::id), 1);
- auto sink_it = base::ranges::find(sinks, sink_id, &MediaSink::id);
+ DCHECK_LE(std::ranges::count(sinks, sink_id, &MediaSink::id), 1);
+ auto sink_it = std::ranges::find(sinks, sink_id, &MediaSink::id);
if (sink_it != sinks.end()) {
return &(*sink_it);
}
@@ -950,8 +950,8 @@
const MediaRoute* MediaRouterDesktop::GetRoute(
const MediaRoute::Id& route_id) const {
- auto it = base::ranges::find(current_routes_, route_id,
- &MediaRoute::media_route_id);
+ auto it =
+ std::ranges::find(current_routes_, route_id, &MediaRoute::media_route_id);
return it == current_routes_.end() ? nullptr : &*it;
}
diff --git a/chrome/browser/media/router/providers/cast/app_activity.cc b/chrome/browser/media/router/providers/cast/app_activity.cc
index f4300cc..2d13cfd 100644
--- a/chrome/browser/media/router/providers/cast/app_activity.cc
+++ b/chrome/browser/media/router/providers/cast/app_activity.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/media/router/providers/cast/app_activity.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media/router/providers/cast/cast_activity_manager.h"
#include "chrome/browser/media/router/providers/cast/cast_session_client.h"
#include "components/media_router/common/providers/cast/channel/cast_message_handler.h"
@@ -200,7 +200,7 @@
AutoJoinPolicy policy,
const url::Origin& origin,
content::FrameTreeNodeId frame_tree_node_id) const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
connected_clients_,
[policy, &origin, frame_tree_node_id](const auto& client) {
return IsAutoJoinAllowed(policy, origin, frame_tree_node_id.value(),
diff --git a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc
index d318234299..3a137a9 100644
--- a/chrome/browser/media/router/providers/cast/cast_activity_manager.cc
+++ b/chrome/browser/media/router/providers/cast/cast_activity_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/media/router/providers/cast/cast_activity_manager.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -16,7 +17,6 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/expected_macros.h"
@@ -274,7 +274,7 @@
// Find activity by session ID. Search should fail if the session ID is not
// valid.
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
app_activities_, session_id,
[](const auto& entry) { return entry.second->session_id(); });
return it == app_activities_.end() ? nullptr : it->second;
@@ -292,7 +292,7 @@
return nullptr;
}
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
app_activities_,
[&cast_source, &origin, frame_tree_node_id](const auto& pair) {
AutoJoinPolicy policy = cast_source.auto_join_policy();
@@ -490,7 +490,7 @@
CastActivityManager::ActivityMap::iterator
CastActivityManager::FindActivityByChannelId(int channel_id) {
- return base::ranges::find_if(activities_, [channel_id, this](auto& entry) {
+ return std::ranges::find_if(activities_, [channel_id, this](auto& entry) {
const MediaRoute& route = entry.second->route();
const MediaSinkInternal* sink = media_sink_service_->GetSinkByRoute(route);
return sink && sink->cast_data().cast_channel_id == channel_id;
@@ -500,7 +500,7 @@
CastActivityManager::ActivityMap::iterator
CastActivityManager::FindActivityBySink(const MediaSinkInternal& sink) {
const MediaSink::Id& sink_id = sink.sink().id();
- return base::ranges::find(activities_, sink_id, [](const auto& activity) {
+ return std::ranges::find(activities_, sink_id, [](const auto& activity) {
return activity.second->route().media_sink_id();
});
}
diff --git a/chrome/browser/media/router/providers/cast/cast_app_availability_tracker_unittest.cc b/chrome/browser/media/router/providers/cast/cast_app_availability_tracker_unittest.cc
index 40eb22fd..a7c0e4f 100644
--- a/chrome/browser/media/router/providers/cast/cast_app_availability_tracker_unittest.cc
+++ b/chrome/browser/media/router/providers/cast/cast_app_availability_tracker_unittest.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/media/router/providers/cast/cast_app_availability_tracker.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/test/simple_test_tick_clock.h"
#include "components/media_router/common/discovery/media_sink_internal.h"
#include "components/media_router/common/media_route_provider_helper.h"
@@ -23,9 +24,9 @@
namespace {
MATCHER_P(CastMediaSourcesEqual, expected, "") {
- return base::ranges::equal(expected, arg, std::equal_to<>(),
- &CastMediaSource::source_id,
- &CastMediaSource::source_id);
+ return std::ranges::equal(expected, arg, std::equal_to<>(),
+ &CastMediaSource::source_id,
+ &CastMediaSource::source_id);
}
MediaSinkInternal CreateSink(const std::string& id) {
diff --git a/chrome/browser/media/router/providers/cast/cast_session_tracker.cc b/chrome/browser/media/router/providers/cast/cast_session_tracker.cc
index c606bdea..94100d65 100644
--- a/chrome/browser/media/router/providers/cast/cast_session_tracker.cc
+++ b/chrome/browser/media/router/providers/cast/cast_session_tracker.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/media/router/providers/cast/cast_session_tracker.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h"
#include "chrome/browser/media/router/providers/cast/chrome_cast_message_handler.h"
@@ -55,7 +56,7 @@
CastSession* CastSessionTracker::GetSessionById(
const std::string& session_id) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
sessions_by_sink_id_, session_id,
[](const auto& entry) { return entry.second->session_id(); });
return it != sessions_by_sink_id_.end() ? it->second.get() : nullptr;
@@ -189,7 +190,7 @@
continue;
}
- auto session_media_it = base::ranges::find(
+ auto session_media_it = std::ranges::find(
*session_media_value_list, media_session_id,
[](const base::Value& session_media) {
return session_media.GetDict().FindInt("mediaSessionId");
diff --git a/chrome/browser/media/router/providers/dial/dial_activity_manager.cc b/chrome/browser/media/router/providers/dial/dial_activity_manager.cc
index 71ec242..0abc118 100644
--- a/chrome/browser/media/router/providers/dial/dial_activity_manager.cc
+++ b/chrome/browser/media/router/providers/dial/dial_activity_manager.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/media/router/providers/dial/dial_activity_manager.h"
+#include <algorithm>
#include <optional>
#include <string_view>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "chrome/browser/media/router/discovery/dial/dial_app_discovery_service.h"
#include "chrome/browser/media/router/providers/dial/dial_internal_message_util.h"
@@ -161,10 +161,9 @@
const DialActivity* DialActivityManager::GetActivityBySinkId(
const MediaSink::Id& sink_id) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- auto record_it =
- base::ranges::find(records_, sink_id, [](const auto& record) {
- return record.second->activity.route.media_sink_id();
- });
+ auto record_it = std::ranges::find(records_, sink_id, [](const auto& record) {
+ return record.second->activity.route.media_sink_id();
+ });
return record_it != records_.end() ? &(record_it->second->activity) : nullptr;
}
@@ -173,7 +172,7 @@
const MediaSource& media_source,
const url::Origin& client_origin) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- auto record_it = base::ranges::find_if(
+ auto record_it = std::ranges::find_if(
records_,
[&presentation_id, &media_source, &client_origin](const auto& record) {
const auto& route = record.second->activity.route;
diff --git a/chrome/browser/media/router/providers/openscreen/discovery/open_screen_listener_delegate.cc b/chrome/browser/media/router/providers/openscreen/discovery/open_screen_listener_delegate.cc
index a856a08..1db9b0d0 100644
--- a/chrome/browser/media/router/providers/openscreen/discovery/open_screen_listener_delegate.cc
+++ b/chrome/browser/media/router/providers/openscreen/discovery/open_screen_listener_delegate.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/media/router/providers/openscreen/discovery/open_screen_listener_delegate.h"
+#include <algorithm>
#include <cstddef>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "components/openscreen_platform/network_util.h"
#include "net/base/ip_endpoint.h"
@@ -123,14 +123,14 @@
ServiceInfo service_info =
ServiceInfoFromServiceDescription(service_description);
if (added) {
- auto it = base::ranges::find(receivers_, service_info.instance_name,
- &ServiceInfo::instance_name);
+ auto it = std::ranges::find(receivers_, service_info.instance_name,
+ &ServiceInfo::instance_name);
CHECK(it == receivers_.end());
receivers_.push_back(std::move(service_info));
listener_->OnReceiverUpdated(receivers_);
} else {
- auto it = base::ranges::find(receivers_, service_info.instance_name,
- &ServiceInfo::instance_name);
+ auto it = std::ranges::find(receivers_, service_info.instance_name,
+ &ServiceInfo::instance_name);
CHECK(it != receivers_.end());
*it = std::move(service_info);
listener_->OnReceiverUpdated(receivers_);
@@ -151,7 +151,7 @@
}
auto removed_it =
- base::ranges::find(receivers_, results[0], &ServiceInfo::instance_name);
+ std::ranges::find(receivers_, results[0], &ServiceInfo::instance_name);
// Move the receiver we want to remove to the end, so we don't have to shift.
CHECK(removed_it != receivers_.end());
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
index 724fa01..c91b9ff 100644
--- a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
+++ b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/i18n/number_formatting.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/media/router/media_router_feature.h"
@@ -240,10 +240,10 @@
const std::string sink_id =
WiredDisplayMediaRouteProvider::GetSinkIdForDisplay(display);
auto it =
- base::ranges::find(presentations_, sink_id,
- [](const Presentations::value_type& presentation) {
- return presentation.second.route().media_sink_id();
- });
+ std::ranges::find(presentations_, sink_id,
+ [](const Presentations::value_type& presentation) {
+ return presentation.second.route().media_sink_id();
+ });
if (it != presentations_.end()) {
it->second.receiver()->ExitFullscreen();
}
@@ -408,7 +408,7 @@
std::optional<Display> WiredDisplayMediaRouteProvider::GetDisplayBySinkId(
const std::string& sink_id) const {
std::vector<Display> displays = GetAllDisplays();
- auto it = base::ranges::find(displays, sink_id, &GetSinkIdForDisplay);
+ auto it = std::ranges::find(displays, sink_id, &GetSinkIdForDisplay);
return it == displays.end() ? std::nullopt
: std::make_optional<Display>(std::move(*it));
}
diff --git a/chrome/browser/media/webrtc/capture_policy_utils.cc b/chrome/browser/media/webrtc/capture_policy_utils.cc
index 85320190..c1cf2c48 100644
--- a/chrome/browser/media/webrtc/capture_policy_utils.cc
+++ b/chrome/browser/media/webrtc/capture_policy_utils.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/media/webrtc/capture_policy_utils.h"
+#include <algorithm>
#include <vector>
#include "base/feature_list.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ash/crosapi/crosapi_manager.h"
@@ -85,7 +85,7 @@
ContentSettingsForOneType content_settings =
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::ALL_SCREEN_CAPTURE);
- std::move(callback).Run(base::ranges::any_of(
+ std::move(callback).Run(std::ranges::any_of(
content_settings, [](const ContentSettingPatternSource& source) {
return source.GetContentSetting() ==
ContentSetting::CONTENT_SETTING_ALLOW;
diff --git a/chrome/browser/media/webrtc/desktop_capture_devices_util.cc b/chrome/browser/media/webrtc/desktop_capture_devices_util.cc
index 58b8421..d4c7596 100644
--- a/chrome/browser/media/webrtc/desktop_capture_devices_util.cc
+++ b/chrome/browser/media/webrtc/desktop_capture_devices_util.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/media/webrtc/desktop_capture_devices_util.h"
+#include <algorithm>
#include <string>
#include <utility>
#include "base/check_op.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/unguessable_token.h"
@@ -73,7 +73,7 @@
const auto& captured_config = captured->GetCaptureHandleConfig();
if (!captured_config.all_origins_permitted &&
- base::ranges::none_of(
+ std::ranges::none_of(
captured_config.permitted_origins,
[capturer_origin](const url::Origin& permitted_origin) {
return capturer_origin.IsSameOriginWith(permitted_origin);
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 43accd5c..53873f1c 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -8,6 +8,7 @@
#endif
#include "chrome/browser/media/webrtc/native_desktop_media_list.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/message_loop/message_pump_type.h"
#include "base/metrics/field_trial_params.h"
#include "base/numerics/checked_math.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_restrictions.h"
@@ -620,7 +620,7 @@
for (HWND window : z_ordered_windows) {
for (const auto* source_container : source_containers) {
auto source_it =
- base::ranges::find(*source_container, window, id_hwnd_projection);
+ std::ranges::find(*source_container, window, id_hwnd_projection);
if (source_it != source_container->end()) {
sorted_sources.push_back(*source_it);
break;
diff --git a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc
index 8c2e553b1..339e6d9 100644
--- a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc
+++ b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/barrier_closure.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/test/bind.h"
@@ -153,7 +154,7 @@
public:
void EraseObserver(InfoBarChangeObserver* observer) {
- auto iter = base::ranges::find(
+ auto iter = std::ranges::find(
observers_, observer,
[](const auto& observer_iter) { return observer_iter.second.get(); });
observers_.erase(iter);
diff --git a/chrome/browser/media/webrtc/webrtc_event_log_manager_common.cc b/chrome/browser/media/webrtc/webrtc_event_log_manager_common.cc
index 0b0212c..981cdc2 100644
--- a/chrome/browser/media/webrtc/webrtc_event_log_manager_common.cc
+++ b/chrome/browser/media/webrtc/webrtc_event_log_manager_common.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/media/webrtc/webrtc_event_log_manager_common.h"
+#include <algorithm>
#include <limits>
#include <string_view>
@@ -17,7 +18,6 @@
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -743,7 +743,7 @@
DCHECK_EQ(str.length(), kWebAppIdLength);
// Avoid leading '+', etc.
- if (!base::ranges::all_of(str, absl::ascii_isdigit)) {
+ if (!std::ranges::all_of(str, absl::ascii_isdigit)) {
return kInvalidWebRtcEventLogWebAppId;
}
diff --git a/chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc b/chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
index 8835ad8e..c3b852f7 100644
--- a/chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
+++ b/chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/media/webrtc/webrtc_event_log_manager_remote.h"
+#include <algorithm>
#include <iterator>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
@@ -1219,15 +1219,15 @@
// Limit over the number of pending logs (per BrowserContext). We count active
// logs too, since they become pending logs once completed.
const size_t active_count =
- base::ranges::count(active_logs_, browser_context_id,
- [](const decltype(active_logs_)::value_type& log) {
- return log.first.browser_context_id;
- });
+ std::ranges::count(active_logs_, browser_context_id,
+ [](const decltype(active_logs_)::value_type& log) {
+ return log.first.browser_context_id;
+ });
const size_t pending_count =
- base::ranges::count(pending_logs_, browser_context_id,
- [](const decltype(pending_logs_)::value_type& log) {
- return log.browser_context_id;
- });
+ std::ranges::count(pending_logs_, browser_context_id,
+ [](const decltype(pending_logs_)::value_type& log) {
+ return log.browser_context_id;
+ });
return active_count + pending_count < kMaxPendingRemoteBoundWebRtcEventLogs;
}
diff --git a/chrome/browser/media_galleries/chromeos/mtp_device_task_helper.cc b/chrome/browser/media_galleries/chromeos/mtp_device_task_helper.cc
index 63a9595..035cb69 100644
--- a/chrome/browser/media_galleries/chromeos/mtp_device_task_helper.cc
+++ b/chrome/browser/media_galleries/chromeos/mtp_device_task_helper.cc
@@ -12,7 +12,6 @@
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media_galleries/chromeos/mtp_device_object_enumerator.h"
#include "chrome/browser/media_galleries/chromeos/mtp_read_file_worker.h"
#include "chrome/browser/media_galleries/chromeos/snapshot_file_details.h"
@@ -459,7 +458,7 @@
}
CHECK_LE(base::checked_cast<int>(data.length()), request.buf_len);
- base::ranges::copy(data, request.buf->data());
+ std::ranges::copy(data, request.buf->data());
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(std::move(request.success_callback), file_info,
diff --git a/chrome/browser/metrics/perf/perf_events_collector.cc b/chrome/browser/metrics/perf/perf_events_collector.cc
index 49e021569..bba3c030 100644
--- a/chrome/browser/metrics/perf/perf_events_collector.cc
+++ b/chrome/browser/metrics/perf/perf_events_collector.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/metrics/perf/perf_events_collector.h"
+#include <algorithm>
#include <string>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -594,9 +594,9 @@
}
if (has_cycles) {
// Store CPU max frequencies in the sampled profile.
- base::ranges::copy(max_frequencies_mhz_,
- google::protobuf::RepeatedFieldBackInserter(
- sampled_profile->mutable_cpu_max_frequency_mhz()));
+ std::ranges::copy(max_frequencies_mhz_,
+ google::protobuf::RepeatedFieldBackInserter(
+ sampled_profile->mutable_cpu_max_frequency_mhz()));
}
bool posted = base::ThreadPool::PostTaskAndReply(
diff --git a/chrome/browser/metrics/variations/variations_safe_mode_end_to_end_browsertest.cc b/chrome/browser/metrics/variations/variations_safe_mode_end_to_end_browsertest.cc
index f462580..d47b40b 100644
--- a/chrome/browser/metrics/variations/variations_safe_mode_end_to_end_browsertest.cc
+++ b/chrome/browser/metrics/variations/variations_safe_mode_end_to_end_browsertest.cc
@@ -6,6 +6,7 @@
// should be kept in sync with those in ios/chrome/browser/variations/
// variations_safe_mode_egtest.mm.
+#include <ranges>
#include <string>
#include "base/atomic_sequence_num.h"
@@ -16,7 +17,6 @@
#include "base/metrics/field_trial.h"
#include "base/path_service.h"
#include "base/process/launch.h"
-#include "base/ranges/ranges.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
diff --git a/chrome/browser/navigation_predictor/navigation_predictor.cc b/chrome/browser/navigation_predictor/navigation_predictor.cc
index e13e55f..248e2b0 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor.cc
@@ -13,7 +13,6 @@
#include "base/hash/hash.h"
#include "base/metrics/field_trial_params.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/system/sys_info.h"
#include "base/time/default_tick_clock.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service.h"
@@ -77,7 +76,7 @@
// Truncate at 100 characters.
path_length = std::min(path_length, static_cast<int64_t>(100));
- int num_slashes = base::ranges::count(path, '/');
+ int num_slashes = std::ranges::count(path, '/');
// Truncate at 5.
int path_depth = std::min(num_slashes, 5);
diff --git a/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc b/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
index 1a997b0..6f0164f 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
@@ -1584,7 +1584,7 @@
auto entries = ukm_recorder.GetEntriesByName(UkmEntry::kEntryName);
ASSERT_EQ(2u, entries.size());
std::vector<std::tuple<int, int, int>> recorded_metrics(entries.size());
- base::ranges::transform(
+ std::ranges::transform(
entries, recorded_metrics.begin(), [&ukm_recorder](const auto& entry) {
auto anchor_id = static_cast<int>(
*ukm_recorder.GetEntryMetric(entry, UkmEntry::kAnchorIndexName));
diff --git a/chrome/browser/nearby_sharing/certificates/nearby_share_certificate_storage.cc b/chrome/browser/nearby_sharing/certificates/nearby_share_certificate_storage.cc
index cb23b640..c6b44aa7 100644
--- a/chrome/browser/nearby_sharing/certificates/nearby_share_certificate_storage.cc
+++ b/chrome/browser/nearby_sharing/certificates/nearby_share_certificate_storage.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/nearby_sharing/certificates/nearby_share_certificate_storage.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/nearby_sharing/certificates/common.h"
#include "components/cross_device/logging/logging.h"
@@ -33,8 +34,8 @@
return;
}
- auto it = base::ranges::find(*certs, private_certificate.id(),
- &NearbySharePrivateCertificate::id);
+ auto it = std::ranges::find(*certs, private_certificate.id(),
+ &NearbySharePrivateCertificate::id);
if (it == certs->end()) {
CD_LOG(VERBOSE, Feature::NS)
<< __func__ << ": No private certificate with id="
diff --git a/chrome/browser/nearby_sharing/nearby_per_session_discovery_manager.cc b/chrome/browser/nearby_sharing/nearby_per_session_discovery_manager.cc
index 6879f239..3c801d3e 100644
--- a/chrome/browser/nearby_sharing/nearby_per_session_discovery_manager.cc
+++ b/chrome/browser/nearby_sharing/nearby_per_session_discovery_manager.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/nearby_sharing/nearby_per_session_discovery_manager.h"
+#include <algorithm>
#include <string>
#include "base/containers/contains.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/nearby_sharing/attachment.h"
#include "chrome/browser/nearby_sharing/nearby_confirmation_manager.h"
@@ -169,10 +169,10 @@
// Dedup by the more stable device ID if possible.
if (share_target.device_id) {
auto it =
- base::ranges::find(discovered_share_targets_, share_target.device_id,
- [](const auto& id_share_target_pair) {
- return id_share_target_pair.second.device_id;
- });
+ std::ranges::find(discovered_share_targets_, share_target.device_id,
+ [](const auto& id_share_target_pair) {
+ return id_share_target_pair.second.device_id;
+ });
if (it != discovered_share_targets_.end()) {
CD_LOG(VERBOSE, Feature::NS)
diff --git a/chrome/browser/net/secure_dns_util.cc b/chrome/browser/net/secure_dns_util.cc
index 71af88f..b7f393d 100644
--- a/chrome/browser/net/secure_dns_util.cc
+++ b/chrome/browser/net/secure_dns_util.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/net/secure_dns_util.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <string>
@@ -12,7 +13,6 @@
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/browser/net/dns_probe_runner.h"
#include "chrome/common/chrome_features.h"
@@ -36,7 +36,7 @@
return true;
}
const auto& countries = entry->display_countries;
- bool matches = base::ranges::any_of(
+ bool matches = std::ranges::any_of(
countries, [country_id](const std::string& country_code) {
return country_codes::CountryStringToCountryID(country_code) ==
country_id;
@@ -79,17 +79,17 @@
const net::DohProviderEntry::List& providers,
int country_id) {
net::DohProviderEntry::List local_providers;
- base::ranges::copy_if(providers, std::back_inserter(local_providers),
- [country_id](const net::DohProviderEntry* entry) {
- return EntryIsForCountry(entry, country_id);
- });
+ std::ranges::copy_if(providers, std::back_inserter(local_providers),
+ [country_id](const net::DohProviderEntry* entry) {
+ return EntryIsForCountry(entry, country_id);
+ });
return local_providers;
}
net::DohProviderEntry::List SelectEnabledProviders(
const net::DohProviderEntry::List& providers) {
net::DohProviderEntry::List enabled_providers;
- base::ranges::copy_if(
+ std::ranges::copy_if(
providers, std::back_inserter(enabled_providers),
[](const net::DohProviderEntry* entry) {
return base::FeatureList::IsEnabled(entry->feature.get());
diff --git a/chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.cc b/chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.cc
index 73eb25b..ef56b70e 100644
--- a/chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.cc
+++ b/chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.h"
+#include <algorithm>
+
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h"
#include "chrome/browser/new_tab_page/chrome_colors/selected_colors_info.h"
#include "chrome/browser/themes/theme_service_factory.h"
diff --git a/chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.cc b/chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.cc
index e5ff44a..ab67ae2 100644
--- a/chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.cc
+++ b/chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_util.h"
+#include <algorithm>
#include <iterator>
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h"
#include "chrome/browser/ui/webui/cr_components/theme_color_picker/customize_chrome_colors.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -32,19 +32,19 @@
void RecordChromeColorsDynamicColor(int color_id) {
base::UmaHistogramExactLinear(
"ChromeColors.DynamicColorOnLoad", color_id,
- base::ranges::max_element(kDynamicCustomizeChromeColors, {},
- &DynamicColorInfo::id)
+ std::ranges::max_element(kDynamicCustomizeChromeColors, {},
+ &DynamicColorInfo::id)
->id);
RecordChromeColorsColorType(ChromeColorType::kDynamicChromeColor);
}
int GetDynamicColorId(const SkColor color,
ui::mojom::BrowserColorVariant variant) {
- auto it = base::ranges::find_if(kDynamicCustomizeChromeColors,
- [&](const DynamicColorInfo& dynamic_color) {
- return dynamic_color.color == color &&
- dynamic_color.variant == variant;
- });
+ auto it = std::ranges::find_if(kDynamicCustomizeChromeColors,
+ [&](const DynamicColorInfo& dynamic_color) {
+ return dynamic_color.color == color &&
+ dynamic_color.variant == variant;
+ });
return it == kDynamicCustomizeChromeColors.end() ? kOtherDynamicColorId
: it->id;
}
@@ -67,8 +67,8 @@
}
int GetChromeColorsInfo(SkColor color) {
- const auto it = base::ranges::find(chrome_colors::kGeneratedColorsInfo, color,
- &chrome_colors::ColorInfo::color);
+ const auto it = std::ranges::find(chrome_colors::kGeneratedColorsInfo, color,
+ &chrome_colors::ColorInfo::color);
return it == std::end(chrome_colors::kGeneratedColorsInfo) ? kOtherColorId
: it->id;
}
diff --git a/chrome/browser/notifications/notification_channels_provider_android_unittest.cc b/chrome/browser/notifications/notification_channels_provider_android_unittest.cc
index 8eb9eb89..dfe91a9 100644
--- a/chrome/browser/notifications/notification_channels_provider_android_unittest.cc
+++ b/chrome/browser/notifications/notification_channels_provider_android_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/notifications/notification_channels_provider_android.h"
+#include <algorithm>
#include <map>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
@@ -61,7 +61,7 @@
void SetChannelStatus(const std::string& origin,
NotificationChannelStatus status) {
DCHECK_NE(NotificationChannelStatus::UNAVAILABLE, status);
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
channels_, origin,
[](const Channels::value_type& pair) { return pair.second.origin; });
CHECK(it != channels_.end(), base::NotFatalUntil::M130)
diff --git a/chrome/browser/notifications/notification_display_queue.cc b/chrome/browser/notifications/notification_display_queue.cc
index 20cdc33..ecd0fe65 100644
--- a/chrome/browser/notifications/notification_display_queue.cc
+++ b/chrome/browser/notifications/notification_display_queue.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/notifications/notification_display_queue.h"
+#include <algorithm>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/notifications/notification_display_service.h"
#include "url/origin.h"
@@ -104,10 +104,10 @@
bool NotificationDisplayQueue::DoRemoveQueuedNotification(
const std::string& notification_id,
bool notify) {
- auto it = base::ranges::find(queued_notifications_, notification_id,
- [](const QueuedNotification& queued) {
- return queued.notification.id();
- });
+ auto it = std::ranges::find(queued_notifications_, notification_id,
+ [](const QueuedNotification& queued) {
+ return queued.notification.id();
+ });
if (it == queued_notifications_.end())
return false;
@@ -145,7 +145,7 @@
bool NotificationDisplayQueue::IsAnyNotificationBlockerActive(
const message_center::Notification& notification) const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
blockers_,
[¬ification](const std::unique_ptr<NotificationBlocker>& blocker) {
return blocker->ShouldBlockNotification(notification);
diff --git a/chrome/browser/notifications/scheduler/internal/display_decider.cc b/chrome/browser/notifications/scheduler/internal/display_decider.cc
index 849596b..a76898f 100644
--- a/chrome/browser/notifications/scheduler/internal/display_decider.cc
+++ b/chrome/browser/notifications/scheduler/internal/display_decider.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/notifications/scheduler/internal/display_decider.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/time/clock.h"
#include "chrome/browser/notifications/scheduler/internal/impression_types.h"
#include "chrome/browser/notifications/scheduler/internal/notification_entry.h"
@@ -101,7 +102,7 @@
// No previous shown notification, move the iterator to last element.
// We will iterate through all client types later.
- auto it = base::ranges::find(clients_, last_shown_type_);
+ auto it = std::ranges::find(clients_, last_shown_type_);
if (it == clients_.end()) {
DCHECK_EQ(last_shown_type_, SchedulerClientType::kUnknown);
last_shown_type_ = clients_.back();
diff --git a/chrome/browser/notifications/screen_capture_notification_blocker.cc b/chrome/browser/notifications/screen_capture_notification_blocker.cc
index 211d7c4..c9bec05 100644
--- a/chrome/browser/notifications/screen_capture_notification_blocker.cc
+++ b/chrome/browser/notifications/screen_capture_notification_blocker.cc
@@ -8,7 +8,6 @@
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
@@ -53,7 +52,7 @@
return false;
// Otherwise block all notifications that belong to non-capturing origins.
- return base::ranges::none_of(
+ return std::ranges::none_of(
capturing_web_contents_,
[¬ification](content::WebContents* web_contents) {
return url::IsSameOriginWith(notification.origin_url(),
diff --git a/chrome/browser/notifications/stub_notification_display_service.cc b/chrome/browser/notifications/stub_notification_display_service.cc
index 4b2e8c18..c21775c3 100644
--- a/chrome/browser/notifications/stub_notification_display_service.cc
+++ b/chrome/browser/notifications/stub_notification_display_service.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/notifications/stub_notification_display_service.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "chrome/browser/notifications/notification_handler.h"
#include "chrome/browser/profiles/profile.h"
@@ -51,7 +52,7 @@
std::optional<message_center::Notification>
StubNotificationDisplayService::GetNotification(
const std::string& notification_id) {
- auto iter = base::ranges::find(
+ auto iter = std::ranges::find(
notifications_, notification_id,
[](const NotificationData& data) { return data.notification.id(); });
@@ -64,7 +65,7 @@
const NotificationCommon::Metadata*
StubNotificationDisplayService::GetMetadataForNotification(
const message_center::Notification& notification) {
- auto iter = base::ranges::find(
+ auto iter = std::ranges::find(
notifications_, notification.id(),
[](const NotificationData& data) { return data.notification.id(); });
@@ -290,7 +291,7 @@
StubNotificationDisplayService::FindNotification(
NotificationHandler::Type notification_type,
const std::string& notification_id) {
- return base::ranges::find_if(
+ return std::ranges::find_if(
notifications_,
[notification_type, ¬ification_id](const NotificationData& data) {
return data.type == notification_type &&
diff --git a/chrome/browser/on_device_translation/service_controller.cc b/chrome/browser/on_device_translation/service_controller.cc
index 9f156c2..e66af5b 100644
--- a/chrome/browser/on_device_translation/service_controller.cc
+++ b/chrome/browser/on_device_translation/service_controller.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/on_device_translation/service_controller.h"
+#include <algorithm>
+
#include "base/feature_list.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
@@ -11,7 +13,6 @@
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/task/sequenced_task_runner.h"
@@ -366,11 +367,11 @@
const auto installed_packs = ComponentManager::GetInstalledLanguagePacks();
std::vector<PendingTask> pending_tasks = std::move(pending_tasks_);
for (auto& task : pending_tasks) {
- if (base::ranges::all_of(task.required_packs.begin(),
- task.required_packs.end(),
- [&](const LanguagePackKey& key) {
- return installed_packs.contains(key);
- })) {
+ if (std::ranges::all_of(task.required_packs.begin(),
+ task.required_packs.end(),
+ [&](const LanguagePackKey& key) {
+ return installed_packs.contains(key);
+ })) {
std::move(task.once_closure).Run();
} else {
pending_tasks_.push_back(std::move(task));
@@ -451,12 +452,11 @@
CHECK(to_be_registered_packs.empty());
required_packs = CalculateRequiredLanguagePacks(source_lang, target_lang);
const auto installed_packs = ComponentManager::GetInstalledLanguagePacks();
- base::ranges::set_difference(
- required_packs, installed_packs,
- std::back_inserter(required_not_installed_packs));
+ std::ranges::set_difference(required_packs, installed_packs,
+ std::back_inserter(required_not_installed_packs));
const auto registered_packs = ComponentManager::GetRegisteredLanguagePacks();
- base::ranges::set_difference(required_not_installed_packs, registered_packs,
- std::back_inserter(to_be_registered_packs));
+ std::ranges::set_difference(required_not_installed_packs, registered_packs,
+ std::back_inserter(to_be_registered_packs));
}
void OnDeviceTranslationServiceController::OnServiceIdle() {
diff --git a/chrome/browser/optimization_guide/prediction/prediction_model_store_browsertest.cc b/chrome/browser/optimization_guide/prediction/prediction_model_store_browsertest.cc
index 7c985597..406b5e4 100644
--- a/chrome/browser/optimization_guide/prediction/prediction_model_store_browsertest.cc
+++ b/chrome/browser/optimization_guide/prediction/prediction_model_store_browsertest.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_run_loop_timeout.h"
#include "base/test/task_environment.h"
@@ -204,7 +205,7 @@
EXPECT_EQ(request.method, net::test_server::METHOD_POST);
EXPECT_TRUE(get_models_request.ParseFromString(request.content));
response->set_code(net::HTTP_OK);
- if (!base::ranges::any_of(
+ if (!std::ranges::any_of(
get_models_request.requested_models(),
[](const proto::ModelInfo& model_info) {
return model_info.optimization_target() ==
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
index 46225d4..82c6906 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <iterator>
#include <memory>
#include <string>
@@ -17,7 +18,6 @@
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
diff --git a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
index 8435cc08..a6d45b1 100644
--- a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
+++ b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.h"
+#include <algorithm>
#include <functional>
-#include "base/ranges/algorithm.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_store/password_store_interface.h"
@@ -42,7 +42,7 @@
void AllPasswordsBottomSheetHelper::OnGetPasswordStoreResults(
std::vector<std::unique_ptr<password_manager::PasswordForm>> results) {
- int results_count = base::ranges::count_if(
+ int results_count = std::ranges::count_if(
results, std::not_fn(&password_manager::PasswordForm::blocked_by_user));
available_credentials_ = available_credentials_.value_or(0) + results_count;
if (available_credentials_.value() == 0) {
diff --git a/chrome/browser/password_manager/android/built_in_backend_to_android_backend_migrator_unittest.cc b/chrome/browser/password_manager/android/built_in_backend_to_android_backend_migrator_unittest.cc
index 4666c59d..38c4970 100644
--- a/chrome/browser/password_manager/android/built_in_backend_to_android_backend_migrator_unittest.cc
+++ b/chrome/browser/password_manager/android/built_in_backend_to_android_backend_migrator_unittest.cc
@@ -636,8 +636,8 @@
std::vector<PasswordForm> EntriesToPasswordForms(
const std::vector<Entry>& entries) const {
std::vector<PasswordForm> v;
- base::ranges::transform(entries, std::back_inserter(v),
- &Entry::ToPasswordForm);
+ std::ranges::transform(entries, std::back_inserter(v),
+ &Entry::ToPasswordForm);
return v;
}
diff --git a/chrome/browser/password_manager/android/password_store_android_backend.cc b/chrome/browser/password_manager/android/password_store_android_backend.cc
index 24074bb..a26754a 100644
--- a/chrome/browser/password_manager/android/password_store_android_backend.cc
+++ b/chrome/browser/password_manager/android/password_store_android_backend.cc
@@ -6,6 +6,7 @@
#include <jni.h>
+#include <algorithm>
#include <cmath>
#include <list>
#include <memory>
@@ -21,7 +22,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -1033,7 +1033,7 @@
}
}
// Erase each timed out job and record that it was cleaned up.
- base::ranges::for_each(timed_out_job_ids, [&](const JobId& job_id) {
+ std::ranges::for_each(timed_out_job_ids, [&](const JobId& job_id) {
GetAndEraseJob(job_id)->RecordMetrics(AndroidBackendError{
.type = AndroidBackendErrorType::kCleanedUpWithoutResponse});
});
diff --git a/chrome/browser/password_manager/android/password_store_backend_migration_decorator.cc b/chrome/browser/password_manager/android/password_store_backend_migration_decorator.cc
index e58c54a..8a4905b9 100644
--- a/chrome/browser/password_manager/android/password_store_backend_migration_decorator.cc
+++ b/chrome/browser/password_manager/android/password_store_backend_migration_decorator.cc
@@ -47,7 +47,7 @@
base::BarrierCallback<bool>(
/*num_callbacks=*/2,
base::BindOnce([](const std::vector<bool>& results) {
- return base::ranges::all_of(results, std::identity());
+ return std::ranges::all_of(results, std::identity());
}).Then(std::move(completion)));
auto remote_changes_callback = base::BindRepeating(
&PasswordStoreBackendMigrationDecorator::OnRemoteFormChangesReceived,
diff --git a/chrome/browser/password_manager/android/password_store_bridge.cc b/chrome/browser/password_manager/android/password_store_bridge.cc
index 735f345..c84d6e4f 100644
--- a/chrome/browser/password_manager/android/password_store_bridge.cc
+++ b/chrome/browser/password_manager/android/password_store_bridge.cc
@@ -6,6 +6,7 @@
#include <jni.h>
+#include <algorithm>
#include <memory>
#include <vector>
@@ -13,7 +14,6 @@
#include "base/android/jni_string.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "components/password_manager/core/browser/form_parsing/form_data_parser.h"
#include "url/android/gurl_android.h"
@@ -25,7 +25,7 @@
namespace {
using password_manager::PasswordForm;
using Store = password_manager::PasswordForm::Store;
-using base::ranges::count_if;
+using std::ranges::count_if;
PasswordForm ConvertJavaObjectToPasswordForm(
JNIEnv* env,
diff --git a/chrome/browser/password_manager/android/password_store_proxy_backend.cc b/chrome/browser/password_manager/android/password_store_proxy_backend.cc
index 012c4e2..d2dd1bb 100644
--- a/chrome/browser/password_manager/android/password_store_proxy_backend.cc
+++ b/chrome/browser/password_manager/android/password_store_proxy_backend.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/password_manager/android/password_store_proxy_backend.h"
+#include <algorithm>
#include <functional>
#include <memory>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "chrome/browser/password_manager/android/password_manager_android_util.h"
#include "components/password_manager/core/browser/features/password_features.h"
@@ -38,7 +38,7 @@
void InvokeCallbackWithCombinedStatus(base::OnceCallback<void(bool)> completion,
std::vector<bool> statuses) {
- std::move(completion).Run(base::ranges::all_of(statuses, std::identity()));
+ std::move(completion).Run(std::ranges::all_of(statuses, std::identity()));
}
void RecordPasswordDeletionResult(PasswordChangesOrError result) {
diff --git a/chrome/browser/password_manager/chrome_password_change_service.cc b/chrome/browser/password_manager/chrome_password_change_service.cc
index 7b2892a..ccf97ca 100644
--- a/chrome/browser/password_manager/chrome_password_change_service.cc
+++ b/chrome/browser/password_manager/chrome_password_change_service.cc
@@ -83,8 +83,8 @@
PasswordChangeDelegate* delegate) {
delegate->RemoveObserver(this);
- auto iter = base::ranges::find(password_change_delegates_, delegate,
- &std::unique_ptr<PasswordChangeDelegate>::get);
+ auto iter = std::ranges::find(password_change_delegates_, delegate,
+ &std::unique_ptr<PasswordChangeDelegate>::get);
CHECK(iter != password_change_delegates_.end());
std::unique_ptr<PasswordChangeDelegate> deleted_delegate = std::move(*iter);
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 1da3ea2..f453735 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -1092,7 +1092,7 @@
EXPECT_EQ(url::Origin::Create(url).GetURL(),
GetClient()->GetLastCommittedOrigin().GetURL());
- auto* it = base::ranges::find_if(kSchemeTestCases, [](auto test_case) {
+ auto* it = std::ranges::find_if(kSchemeTestCases, [](auto test_case) {
return strcmp(test_case.scheme, GetParam()) == 0;
});
// If saving isn't allowed it shouldn't be due to the setting, so make
diff --git a/chrome/browser/password_manager/password_change_delegate_impl.cc b/chrome/browser/password_manager/password_change_delegate_impl.cc
index c9d3ab7..b324a70 100644
--- a/chrome/browser/password_manager/password_change_delegate_impl.cc
+++ b/chrome/browser/password_manager/password_change_delegate_impl.cc
@@ -125,9 +125,9 @@
std::u16string GeneratePassword(
const PasswordForm& form,
password_manager::PasswordGenerationFrameHelper* generation_helper) {
- auto iter = base::ranges::find(form.form_data.fields(),
- form.new_password_element_renderer_id,
- &autofill::FormFieldData::renderer_id);
+ auto iter = std::ranges::find(form.form_data.fields(),
+ form.new_password_element_renderer_id,
+ &autofill::FormFieldData::renderer_id);
CHECK(iter != form.form_data.fields().end());
return generation_helper->GeneratePassword(
diff --git a/chrome/browser/password_manager/password_manager_interactive_test_base.cc b/chrome/browser/password_manager/password_manager_interactive_test_base.cc
index 66fe3b10..b2f48b76 100644
--- a/chrome/browser/password_manager/password_manager_interactive_test_base.cc
+++ b/chrome/browser/password_manager/password_manager_interactive_test_base.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/password_manager/password_manager_interactive_test_base.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/strings/stringprintf.h"
#include "chrome/browser/password_manager/passwords_navigation_observer.h"
#include "content/public/test/browser_test_utils.h"
@@ -37,11 +38,11 @@
for (char16_t character : value) {
ui::DomKey dom_key = ui::DomKey::FromCharacter(character);
const ui::PrintableCodeEntry* code_entry =
- base::ranges::find_if(ui::kPrintableCodeMap,
- [character](const ui::PrintableCodeEntry& entry) {
- return entry.character[0] == character ||
- entry.character[1] == character;
- });
+ std::ranges::find_if(ui::kPrintableCodeMap,
+ [character](const ui::PrintableCodeEntry& entry) {
+ return entry.character[0] == character ||
+ entry.character[1] == character;
+ });
ASSERT_TRUE(code_entry != std::end(ui::kPrintableCodeMap));
bool shift = code_entry->character[1] == character;
ui::DomCode dom_code = code_entry->dom_code;
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index af3695f..f0aeff8 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -4,6 +4,7 @@
#include <stddef.h>
+#include <algorithm>
#include <string>
#include <tuple>
#include <variant>
@@ -17,7 +18,6 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -1145,7 +1145,7 @@
// picked up by the browser zoom, then zoom to the next zoom level. This
// ensures the test passes regardless of the initial default zoom level.
std::vector<double> preset_zoom_levels = zoom::PageZoom::PresetZoomLevels(0);
- auto it = base::ranges::find(preset_zoom_levels, 0);
+ auto it = std::ranges::find(preset_zoom_levels, 0);
ASSERT_NE(it, preset_zoom_levels.end());
it++;
ASSERT_NE(it, preset_zoom_levels.end());
diff --git a/chrome/browser/performance_manager/user_tuning/profile_discard_opt_out_list_helper.cc b/chrome/browser/performance_manager/user_tuning/profile_discard_opt_out_list_helper.cc
index e75815d..ddc07c4 100644
--- a/chrome/browser/performance_manager/user_tuning/profile_discard_opt_out_list_helper.cc
+++ b/chrome/browser/performance_manager/user_tuning/profile_discard_opt_out_list_helper.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/performance_manager/user_tuning/profile_discard_opt_out_list_helper.h"
+#include <algorithm>
#include <vector>
#include "base/feature_list.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/browser/performance_manager/policies/page_discarding_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -99,11 +99,11 @@
// Merge the two lists so that the PageDiscardingHelper only sees a single
// list of patterns to exclude from discarding.
- base::ranges::transform(
+ std::ranges::transform(
user_value_map.begin(), user_value_map.end(),
std::back_inserter(patterns),
[](const auto& user_value) { return user_value.first; });
- base::ranges::transform(
+ std::ranges::transform(
managed_value_list, std::back_inserter(patterns),
[](const auto& managed_value) { return managed_value.GetString(); });
diff --git a/chrome/browser/performance_manager/user_tuning/user_performance_tuning_notifier_unittest.cc b/chrome/browser/performance_manager/user_tuning/user_performance_tuning_notifier_unittest.cc
index bb6608d..e4136a4 100644
--- a/chrome/browser/performance_manager/user_tuning/user_performance_tuning_notifier_unittest.cc
+++ b/chrome/browser/performance_manager/user_tuning/user_performance_tuning_notifier_unittest.cc
@@ -10,7 +10,6 @@
#include <utility>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "components/performance_manager/graph/frame_node_impl.h"
#include "components/performance_manager/graph/page_node_impl.h"
diff --git a/chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.cc b/chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.cc
index 6b6a7a4a..7c1a362 100644
--- a/chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.cc
+++ b/chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.cc
@@ -174,9 +174,9 @@
void AutoPictureInPictureTabHelper::MediaSessionActionsChanged(
const std::vector<media_session::mojom::MediaSessionAction>& actions) {
is_enter_auto_picture_in_picture_available_ =
- base::ranges::find(actions,
- media_session::mojom::MediaSessionAction::
- kEnterAutoPictureInPicture) != actions.end();
+ std::ranges::find(actions,
+ media_session::mojom::MediaSessionAction::
+ kEnterAutoPictureInPicture) != actions.end();
if (is_enter_auto_picture_in_picture_available_) {
has_ever_registered_for_auto_picture_in_picture_ = true;
diff --git a/chrome/browser/policy/chrome_extension_policy_migrator.cc b/chrome/browser/policy/chrome_extension_policy_migrator.cc
index ba814a0..9110136 100644
--- a/chrome/browser/policy/chrome_extension_policy_migrator.cc
+++ b/chrome/browser/policy/chrome_extension_policy_migrator.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/policy/chrome_extension_policy_migrator.h"
+#include <algorithm>
+
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "components/strings/grit/components_strings.h"
#include "extensions/common/hashed_extension_id.h"
@@ -18,8 +19,8 @@
// HashedExtensionId gives an all-uppercase output, so make sure the input is
// all uppercase.
std::string hashed_extension_id_uppercase = hashed_extension_id;
- base::ranges::transform(hashed_extension_id_uppercase,
- hashed_extension_id_uppercase.begin(), ::toupper);
+ std::ranges::transform(hashed_extension_id_uppercase,
+ hashed_extension_id_uppercase.begin(), ::toupper);
// Look for an extension with this hash.
PolicyMap* extension_map = nullptr;
diff --git a/chrome/browser/policy/messaging_layer/util/test_request_payload.cc b/chrome/browser/policy/messaging_layer/util/test_request_payload.cc
index fdb749a..2ef42a17e0 100644
--- a/chrome/browser/policy/messaging_layer/util/test_request_payload.cc
+++ b/chrome/browser/policy/messaging_layer/util/test_request_payload.cc
@@ -6,11 +6,11 @@
#include "chrome/browser/policy/messaging_layer/util/test_request_payload.h"
+#include <algorithm>
#include <string>
#include <string_view>
#include "base/json/json_reader.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/browser/policy/messaging_layer/upload/encrypted_reporting_client.h"
#include "chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h"
@@ -232,7 +232,7 @@
*listener << "Request ID is empty.";
return false;
}
- if (!base::ranges::all_of(*request_id, base::IsHexDigit<char>)) {
+ if (!std::ranges::all_of(*request_id, base::IsHexDigit<char>)) {
*listener << "Request ID is not a hexadecimal number.";
return false;
}
diff --git a/chrome/browser/policy/profile_policy_connector.cc b/chrome/browser/policy/profile_policy_connector.cc
index 4c88766..819c8e6 100644
--- a/chrome/browser/policy/profile_policy_connector.cc
+++ b/chrome/browser/policy/profile_policy_connector.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/policy/profile_policy_connector.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
@@ -293,7 +293,7 @@
infobars::ContentInfoBarManager::CreateForWebContents(web_contents);
auto* infobar_manager =
infobars::ContentInfoBarManager::FromWebContents(web_contents);
- const auto it = base::ranges::find(
+ const auto it = std::ranges::find(
infobar_manager->infobars(),
infobars::InfoBarDelegate::LOCAL_TEST_POLICIES_APPLIED_INFOBAR,
&infobars::InfoBar::GetIdentifier);
diff --git a/chrome/browser/policy/test/restore_on_startup_policy_browsertest.cc b/chrome/browser/policy/test/restore_on_startup_policy_browsertest.cc
index 2099d5cc..7634c04 100644
--- a/chrome/browser/policy/test/restore_on_startup_policy_browsertest.cc
+++ b/chrome/browser/policy/test/restore_on_startup_policy_browsertest.cc
@@ -7,10 +7,10 @@
#pragma allow_unsafe_buffers
#endif
+#include <algorithm>
#include <vector>
#include "base/command_line.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
@@ -75,7 +75,7 @@
base::CommandLine::StringVector argv = command_line->argv();
std::erase_if(argv, IsNonSwitchArgument);
command_line->InitFromArgv(argv);
- ASSERT_TRUE(base::ranges::equal(argv, command_line->argv()));
+ ASSERT_TRUE(std::ranges::equal(argv, command_line->argv()));
}
void ListOfURLs() {
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index 8df8464..c66c94df 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -7,6 +7,7 @@
#include <math.h>
#include <stddef.h>
+#include <algorithm>
#include <queue>
#include "base/containers/contains.h"
@@ -14,7 +15,6 @@
#include "base/i18n/case_conversion.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
@@ -167,7 +167,7 @@
const std::u16string lower_user_text(base::i18n::ToLower(user_text));
// Merge this in to an existing match if we already saw |user_text|
- auto match_it = base::ranges::find(
+ auto match_it = std::ranges::find(
transitional_matches_, lower_user_text,
&AutocompleteActionPredictor::TransitionalMatch::user_text);
@@ -397,8 +397,8 @@
DCHECK(id_list);
for (auto it = db_cache_.begin(); it != db_cache_.end();) {
- if (base::ranges::any_of(rows,
- history::URLRow::URLRowHasURL(it->first.url))) {
+ if (std::ranges::any_of(rows,
+ history::URLRow::URLRowHasURL(it->first.url))) {
const DBIdCacheMap::iterator id_it = db_id_cache_.find(it->first);
DCHECK(id_it != db_id_cache_.end());
id_list->push_back(id_it->second);
diff --git a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
index 902f2c42..5076254d 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <array>
#include <string>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/containers/contains.h"
#include "base/memory/ref_counted.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -644,7 +644,7 @@
result.AppendMatches(matches);
std::u16string user_text = u"google";
predictor()->RegisterTransitionalMatches(user_text, result);
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
*transitional_matches(), user_text,
&AutocompleteActionPredictor::TransitionalMatch::user_text);
ASSERT_NE(it, transitional_matches()->end());
diff --git a/chrome/browser/predictors/loading_data_collector.cc b/chrome/browser/predictors/loading_data_collector.cc
index e1d16fc..8f30bcba 100644
--- a/chrome/browser/predictors/loading_data_collector.cc
+++ b/chrome/browser/predictors/loading_data_collector.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/predictors/loading_data_collector.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <string>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/predictors/loading_stats_collector.h"
#include "chrome/browser/predictors/predictors_features.h"
@@ -61,7 +61,7 @@
} else if (net::MatchesMimeType("text/css", mime_type)) {
return network::mojom::RequestDestination::kStyle;
} else {
- bool found = base::ranges::any_of(
+ bool found = std::ranges::any_of(
kFontMimeTypes, [&mime_type](const std::string& mime) {
return net::MatchesMimeType(mime, mime_type);
});
diff --git a/chrome/browser/predictors/loading_stats_collector.cc b/chrome/browser/predictors/loading_stats_collector.cc
index 1f5055a4..c6ec088 100644
--- a/chrome/browser/predictors/loading_stats_collector.cc
+++ b/chrome/browser/predictors/loading_stats_collector.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/predictors/loading_stats_collector.h"
+#include <algorithm>
#include <set>
#include <vector>
#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/predictors/loading_data_collector.h"
#include "chrome/browser/predictors/preconnect_manager.h"
@@ -63,7 +63,7 @@
const auto& actual_origins = summary.origins;
- size_t correctly_predicted_count = base::ranges::count_if(
+ size_t correctly_predicted_count = std::ranges::count_if(
prediction.requests, [&actual_origins](const PreconnectRequest& request) {
return actual_origins.find(request.origin) != actual_origins.end();
});
@@ -275,13 +275,13 @@
}
builder.SetOptimizationGuidePredictionOrigins(
std::min(ukm_cap, predicted_origins.size()));
- size_t correctly_predicted_origins = base::ranges::count_if(
+ size_t correctly_predicted_origins = std::ranges::count_if(
predicted_origins, [&summary](const url::Origin& subresource_origin) {
return base::Contains(summary.origins, subresource_origin);
});
builder.SetOptimizationGuidePredictionCorrectlyPredictedOrigins(
std::min(ukm_cap, correctly_predicted_origins));
- size_t correctly_predicted_low_priority_origins = base::ranges::count_if(
+ size_t correctly_predicted_low_priority_origins = std::ranges::count_if(
predicted_origins, [&summary](const url::Origin& subresource_origin) {
return base::Contains(summary.low_priority_origins,
subresource_origin) &&
@@ -298,7 +298,7 @@
std::min(ukm_cap, summary.preconnect_origins.size()));
const auto& actual_subresource_origins = summary.origins;
size_t correctly_predicted_subresource_origins_initiated =
- base::ranges::count_if(
+ std::ranges::count_if(
summary.preconnect_origins,
[&actual_subresource_origins](
const url::Origin& subresource_origin) {
@@ -314,7 +314,7 @@
std::min(ukm_cap, summary.prefetch_urls.size()));
const auto& actual_subresource_urls = summary.subresource_urls;
size_t correctly_predicted_subresource_prefetches_initiated =
- base::ranges::count_if(
+ std::ranges::count_if(
summary.prefetch_urls,
[&actual_subresource_urls](const GURL& subresource_url) {
return actual_subresource_urls.find(subresource_url) !=
diff --git a/chrome/browser/predictors/preconnect_manager_unittest.cc b/chrome/browser/predictors/preconnect_manager_unittest.cc
index d13ae820..8c5337e 100644
--- a/chrome/browser/predictors/preconnect_manager_unittest.cc
+++ b/chrome/browser/predictors/preconnect_manager_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/predictors/preconnect_manager.h"
+#include <algorithm>
#include <map>
#include <utility>
#include "base/format_macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
index 2f5fa6d..b19a6aa5 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
+#include <algorithm>
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
@@ -69,8 +69,7 @@
OriginData* data,
const std::string& main_frame_origin) {
auto* origins = data->mutable_origins();
- auto it =
- base::ranges::find(*origins, main_frame_origin, &OriginStat::origin);
+ auto it = std::ranges::find(*origins, main_frame_origin, &OriginStat::origin);
int iterator_offset = 0;
if (it != origins->end()) {
origins->SwapElements(0, it - origins->begin());
diff --git a/chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service_browsertest.cc b/chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
index 459bc4c3..e74b1a2 100644
--- a/chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
+++ b/chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service.h"
+#include <algorithm>
#include <optional>
#include "base/containers/contains.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
@@ -2835,7 +2835,7 @@
// 2 requests should be to the search terms directly, one for the prefetch
// and one for the subframe (that can't be served from the prefetch cache).
EXPECT_EQ(
- 2, base::ranges::count_if(requests, [search_terms](const auto& request) {
+ 2, std::ranges::count_if(requests, [search_terms](const auto& request) {
return request.relative_url.find(kLoadInSubframe) ==
std::string::npos &&
request.relative_url.find(search_terms) != std::string::npos;
@@ -2843,7 +2843,7 @@
// 1 request should specify to load content in a subframe but also contain
// the search terms.
EXPECT_EQ(
- 1, base::ranges::count_if(requests, [search_terms](const auto& request) {
+ 1, std::ranges::count_if(requests, [search_terms](const auto& request) {
return request.relative_url.find(kLoadInSubframe) !=
std::string::npos &&
request.relative_url.find(search_terms) != std::string::npos;
diff --git a/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc b/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc
index f81740b..1fe8639b 100644
--- a/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc
+++ b/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <string>
#include <string_view>
@@ -9,7 +10,6 @@
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
@@ -867,7 +867,7 @@
AutocompleteController* autocomplete_controller = GetAutocompleteController();
// Ensure there is a search hint.
- auto prerender_match = base::ranges::find_if(
+ auto prerender_match = std::ranges::find_if(
autocomplete_controller->result(), &BaseSearchProvider::ShouldPrerender);
ASSERT_NE(prerender_match, std::end(autocomplete_controller->result()));
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc
index 69e1b2b..e524d5d 100644
--- a/chrome/browser/printing/print_browsertest.cc
+++ b/chrome/browser/printing/print_browsertest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/printing/print_browsertest.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
@@ -21,7 +22,6 @@
#include "base/memory/raw_ptr_exclusion.h"
#include "base/notreached.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
@@ -803,7 +803,7 @@
private:
void AddSampleToBuckets(std::vector<base::Bucket>* buckets,
base::HistogramBase::Sample32 sample) {
- auto it = base::ranges::find(*buckets, sample, &base::Bucket::min);
+ auto it = std::ranges::find(*buckets, sample, &base::Bucket::min);
if (it == buckets->end()) {
buckets->push_back(base::Bucket(sample, 1));
} else {
diff --git a/chrome/browser/printing/web_api/web_printing_service_chromeos.cc b/chrome/browser/printing/web_api/web_printing_service_chromeos.cc
index fb35987..6ae23e3 100644
--- a/chrome/browser/printing/web_api/web_printing_service_chromeos.cc
+++ b/chrome/browser/printing/web_api/web_printing_service_chromeos.cc
@@ -64,7 +64,7 @@
}
const auto& papers = printer_attributes.papers;
// Validate that the requested paper is supported by the printer.
- if (!base::ranges::any_of(papers, [&](const auto& paper) {
+ if (!std::ranges::any_of(papers, [&](const auto& paper) {
return paper.IsSizeWithinBounds(media.size_microns);
})) {
return false;
@@ -164,7 +164,7 @@
for (const auto& reason : printer_status->reasons) {
printer_state_reasons.push_back(reason.reason);
}
- base::ranges::sort(printer_state_reasons);
+ std::ranges::sort(printer_state_reasons);
auto repeated = std::ranges::unique(printer_state_reasons);
printer_state_reasons.erase(repeated.begin(), repeated.end());
printer_attributes->printer_state_message = printer_status->message;
diff --git a/chrome/browser/printing/web_api/web_printing_utils.cc b/chrome/browser/printing/web_api/web_printing_utils.cc
index 8ecc40c2..63ba24e4 100644
--- a/chrome/browser/printing/web_api/web_printing_utils.cc
+++ b/chrome/browser/printing/web_api/web_printing_utils.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/printing/web_api/web_printing_utils.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "printing/backend/print_backend.h"
namespace printing::internal {
@@ -12,8 +13,8 @@
const AdvancedCapability* FindAdvancedCapability(
const PrinterSemanticCapsAndDefaults& caps,
std::string_view capability_name) {
- auto itr = base::ranges::find(caps.advanced_capabilities, capability_name,
- &AdvancedCapability::name);
+ auto itr = std::ranges::find(caps.advanced_capabilities, capability_name,
+ &AdvancedCapability::name);
if (itr != caps.advanced_capabilities.end()) {
return &*itr;
}
diff --git a/chrome/browser/privacy/secure_dns_bridge.cc b/chrome/browser/privacy/secure_dns_bridge.cc
index 1ae1fce..30db163 100644
--- a/chrome/browser/privacy/secure_dns_bridge.cc
+++ b/chrome/browser/privacy/secure_dns_bridge.cc
@@ -4,6 +4,7 @@
#include <jni.h>
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -15,7 +16,6 @@
#include "base/android/scoped_java_ref.h"
#include "base/check.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/browser_process.h"
@@ -105,7 +105,7 @@
net::DohProviderEntry::List providers = GetFilteredProviders();
std::vector<std::vector<std::u16string>> ret;
ret.reserve(providers.size());
- base::ranges::transform(
+ std::ranges::transform(
providers, std::back_inserter(ret),
[](const net::DohProviderEntry* entry) -> std::vector<std::u16string> {
net::DnsOverHttpsConfig config({entry->doh_server_config});
diff --git a/chrome/browser/privacy_budget/identifiability_study_group_settings.cc b/chrome/browser/privacy_budget/identifiability_study_group_settings.cc
index 6aa086a..78b2a68 100644
--- a/chrome/browser/privacy_budget/identifiability_study_group_settings.cc
+++ b/chrome/browser/privacy_budget/identifiability_study_group_settings.cc
@@ -8,7 +8,6 @@
#include <numeric>
#include "base/containers/flat_map.h"
-#include "base/ranges/algorithm.h"
#include "chrome/common/privacy_budget/privacy_budget_features.h"
#include "chrome/common/privacy_budget/types.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
diff --git a/chrome/browser/privacy_budget/identifiability_study_state.cc b/chrome/browser/privacy_budget/identifiability_study_state.cc
index 2c8c0a1..1951b10 100644
--- a/chrome/browser/privacy_budget/identifiability_study_state.cc
+++ b/chrome/browser/privacy_budget/identifiability_study_state.cc
@@ -22,7 +22,6 @@
#include "base/dcheck_is_on.h"
#include "base/metrics/field_trial_params.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/version_info/channel.h"
#include "chrome/browser/privacy_budget/identifiability_study_group_settings.h"
#include "chrome/browser/privacy_budget/privacy_budget_prefs.h"
@@ -314,16 +313,15 @@
// identifiability_study_state.h.
// active_surfaces_
- DCHECK(
- base::ranges::all_of(active_surfaces_, IsRepresentativeSurfaceAllowed));
- DCHECK(base::ranges::all_of(selected_offsets_, [this](auto offset) {
+ DCHECK(std::ranges::all_of(active_surfaces_, IsRepresentativeSurfaceAllowed));
+ DCHECK(std::ranges::all_of(selected_offsets_, [this](auto offset) {
return offset >= seen_surfaces_.size() ||
active_surfaces_.contains(seen_surfaces_[offset]);
}));
DCHECK_LE(active_surfaces_.Cost(), active_surface_budget_);
// seen_surfaces_
- DCHECK(base::ranges::all_of(seen_surfaces_, IsSurfaceAllowed));
+ DCHECK(std::ranges::all_of(seen_surfaces_, IsSurfaceAllowed));
DCHECK_LE(seen_surfaces_.size(),
static_cast<size_t>(kMaxSelectedSurfaceOffset + 1));
// ^^^
@@ -336,14 +334,14 @@
EncodeIdentifiabilityFieldTrialParam(seen_surfaces_.AsList()));
// selected_offsets_
- DCHECK(base::ranges::all_of(selected_offsets_,
- &IdentifiabilityStudyState::IsValidOffset));
+ DCHECK(std::ranges::all_of(selected_offsets_,
+ &IdentifiabilityStudyState::IsValidOffset));
// active_offset_count_
- DCHECK_EQ(base::ranges::count_if(selected_offsets_,
- [this](OffsetType offset) {
- return offset < seen_surfaces_.size();
- }),
+ DCHECK_EQ(std::ranges::count_if(selected_offsets_,
+ [this](OffsetType offset) {
+ return offset < seen_surfaces_.size();
+ }),
active_offset_count_);
}
#else // EXPENSIVE_DCHECKS_ARE_ON()
@@ -489,8 +487,8 @@
IdentifiabilityStudyState::AdjustForDroppedOffsets(
std::vector<OffsetType> dropped_offsets,
std::vector<OffsetType> offsets) {
- DCHECK(base::ranges::is_sorted(dropped_offsets));
- DCHECK(base::ranges::is_sorted(offsets));
+ DCHECK(std::ranges::is_sorted(dropped_offsets));
+ DCHECK(std::ranges::is_sorted(offsets));
if (offsets.empty() || dropped_offsets.empty())
return offsets;
@@ -588,8 +586,8 @@
// the generation has remained the same while blocked surfaces and types may
// have changed.
- if (!base::ranges::all_of(selected_offsets_,
- &IdentifiabilityStudyState::IsValidOffset)) {
+ if (!std::ranges::all_of(selected_offsets_,
+ &IdentifiabilityStudyState::IsValidOffset)) {
ResetPersistedState();
return;
}
diff --git a/chrome/browser/privacy_budget/surface_set_equivalence.cc b/chrome/browser/privacy_budget/surface_set_equivalence.cc
index b18a4ff..d72dd1d7 100644
--- a/chrome/browser/privacy_budget/surface_set_equivalence.cc
+++ b/chrome/browser/privacy_budget/surface_set_equivalence.cc
@@ -92,6 +92,6 @@
bool SurfaceSetEquivalence::IsRepresentative(
const IdentifiableSurfaceSet& source) const {
- return base::ranges::all_of(source,
- [this](auto s) { return IsRepresentative(s); });
+ return std::ranges::all_of(source,
+ [this](auto s) { return IsRepresentative(s); });
}
diff --git a/chrome/browser/privacy_budget/surface_set_valuation.cc b/chrome/browser/privacy_budget/surface_set_valuation.cc
index f784a13..147d588 100644
--- a/chrome/browser/privacy_budget/surface_set_valuation.cc
+++ b/chrome/browser/privacy_budget/surface_set_valuation.cc
@@ -14,7 +14,6 @@
#include "base/containers/contains.h"
#include "base/numerics/safe_conversions.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "chrome/browser/privacy_budget/representative_surface_set.h"
#include "chrome/browser/privacy_budget/surface_set_equivalence.h"
diff --git a/chrome/browser/privacy_budget/surface_set_with_valuation.cc b/chrome/browser/privacy_budget/surface_set_with_valuation.cc
index 089a1626..1ce7266 100644
--- a/chrome/browser/privacy_budget/surface_set_with_valuation.cc
+++ b/chrome/browser/privacy_budget/surface_set_with_valuation.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/privacy_budget/surface_set_with_valuation.h"
+#include <algorithm>
#include <type_traits>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
static_assert(std::is_same<RepresentativeSurface,
@@ -59,7 +59,7 @@
// drop elements until we meet the budget's restrictions.
auto container = std::move(surfaces_).extract();
base::RandomBitGenerator g;
- base::ranges::shuffle(container, g);
+ std::ranges::shuffle(container, g);
auto new_beginning = container.begin();
for (; new_beginning != container.end() && cost_ > budget;
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
index 320a003..fa46653 100644
--- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
+++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
@@ -14,7 +14,6 @@
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
diff --git a/chrome/browser/profiles/android/profile_manager_utils.cc b/chrome/browser/profiles/android/profile_manager_utils.cc
index 5ddab3a0..a8692fbe 100644
--- a/chrome/browser/profiles/android/profile_manager_utils.cc
+++ b/chrome/browser/profiles/android/profile_manager_utils.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <vector>
#include "base/android/jni_android.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -50,7 +50,7 @@
static void JNI_ProfileManagerUtils_FlushPersistentDataForAllProfiles(
JNIEnv* env) {
- base::ranges::for_each(
+ std::ranges::for_each(
g_browser_process->profile_manager()->GetLoadedProfiles(),
CommitPendingWritesForProfile);
@@ -60,7 +60,7 @@
static void JNI_ProfileManagerUtils_RemoveSessionCookiesForAllProfiles(
JNIEnv* env) {
- base::ranges::for_each(
+ std::ranges::for_each(
g_browser_process->profile_manager()->GetLoadedProfiles(),
RemoveSessionCookiesForProfile);
}
diff --git a/chrome/browser/profiles/incognito_profile_containment_browsertest.cc b/chrome/browser/profiles/incognito_profile_containment_browsertest.cc
index 4e6641f..e33c3b68 100644
--- a/chrome/browser/profiles/incognito_profile_containment_browsertest.cc
+++ b/chrome/browser/profiles/incognito_profile_containment_browsertest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
@@ -9,7 +11,6 @@
#include "base/hash/hash.h"
#include "base/logging.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
@@ -165,15 +166,15 @@
if (!base::Contains(snapshot_before.directories, directory)) {
// If a file/prefix in this directory is allowlisted, ignore directory
// addition.
- if (base::ranges::any_of(allow_list,
- [&directory](const std::string& prefix) {
- return prefix.find(directory) == 0;
- })) {
+ if (std::ranges::any_of(allow_list,
+ [&directory](const std::string& prefix) {
+ return prefix.find(directory) == 0;
+ })) {
continue;
}
// If directory is specifically allow list, ignore.
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
kAllowListEmptyDirectoryPrefixesForAllPlatforms,
[&directory](const std::string& allow_listed_directory) {
return directory.find(allow_listed_directory) == 0;
@@ -203,7 +204,7 @@
if (is_new ||
fd.second.last_modified_time != before->second.last_modified_time) {
// Ignore allow-listed paths.
- if (base::ranges::any_of(allow_list, [&fd](const std::string& prefix) {
+ if (std::ranges::any_of(allow_list, [&fd](const std::string& prefix) {
return fd.first.find(prefix) == 0;
})) {
continue;
diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc
index 1f502660..affb7b6 100644
--- a/chrome/browser/profiles/profile_attributes_storage.cc
+++ b/chrome/browser/profiles/profile_attributes_storage.cc
@@ -22,7 +22,6 @@
#include "base/memory/ref_counted_memory.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
@@ -195,7 +194,7 @@
return MultiProfileUserType::kSingleProfile;
int active_count =
- base::ranges::count_if(entries, &ProfileMetrics::IsProfileActive);
+ std::ranges::count_if(entries, &ProfileMetrics::IsProfileActive);
if (active_count <= 1)
return MultiProfileUserType::kLatentMultiProfile;
@@ -665,7 +664,7 @@
std::vector<ProfileAttributesEntry*> entries =
const_cast<ProfileAttributesStorage*>(this)->GetAllProfilesAttributes();
- if (base::ranges::none_of(entries, [name](ProfileAttributesEntry* entry) {
+ if (std::ranges::none_of(entries, [name](ProfileAttributesEntry* entry) {
return entry->GetLocalProfileName() == name ||
entry->GetName() == name;
})) {
diff --git a/chrome/browser/profiles/profile_keyed_service_browsertest.cc b/chrome/browser/profiles/profile_keyed_service_browsertest.cc
index 4e25caf5..55d80b9 100644
--- a/chrome/browser/profiles/profile_keyed_service_browsertest.cc
+++ b/chrome/browser/profiles/profile_keyed_service_browsertest.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <sstream>
#include "base/containers/to_vector.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/router/media_router_feature.h"
@@ -85,7 +85,7 @@
std::string GetDifferenceString(const std::set<std::string>& set1,
const std::set<std::string>& set2) {
std::vector<std::string> differences;
- base::ranges::set_difference(set1, set2, std::back_inserter(differences));
+ std::ranges::set_difference(set1, set2, std::back_inserter(differences));
return differences.empty() ? "None" : base::JoinString(differences, ", ");
}
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index ac10a38..202b8fd7 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <cstddef>
#include <map>
#include <memory>
@@ -31,7 +32,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -2093,7 +2093,7 @@
DCHECK(profile);
if (!profile->IsOffTheRecord() && !browser->is_type_app() &&
--browser_counts_[profile] == 0) {
- active_profiles_.erase(base::ranges::find(active_profiles_, profile));
+ active_profiles_.erase(std::ranges::find(active_profiles_, profile));
if (!closing_all_browsers_)
SaveActiveProfiles();
}
diff --git a/chrome/browser/profiles/profile_manager_browsertest.cc b/chrome/browser/profiles/profile_manager_browsertest.cc
index 8541aa1..f9daa8f 100644
--- a/chrome/browser/profiles/profile_manager_browsertest.cc
+++ b/chrome/browser/profiles/profile_manager_browsertest.cc
@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/profiles/profile_manager.h"
+
#include <stddef.h>
+
+#include <algorithm>
#include <string>
#include "base/command_line.h"
@@ -12,7 +16,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
@@ -28,7 +31,6 @@
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
-#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "chrome/browser/profiles/profile_window.h"
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index ef41585a..a89e691d 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -7,6 +7,7 @@
#include <shlobj.h> // For SHChangeNotify().
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <string>
@@ -21,7 +22,6 @@
#include "base/logging.h"
#include "base/memory/raw_ref.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -352,7 +352,7 @@
if (!profile_shortcuts->empty()) {
// From all profile_shortcuts choose the one with a known (canonical) name.
profiles::internal::ShortcutFilenameMatcher matcher(old_profile_name);
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
*profile_shortcuts, [&matcher](const base::FilePath& p) {
return matcher.IsCanonical(p.BaseName().value());
});
@@ -478,8 +478,8 @@
// Do not call ListUserDesktopContents again (but with filter) to avoid
// excess work inside it. Just reuse non-filtered desktop_contents.
// We need both of them (desktop_contents and shortcuts) later.
- base::ranges::copy_if(desktop_contents,
- std::inserter(shortcuts, shortcuts.begin()), filter);
+ std::ranges::copy_if(desktop_contents,
+ std::inserter(shortcuts, shortcuts.begin()), filter);
if (params.old_profile_name != params.profile_name || params.single_profile) {
RenameChromeDesktopShortcutForProfile(
@@ -719,7 +719,7 @@
const std::u16string& profile_name,
const std::set<base::FilePath>& excludes) {
std::set<std::wstring> excludes_names;
- base::ranges::transform(
+ std::ranges::transform(
excludes, std::inserter(excludes_names, excludes_names.begin()),
[](const base::FilePath& e) { return e.BaseName().value(); });
diff --git a/chrome/browser/profiles/profile_statistics_browsertest.cc b/chrome/browser/profiles/profile_statistics_browsertest.cc
index b26acaf..5e959b2 100644
--- a/chrome/browser/profiles/profile_statistics_browsertest.cc
+++ b/chrome/browser/profiles/profile_statistics_browsertest.cc
@@ -2,21 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/profiles/profile_statistics.h"
+
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "chrome/browser/password_manager/profile_password_store_factory.h"
-#include "chrome/browser/profiles/profile_statistics.h"
#include "chrome/browser/profiles/profile_statistics_aggregator.h"
#include "chrome/browser/profiles/profile_statistics_common.h"
#include "chrome/browser/profiles/profile_statistics_factory.h"
@@ -72,8 +73,8 @@
const char* expected_expression,
const profiles::ProfileCategoryStats& actual_value,
const profiles::ProfileCategoryStats& expected_value) {
- if (base::ranges::is_permutation(actual_value, expected_value,
- IsProfileCategoryStatEqual)) {
+ if (std::ranges::is_permutation(actual_value, expected_value,
+ IsProfileCategoryStatEqual)) {
return ::testing::AssertionSuccess();
} else {
::testing::AssertionResult result = testing::AssertionFailure();
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index 84333394..26547258e 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -226,13 +226,12 @@
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
// If there are any supervised profiles, disable guest mode.
- if (base::ranges::any_of(g_browser_process->profile_manager()
- ->GetProfileAttributesStorage()
- .GetAllProfilesAttributes(),
- [](const ProfileAttributesEntry* entry) {
- return entry->IsSupervised() &&
- !entry->IsOmitted();
- })) {
+ if (std::ranges::any_of(g_browser_process->profile_manager()
+ ->GetProfileAttributesStorage()
+ .GetAllProfilesAttributes(),
+ [](const ProfileAttributesEntry* entry) {
+ return entry->IsSupervised() && !entry->IsOmitted();
+ })) {
return false;
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc b/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc
index d525d090..cf512ce 100644
--- a/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc
+++ b/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <optional>
#include <string_view>
@@ -10,7 +11,6 @@
#include "base/metrics/histogram_base.h"
#include "base/metrics/statistics_recorder.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/task/thread_pool/thread_pool_instance.h"
@@ -262,7 +262,7 @@
std::string GetResponseContentLanguage(
const std::string& accept_language,
const std::vector<std::string>& avail_languages) {
- auto iter = base::ranges::find(avail_languages, accept_language);
+ auto iter = std::ranges::find(avail_languages, accept_language);
return iter != avail_languages.end() ? *iter : avail_languages[0];
}
diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
index b1876ae..ebabd53 100644
--- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h"
+#include <algorithm>
#include <vector>
-#include "base/ranges/algorithm.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
@@ -190,7 +190,7 @@
void MockRenderViewContextMenu::RemoveAdjacentSeparators() {}
void MockRenderViewContextMenu::RemoveSeparatorBeforeMenuItem(int command_id) {
- auto iter = base::ranges::find(items_, command_id, &MockMenuItem::command_id);
+ auto iter = std::ranges::find(items_, command_id, &MockMenuItem::command_id);
if (iter == items_.end()) {
FAIL() << "Menu observer is trying to remove a separator before a "
diff --git a/chrome/browser/resources_integrity.cc b/chrome/browser/resources_integrity.cc
index 300a850..357bf603 100644
--- a/chrome/browser/resources_integrity.cc
+++ b/chrome/browser/resources_integrity.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/resources_integrity.h"
+#include <algorithm>
#include <array>
#include "base/files/file.h"
@@ -16,7 +17,6 @@
#include "base/memory/page_size.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
@@ -60,7 +60,7 @@
std::array<uint8_t, crypto::kSHA256Length> digest;
hash->Finish(digest);
- return base::ranges::equal(digest, expected_signature);
+ return std::ranges::equal(digest, expected_signature);
}
void ReportPakIntegrity(const std::string& histogram_name, bool hash_matches) {
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
index f8fa83b..a7a9ea0 100644
--- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc
+++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
+#include <algorithm>
#include <memory>
#include <string>
@@ -15,7 +16,6 @@
#include "base/metrics/user_metrics_action.h"
#include "base/observer_list.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -1660,8 +1660,8 @@
std::vector<CoreAccountInfo> signed_in_accounts =
identity_manager->GetAccountsWithRefreshTokens();
- auto account_iterator = base::ranges::find_if(
- signed_in_accounts, [username](const auto& account) {
+ auto account_iterator =
+ std::ranges::find_if(signed_in_accounts, [username](const auto& account) {
return password_manager::AreUsernamesSame(
account.email,
/*is_username1_gaia_account=*/true, username,
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc
index bdf3b68d..7cbb639 100644
--- a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc
+++ b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
+#include <algorithm>
+
#include "base/command_line.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
@@ -150,7 +151,7 @@
void BinaryUploadService::Request::clear_dlp_scan_request() {
auto* tags = content_analysis_request_.mutable_tags();
- auto it = base::ranges::find(*tags, "dlp");
+ auto it = std::ranges::find(*tags, "dlp");
if (it != tags->end())
tags->erase(it);
}
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/cloud_binary_upload_service.cc b/chrome/browser/safe_browsing/cloud_content_scanning/cloud_binary_upload_service.cc
index 75e274c..e773855 100644
--- a/chrome/browser/safe_browsing/cloud_content_scanning/cloud_binary_upload_service.cc
+++ b/chrome/browser/safe_browsing/cloud_content_scanning/cloud_binary_upload_service.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/safe_browsing/cloud_content_scanning/cloud_binary_upload_service.h"
+#include <algorithm>
+
#include "base/base64.h"
#include "base/command_line.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_features.h"
#include "chrome/browser/enterprise/connectors/common.h"
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc
index a2336eb9..5a7e94c 100644
--- a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc
+++ b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
+#include <algorithm>
+
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "chrome/browser/enterprise/connectors/common.h"
@@ -158,7 +159,7 @@
BinaryUploadService::Result result,
const enterprise_connectors::ContentAnalysisResponse& response,
EventResult event_result) {
- DCHECK(base::ranges::all_of(download_digest_sha256, base::IsHexDigit<char>));
+ DCHECK(std::ranges::all_of(download_digest_sha256, base::IsHexDigit<char>));
auto* router =
extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(profile);
if (!router)
@@ -212,7 +213,7 @@
const int64_t content_size,
const enterprise_connectors::ContentAnalysisResponse& response,
std::optional<std::u16string> user_justification) {
- DCHECK(base::ranges::all_of(download_digest_sha256, base::IsHexDigit<char>));
+ DCHECK(std::ranges::all_of(download_digest_sha256, base::IsHexDigit<char>));
auto* router =
extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(profile);
if (!router)
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.cc b/chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.cc
index ca07f23..04b411462 100644
--- a/chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.cc
+++ b/chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h"
+#include <algorithm>
#include <string_view>
#include "base/containers/span.h"
#include "base/feature_list.h"
#include "base/files/memory_mapped_file.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/file_util_service.h"
@@ -242,7 +242,7 @@
? result_and_data.second.mime_type
: cached_data_.mime_type;
base::FilePath::StringType ext(file_name_.FinalExtension());
- base::ranges::transform(ext, ext.begin(), tolower);
+ std::ranges::transform(ext, ext.begin(), tolower);
if (IsZipFile(ext, mime_type)) {
zip_analyzer_ = SandboxedZipAnalyzer::CreateAnalyzer(
path_,
diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc
index a6bfbe66..bc64aa5 100644
--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc
+++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc
@@ -4,13 +4,14 @@
#include "chrome/browser/safe_browsing/download_protection/check_client_download_request_base.h"
+#include <algorithm>
+
#include "base/cancelable_callback.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "chrome/browser/browser_process.h"
@@ -335,7 +336,7 @@
ClientDownloadRequest::SEVEN_ZIP_COMPRESSED_EXECUTABLE) &&
client_download_request_->archive_summary().parser_status() ==
ClientDownloadRequest::ArchiveSummary::VALID &&
- base::ranges::all_of(
+ std::ranges::all_of(
client_download_request_->archived_binary(),
[](const ClientDownloadRequest::ArchivedBinary& archived_binary) {
return !archived_binary.is_executable() &&
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_util.cc b/chrome/browser/safe_browsing/download_protection/download_protection_util.cc
index da66902..4f5b1c6 100644
--- a/chrome/browser/safe_browsing/download_protection/download_protection_util.cc
+++ b/chrome/browser/safe_browsing/download_protection/download_protection_util.cc
@@ -63,7 +63,7 @@
std::vector<ClientDownloadRequest::ArchivedBinary>* considering,
google::protobuf::RepeatedPtrField<ClientDownloadRequest::ArchivedBinary>*
selected) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
*considering, &ClientDownloadRequest::ArchivedBinary::is_encrypted);
if (it != considering->end()) {
*selected->Add() = *it;
@@ -75,7 +75,7 @@
std::vector<ClientDownloadRequest::ArchivedBinary>* considering,
google::protobuf::RepeatedPtrField<ClientDownloadRequest::ArchivedBinary>*
selected) {
- auto it = base::ranges::max_element(*considering, {}, &ArchiveEntryDepth);
+ auto it = std::ranges::max_element(*considering, {}, &ArchiveEntryDepth);
if (it != considering->end()) {
*selected->Add() = *it;
considering->erase(it);
@@ -86,7 +86,7 @@
std::vector<ClientDownloadRequest::ArchivedBinary>* considering,
google::protobuf::RepeatedPtrField<ClientDownloadRequest::ArchivedBinary>*
selected) {
- int remaining_executables = base::ranges::count_if(
+ int remaining_executables = std::ranges::count_if(
*considering, &ClientDownloadRequest::ArchivedBinary::is_executable);
for (auto it = considering->begin(); it != considering->end(); ++it) {
if (it->is_executable()) {
diff --git a/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_browsertest.cc b/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_browsertest.cc
index a7111dbd..a07f0bc 100644
--- a/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_browsertest.cc
@@ -805,7 +805,7 @@
// Verify the contents of telemetry report generated.
std::unique_ptr<TelemetryReport> telemetry_report_pb = GetTelemetryReport();
ASSERT_NE(telemetry_report_pb, nullptr);
- auto extension_report = base::ranges::find_if(
+ auto extension_report = std::ranges::find_if(
telemetry_report_pb->reports(), [&](const auto& report) {
return report.extension().id() == extension->id();
});
@@ -908,7 +908,7 @@
// Verify the contents of telemetry report generated.
std::unique_ptr<TelemetryReport> telemetry_report_pb = GetTelemetryReport();
ASSERT_NE(telemetry_report_pb, nullptr);
- auto extension_report = base::ranges::find_if(
+ auto extension_report = std::ranges::find_if(
telemetry_report_pb->reports(), [&](const auto& report) {
return report.extension().id() == extension->id();
});
diff --git a/chrome/browser/safe_browsing/generated_safe_browsing_pref_unittest.cc b/chrome/browser/safe_browsing/generated_safe_browsing_pref_unittest.cc
index dde5379c..52b3384a 100644
--- a/chrome/browser/safe_browsing/generated_safe_browsing_pref_unittest.cc
+++ b/chrome/browser/safe_browsing/generated_safe_browsing_pref_unittest.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/safe_browsing/generated_safe_browsing_pref.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/extensions/api/settings_private/generated_pref_test_base.h"
#include "chrome/test/base/testing_profile.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
@@ -208,8 +209,8 @@
}
}
- EXPECT_TRUE(base::ranges::equal(pref_user_selectable_values,
- test_case.expected_user_selectable_values));
+ EXPECT_TRUE(std::ranges::equal(pref_user_selectable_values,
+ test_case.expected_user_selectable_values));
}
} // namespace
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
index c0bee20..d81e544 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
@@ -7,6 +7,7 @@
#include <math.h>
#include <stddef.h>
+#include <algorithm>
#include <array>
#include <memory>
#include <string>
@@ -18,7 +19,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/process/process.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_traits.h"
@@ -953,8 +953,8 @@
// The upload is no longer outstanding, so take ownership of the context (from
// the collection of outstanding uploads) in this scope.
- auto it = base::ranges::find(uploads_, context,
- &std::unique_ptr<UploadContext>::get);
+ auto it = std::ranges::find(uploads_, context,
+ &std::unique_ptr<UploadContext>::get);
CHECK(it != uploads_.end(), base::NotFatalUntil::M130);
std::unique_ptr<UploadContext> upload(std::move(*it));
uploads_.erase(it);
diff --git a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
index 75b2413..61a8fc9c 100644
--- a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
@@ -23,7 +23,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_span.h"
#include "base/native_library.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_native_library.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/pe_image.h"
@@ -46,8 +45,8 @@
: modification_region_(address) {
uint8_t modification[ModificationLength];
- base::ranges::transform(modification_region_, std::begin(modification),
- [](uint8_t byte) { return byte + 1U; });
+ std::ranges::transform(modification_region_, std::begin(modification),
+ [](uint8_t byte) { return byte + 1U; });
SIZE_T bytes_written = 0;
EXPECT_NE(
0, WriteProcessMemory(GetCurrentProcess(),
@@ -63,8 +62,8 @@
~ScopedModuleModifier() {
uint8_t modification[ModificationLength];
- base::ranges::transform(modification_region_, std::begin(modification),
- [](uint8_t byte) { return byte - 1U; });
+ std::ranges::transform(modification_region_, std::begin(modification),
+ [](uint8_t byte) { return byte - 1U; });
SIZE_T bytes_written = 0;
EXPECT_NE(
0, WriteProcessMemory(GetCurrentProcess(),
diff --git a/chrome/browser/safe_browsing/url_checker_delegate_impl.cc b/chrome/browser/safe_browsing/url_checker_delegate_impl.cc
index 3700aa92..83cf454 100644
--- a/chrome/browser/safe_browsing/url_checker_delegate_impl.cc
+++ b/chrome/browser/safe_browsing/url_checker_delegate_impl.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/safe_browsing/url_checker_delegate_impl.h"
+#include <algorithm>
+
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"
@@ -148,10 +149,10 @@
bool originated_from_service_worker) {
// Check for whether the URL matches the Safe Browsing allowlist domains
// (a.k. a prefs::kSafeBrowsingAllowlistDomains).
- return base::ranges::any_of(allowlist_domains_,
- [&original_url](const std::string& domain) {
- return original_url.DomainIs(domain);
- });
+ return std::ranges::any_of(allowlist_domains_,
+ [&original_url](const std::string& domain) {
+ return original_url.DomainIs(domain);
+ });
}
void UrlCheckerDelegateImpl::NotifySuspiciousSiteDetected(
diff --git a/chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc b/chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc
index 2cfa1eae..19ea5c2 100644
--- a/chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc
+++ b/chrome/browser/send_tab_to_self/receiving_ui_handler_registry.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/send_tab_to_self/receiving_ui_handler_registry.h"
+#include <algorithm>
#include <vector>
#include "base/memory/singleton.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/send_tab_to_self/receiving_ui_handler.h"
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 23f2905b..428738e2 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -28,7 +28,6 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/task/single_thread_task_runner.h"
@@ -539,7 +538,7 @@
// Copy windows into windows_ so that we can combine both app and browser
// windows together before doing a one-pass restore.
- base::ranges::move(windows, std::back_inserter(windows_));
+ std::ranges::move(windows, std::back_inserter(windows_));
SessionRestore::OnGotSession(profile(), for_apps, windows.size());
windows.clear();
diff --git a/chrome/browser/share/default_ranking_android.cc b/chrome/browser/share/default_ranking_android.cc
index 890c366..8b0e047f 100644
--- a/chrome/browser/share/default_ranking_android.cc
+++ b/chrome/browser/share/default_ranking_android.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/share/default_ranking.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/strings/string_util.h"
namespace sharing {
@@ -484,8 +485,8 @@
std::vector<std::string> FlattenComponents(
const std::vector<ComponentName>& cs) {
std::vector<std::string> result;
- base::ranges::transform(cs, std::back_inserter(result),
- &ComponentName::Flatten);
+ std::ranges::transform(cs, std::back_inserter(result),
+ &ComponentName::Flatten);
return result;
}
diff --git a/chrome/browser/share/share_ranking.cc b/chrome/browser/share/share_ranking.cc
index 7c9d04c..462c46a 100644
--- a/chrome/browser/share/share_ranking.cc
+++ b/chrome/browser/share/share_ranking.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/share/share_ranking.h"
+#include <algorithm>
#include <vector>
#include "base/containers/to_vector.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
@@ -99,8 +99,8 @@
void SwapRankingElement(std::vector<std::string>& ranking,
const std::string& from,
const std::string& to) {
- auto from_loc = base::ranges::find(ranking, from);
- auto to_loc = base::ranges::find(ranking, to);
+ auto from_loc = std::ranges::find(ranking, from);
+ auto to_loc = std::ranges::find(ranking, to);
CHECK(from_loc != ranking.end());
CHECK(to_loc != ranking.end());
@@ -113,7 +113,7 @@
const std::vector<std::string>& ranking,
const std::vector<std::string>& available) {
std::vector<std::string> result;
- base::ranges::transform(
+ std::ranges::transform(
ranking, std::back_inserter(result), [&](const std::string& e) {
return RankingContains(available, e) ? e : std::string();
});
diff --git a/chrome/browser/sharesheet/sharesheet_service.cc b/chrome/browser/sharesheet/sharesheet_service.cc
index ca333bf..dc5cb7a 100644
--- a/chrome/browser/sharesheet/sharesheet_service.cc
+++ b/chrome/browser/sharesheet/sharesheet_service.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/sharesheet/sharesheet_service.h"
+#include <algorithm>
#include <optional>
#include <utility>
#include "base/functional/bind.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@@ -48,7 +48,7 @@
}
bool HasHostedDocument(const apps::Intent& intent) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
intent.files, [](const apps::IntentFilePtr& file) {
return drive::util::HasHostedDocumentExtension(
base::FilePath(file->url.ExtractFileName()));
@@ -386,7 +386,7 @@
const std::u16string selected_app = GetSelectedApp();
if (!selected_app.empty()) {
SharesheetResult result = SharesheetResult::kCancel;
- if (base::ranges::any_of(targets, [selected_app](const auto& target) {
+ if (std::ranges::any_of(targets, [selected_app](const auto& target) {
return (target.type == TargetType::kArcApp ||
target.type == TargetType::kWebApp) &&
target.launch_name == selected_app;
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_utils.cc b/chrome/browser/sharing/click_to_call/click_to_call_utils.cc
index c8d9368d..f6199d1 100644
--- a/chrome/browser/sharing/click_to_call/click_to_call_utils.cc
+++ b/chrome/browser/sharing/click_to_call/click_to_call_utils.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/sharing/click_to_call/click_to_call_utils.h"
+#include <algorithm>
#include <optional>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -97,7 +97,7 @@
// See https://en.cppreference.com/w/cpp/string/byte/isdigit for why this uses
// unsigned char.
- int digits = base::ranges::count_if(
+ int digits = std::ranges::count_if(
selection_text, [](unsigned char c) { return absl::ascii_isdigit(c); });
if (digits > kSelectionTextMaxDigits)
return std::nullopt;
@@ -114,7 +114,7 @@
std::string unescaped = GetUnescapedURLContent(url);
// We don't allow any number that contains any of these characters as they
// might be used to create USSD codes.
- return !unescaped.empty() && base::ranges::none_of(unescaped, [](char c) {
+ return !unescaped.empty() && std::ranges::none_of(unescaped, [](char c) {
return c == '#' || c == '*' || c == '%';
});
}
diff --git a/chrome/browser/shortcuts/platform_util_mac.mm b/chrome/browser/shortcuts/platform_util_mac.mm
index 1675530..bdb6711 100644
--- a/chrome/browser/shortcuts/platform_util_mac.mm
+++ b/chrome/browser/shortcuts/platform_util_mac.mm
@@ -6,12 +6,13 @@
#import <AppKit/AppKit.h>
+#include <algorithm>
+
#import "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/safe_base_name.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/task/bind_post_task.h"
#include "base/task/lazy_thread_pool_task_runner.h"
#include "base/task/sequenced_task_runner.h"
@@ -75,7 +76,7 @@
std::string name = title.substr(first_non_dot);
// Finder will display ':' as '/', so replace all '/' instances with ':'.
- base::ranges::replace(name, '/', ':');
+ std::ranges::replace(name, '/', ':');
return base::SafeBaseName::Create(name);
}
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller.cc b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller.cc
index 145758fec..bfd77d3 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller.cc
@@ -42,10 +42,10 @@
base::Time BoundSessionCookieController::min_cookie_expiration_time() const {
CHECK(!bound_cookies_info_.empty());
- return base::ranges::min_element(bound_cookies_info_, {},
- [](const auto& bound_cookie_info) {
- return bound_cookie_info.second;
- })
+ return std::ranges::min_element(bound_cookies_info_, {},
+ [](const auto& bound_cookie_info) {
+ return bound_cookie_info.second;
+ })
->second;
}
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
index db0560d..322ee887 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <variant>
@@ -13,7 +14,6 @@
#include "base/functional/overloaded.h"
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chrome/browser/signin/bound_session_credentials/bound_session_cookie_observer.h"
@@ -107,7 +107,7 @@
return;
}
- auto counter_it = base::ranges::find_if(
+ auto counter_it = std::ranges::find_if(
*info.mutable_errors_since_last_rotation(),
[&failure_type](const RotationDebugInfo::FailureCounter& counter) {
return counter.type() == failure_type.value();
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_observer.cc b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_observer.cc
index 984518c..bacfea1 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_observer.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_observer.cc
@@ -11,7 +11,7 @@
std::optional<const net::CanonicalCookie> GetCookie(
const net::CookieAccessResultList& cookie_list,
const std::string& cookie_name) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
cookie_list,
[&cookie_name](
const net::CookieWithAccessResult& cookie_with_access_result) {
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_refresh_service_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_refresh_service_impl.cc
index 054ea79..d3e8c6b4 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_refresh_service_impl.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_refresh_service_impl.cc
@@ -221,7 +221,7 @@
base::StringPairs items;
base::SplitStringIntoKeyValuePairs(*termination_header_value, '=', ';',
&items);
- auto session_id_it = base::ranges::find_if(items, [](const auto& kv_pair) {
+ auto session_id_it = std::ranges::find_if(items, [](const auto& kv_pair) {
return base::EqualsCaseInsensitiveASCII(
kv_pair.first, kGoogleSessionTerminationSessionIdKey);
});
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_params_util.cc b/chrome/browser/signin/bound_session_credentials/bound_session_params_util.cc
index cd4e0a9c..cdac2bf4 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_params_util.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_params_util.cc
@@ -67,7 +67,7 @@
return false;
}
- return base::ranges::all_of(
+ return std::ranges::all_of(
bound_session_params.credentials(), [](const auto& credential) {
return credential.has_cookie_credential() &&
!credential.cookie_credential().name().empty() &&
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
index 592959e..0870d73 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
@@ -442,7 +442,7 @@
reported_cookies_notified_ = true;
for (const std::string& expected_cookie_name : expected_cookie_names_) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
cookie_details->cookie_list,
[this, &expected_cookie_name](
const network::mojom::CookieOrLineWithAccessResultPtr& cookie) {
diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc
index 2097c4c..12565c7 100644
--- a/chrome/browser/signin/signin_ui_util.cc
+++ b/chrome/browser/signin/signin_ui_util.cc
@@ -427,7 +427,7 @@
// First, add the primary account (if available), even if it is not in the
// cookie jar.
- std::vector<AccountInfo>::iterator it = base::ranges::find(
+ std::vector<AccountInfo>::iterator it = std::ranges::find(
accounts_with_tokens, default_account_id, &AccountInfo::account_id);
if (it != accounts_with_tokens.end()) {
@@ -448,8 +448,8 @@
// Only insert the account if it has a refresh token, because we need the
// account info.
- it = base::ranges::find(accounts_with_tokens, account_info.id,
- &AccountInfo::account_id);
+ it = std::ranges::find(accounts_with_tokens, account_info.id,
+ &AccountInfo::account_id);
if (it != accounts_with_tokens.end()) {
accounts.push_back(std::move(*it));
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 5ce35c30b..5140efa 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/spellchecker/spellcheck_service.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <set>
@@ -14,7 +15,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/supports_user_data.h"
#include "base/synchronization/waitable_event.h"
@@ -283,7 +283,7 @@
// First try exact match. Per BCP47, tags are in ASCII and should be treated
// as case-insensitive (although there are conventions for the capitalization
// of subtags).
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
accept_languages,
[supported_language_full_tag](const auto& accept_language) {
return base::EqualsCaseInsensitiveASCII(supported_language_full_tag,
@@ -300,7 +300,7 @@
if (!base::Contains(supported_language_full_tag, "-"))
return "";
- iter = base::ranges::find_if(
+ iter = std::ranges::find_if(
accept_languages,
[supported_language_full_tag](const auto& accept_language) {
return base::EqualsCaseInsensitiveASCII(
@@ -723,7 +723,7 @@
std::string SpellcheckService::GetSupportedAcceptLanguageCodeGenericOnly(
const std::string& supported_language_full_tag,
const std::vector<std::string>& accept_languages) {
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
accept_languages,
[supported_language_full_tag](const auto& accept_language) {
return base::EqualsCaseInsensitiveASCII(
@@ -891,7 +891,7 @@
",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (normalize_for_spellcheck) {
- base::ranges::transform(
+ std::ranges::transform(
accept_languages, accept_languages.begin(),
[&](const std::string& language) {
#if BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/status_icons/status_tray.cc b/chrome/browser/status_icons/status_tray.cc
index ffa2a09..49795eb9 100644
--- a/chrome/browser/status_icons/status_tray.cc
+++ b/chrome/browser/status_icons/status_tray.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/status_icons/status_tray.h"
+#include <algorithm>
#include <memory>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/status_icons/status_icon.h"
StatusTray::~StatusTray() = default;
@@ -35,10 +35,10 @@
}
bool StatusTray::HasStatusIconOfTypeForTesting(StatusIconType type) const {
- return base::ranges::any_of(status_icons_,
- [type](const StatusIconWithType& status_icon) {
- return status_icon.type == type;
- });
+ return std::ranges::any_of(status_icons_,
+ [type](const StatusIconWithType& status_icon) {
+ return status_icon.type == type;
+ });
}
StatusTray::StatusIconWithType::StatusIconWithType(
diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
index 2b1e819..a619879e 100644
--- a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
+++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/storage_access_api/storage_access_grant_permission_context.h"
+#include <algorithm>
+
#include "base/check.h"
#include "base/check_op.h"
#include "base/feature_list.h"
@@ -11,7 +13,6 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -459,7 +460,7 @@
ContentSettingsType::STORAGE_ACCESS,
content_settings::mojom::SessionModel::USER_SESSION);
- const int existing_implicit_grants = base::ranges::count_if(
+ const int existing_implicit_grants = std::ranges::count_if(
implicit_grants, [&request_data](const auto& entry) {
return entry.primary_pattern.Matches(request_data.requesting_origin);
});
diff --git a/chrome/browser/supervised_user/linux_mac_windows/supervised_user_extensions_metrics_delegate_impl.cc b/chrome/browser/supervised_user/linux_mac_windows/supervised_user_extensions_metrics_delegate_impl.cc
index f582c2fa..b216329 100644
--- a/chrome/browser/supervised_user/linux_mac_windows/supervised_user_extensions_metrics_delegate_impl.cc
+++ b/chrome/browser/supervised_user/linux_mac_windows/supervised_user_extensions_metrics_delegate_impl.cc
@@ -14,7 +14,7 @@
namespace {
int GetExtensionsCount(const extensions::ExtensionSet& extensions) {
- return base::ranges::count_if(extensions, [](const auto& extension) {
+ return std::ranges::count_if(extensions, [](const auto& extension) {
return !extensions::Manifest::IsComponentLocation(extension->location()) &&
(extension->is_extension() || extension->is_theme());
});
diff --git a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
index d246a83..3bb2b25 100644
--- a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
+++ b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
@@ -215,7 +215,7 @@
}
} else {
// The main frame was not blocked. Check for any blocked iframes.
- size_t blocked_frame_count = base::ranges::count_if(
+ size_t blocked_frame_count = std::ranges::count_if(
supervised_user_interstitials_, [](const auto& entry) {
return entry.second->filtering_behavior_reason() ==
supervised_user::FilteringBehaviorReason::ASYNC_CHECKER;
diff --git a/chrome/browser/supervised_user/supervised_user_regional_url_filter_browsertest.cc b/chrome/browser/supervised_user/supervised_user_regional_url_filter_browsertest.cc
index a38e1cb..7d63f8f 100644
--- a/chrome/browser/supervised_user/supervised_user_regional_url_filter_browsertest.cc
+++ b/chrome/browser/supervised_user/supervised_user_regional_url_filter_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include <sstream>
#include <string>
@@ -12,7 +13,6 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/types/strong_alias.h"
diff --git a/chrome/browser/support_tool/ash/shill_data_collector_unittest.cc b/chrome/browser/support_tool/ash/shill_data_collector_unittest.cc
index 6a7fa4d..e2ccdce1 100644
--- a/chrome/browser/support_tool/ash/shill_data_collector_unittest.cc
+++ b/chrome/browser/support_tool/ash/shill_data_collector_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/support_tool/ash/shill_data_collector.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <optional>
@@ -16,7 +17,6 @@
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
@@ -207,7 +207,7 @@
PIIMap detected_pii = data_collector.GetDetectedPII();
// Get the types of all PII data detected
std::set<redaction::PIIType> detected_pii_types;
- base::ranges::transform(
+ std::ranges::transform(
detected_pii, std::inserter(detected_pii_types, detected_pii_types.end()),
&PIIMap::value_type::first);
// If set A is a subset of set B, then A unioned with B equals B
@@ -265,7 +265,7 @@
PIIMap detected_pii = data_collector.GetDetectedPII();
// Get the types of all PII data detected
std::set<redaction::PIIType> detected_pii_types;
- base::ranges::transform(
+ std::ranges::transform(
detected_pii, std::inserter(detected_pii_types, detected_pii_types.end()),
&PIIMap::value_type::first);
// If set A is a subset of set B, then A unioned with B equals B
diff --git a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc
index 74592cf5..9e9da26 100644
--- a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc
+++ b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc
@@ -1664,9 +1664,9 @@
ChromeSyncablePrefsDatabase::GetAllSyncablePrefsForTest() const {
std::map<std::string_view, sync_preferences::SyncablePrefMetadata>
syncable_prefs;
- base::ranges::copy(kChromeSyncablePrefsAllowlist,
- std::inserter(syncable_prefs, syncable_prefs.end()));
- base::ranges::move(
+ std::ranges::copy(kChromeSyncablePrefsAllowlist,
+ std::inserter(syncable_prefs, syncable_prefs.end()));
+ std::ranges::move(
common_syncable_prefs_database_.GetAllSyncablePrefsForTest(), // IN-TEST
std::inserter(syncable_prefs, syncable_prefs.end()));
return syncable_prefs;
diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc
index 45aec2b..1026222 100644
--- a/chrome/browser/sync/test/integration/bookmarks_helper.cc
+++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <functional>
#include <memory>
#include <optional>
@@ -19,7 +20,6 @@
#include "base/not_fatal_until.h"
#include "base/path_service.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -1079,7 +1079,7 @@
actual_specifics = entity.specifics().bookmark();
}
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
expected, [actual_specifics](const ExpectedBookmark& bookmark) {
return actual_specifics.legacy_canonicalized_title() ==
base::UTF16ToUTF8(bookmark.title) &&
@@ -1184,7 +1184,7 @@
CHECK(parent_iter != server_uuids_by_parent_id.end(),
base::NotFatalUntil::M130);
auto server_position_iter =
- base::ranges::find(parent_iter->second, node->uuid());
+ std::ranges::find(parent_iter->second, node->uuid());
CHECK(server_position_iter != parent_iter->second.end(),
base::NotFatalUntil::M130);
const size_t server_position =
@@ -1351,7 +1351,7 @@
};
for (auto& [parent_id, children_uuids] : uuids_grouped_by_parent_id) {
- base::ranges::sort(children_uuids, sort_by_position_fn);
+ std::ranges::sort(children_uuids, sort_by_position_fn);
}
return uuids_grouped_by_parent_id;
}
diff --git a/chrome/browser/sync/test/integration/printers_helper.cc b/chrome/browser/sync/test/integration/printers_helper.cc
index 7fe8b73..5fcb781 100644
--- a/chrome/browser/sync/test/integration/printers_helper.cc
+++ b/chrome/browser/sync/test/integration/printers_helper.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/sync/test/integration/printers_helper.h"
+#include <algorithm>
#include <ostream>
#include <string>
#include <unordered_map>
@@ -11,7 +12,6 @@
#include <vector>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/ash/printing/synced_printers_manager.h"
#include "chrome/browser/ash/printing/synced_printers_manager_factory.h"
@@ -88,7 +88,7 @@
const std::string& description) {
PrinterList printers = manager->GetSavedPrinters();
std::string printer_id = PrinterId(index);
- auto found = base::ranges::find(printers, printer_id, &chromeos::Printer::id);
+ auto found = std::ranges::find(printers, printer_id, &chromeos::Printer::id);
if (found == printers.end()) {
return false;
diff --git a/chrome/browser/sync/test/integration/sessions_helper.cc b/chrome/browser/sync/test/integration/sessions_helper.cc
index e9cf2fc..be2a31cd 100644
--- a/chrome/browser/sync/test/integration/sessions_helper.cc
+++ b/chrome/browser/sync/test/integration/sessions_helper.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <set>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_timeouts.h"
#include "base/time/time.h"
@@ -114,7 +114,7 @@
}
void SortSyncedSessions(SyncedSessionVector* sessions) {
- base::ranges::sort(*sessions, CompareSyncedSessions);
+ std::ranges::sort(*sessions, CompareSyncedSessions);
}
std::vector<sync_pb::SessionSpecifics> SyncEntitiesToSessionSpecifics(
@@ -272,7 +272,7 @@
std::unique_ptr<sessions::SessionTab> new_tab =
std::make_unique<sessions::SessionTab>();
new_tab->navigations.resize(tab->navigations.size());
- base::ranges::copy(tab->navigations, new_tab->navigations.begin());
+ std::ranges::copy(tab->navigations, new_tab->navigations.begin());
new_window->wrapped_window.tabs.push_back(std::move(new_tab));
}
SessionID id = new_window->wrapped_window.window_id;
diff --git a/chrome/browser/sync/test/integration/shared_tab_group_data_helper.cc b/chrome/browser/sync/test/integration/shared_tab_group_data_helper.cc
index 500f3e53..fd3ff69 100644
--- a/chrome/browser/sync/test/integration/shared_tab_group_data_helper.cc
+++ b/chrome/browser/sync/test/integration/shared_tab_group_data_helper.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/sync/test/integration/shared_tab_group_data_helper.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/saved_tab_groups/public/saved_tab_group.h"
@@ -49,8 +50,8 @@
return false;
}
- base::ranges::sort(shared_tab_groups_1, &CompareSavedTabGroups);
- base::ranges::sort(shared_tab_groups_2, &CompareSavedTabGroups);
+ std::ranges::sort(shared_tab_groups_1, &CompareSavedTabGroups);
+ std::ranges::sort(shared_tab_groups_2, &CompareSavedTabGroups);
for (size_t group_index = 0; group_index < shared_tab_groups_1.size();
++group_index) {
diff --git a/chrome/browser/sync/test/integration/single_client_product_specifications_sync_test.cc b/chrome/browser/sync/test/integration/single_client_product_specifications_sync_test.cc
index b712cf3..582f5ce 100644
--- a/chrome/browser/sync/test/integration/single_client_product_specifications_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_product_specifications_sync_test.cc
@@ -61,7 +61,7 @@
base::Base64Encode(base::SHA1HashString(top_level_uuid));
syncer::UniquePosition::Suffix suffix;
CHECK_EQ(suffix.size(), suffix_str.size());
- base::ranges::copy(suffix_str, suffix.begin());
+ std::ranges::copy(suffix_str, suffix.begin());
syncer::UniquePosition position =
syncer::UniquePosition::InitialPosition(suffix);
for (const std::string& url : urls) {
diff --git a/chrome/browser/sync/test/integration/single_client_saved_tab_groups_sync_test.cc b/chrome/browser/sync/test/integration/single_client_saved_tab_groups_sync_test.cc
index dc131c7d29..d1300229 100644
--- a/chrome/browser/sync/test/integration/single_client_saved_tab_groups_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_saved_tab_groups_sync_test.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/uuid.h"
#include "chrome/browser/sync/test/integration/saved_tab_groups_helper.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
@@ -109,7 +110,7 @@
const std::string& uuid_string = uuid.AsLowercaseString();
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
server_tabs_and_groups,
[uuid_string](const sync_pb::SyncEntity entity) {
return entity.specifics().saved_tab_group().guid() == uuid_string;
diff --git a/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
index 39da19f..a602b62 100644
--- a/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_sharing_message_sync_test.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <vector>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/mock_callback.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.h"
@@ -113,7 +113,7 @@
}
for (const SharingMessageSpecifics& specifics : expected_specifics_) {
- auto iter = base::ranges::find(
+ auto iter = std::ranges::find(
entities, specifics.payload(), [](const sync_pb::SyncEntity& entity) {
return entity.specifics().sharing_message().payload();
});
diff --git a/chrome/browser/sync/test/integration/single_client_webauthn_credentials_sync_test.cc b/chrome/browser/sync/test/integration/single_client_webauthn_credentials_sync_test.cc
index 5794a1c..9a911d2 100644
--- a/chrome/browser/sync/test/integration/single_client_webauthn_credentials_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_webauthn_credentials_sync_test.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/containers/span.h"
#include "base/location.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/secondary_account_helper.h"
@@ -94,7 +95,7 @@
CHECK(ec_key);
std::vector<uint8_t> ec_key_pub;
CHECK(ec_key->ExportPublicKey(&ec_key_pub));
- return base::ranges::equal(ec_key_pub, expected_spki);
+ return std::ranges::equal(ec_key_pub, expected_spki);
}
std::unique_ptr<syncer::PersistentUniqueClientEntity>
diff --git a/chrome/browser/sync/test/integration/user_events_helper.cc b/chrome/browser/sync/test/integration/user_events_helper.cc
index e53ffba..3e8fc00 100644
--- a/chrome/browser/sync/test/integration/user_events_helper.cc
+++ b/chrome/browser/sync/test/integration/user_events_helper.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/sync/test/integration/user_events_helper.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "components/sync/test/fake_server.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -60,7 +61,7 @@
UserEventSpecifics server_specifics = entity.specifics().user_event();
// Find a matching event in our expectations. Same event time should mean
// identical events, though there can be duplicates in some cases.
- auto iter = base::ranges::find(
+ auto iter = std::ranges::find(
remaining_expected_specifics, server_specifics.event_time_usec(),
&sync_pb::UserEventSpecifics::event_time_usec);
// We don't expect to encounter id matching events with different values,
diff --git a/chrome/browser/sync/test/integration/webauthn_credentials_helper.cc b/chrome/browser/sync/test/integration/webauthn_credentials_helper.cc
index cd1ad74..b87b48b3 100644
--- a/chrome/browser/sync/test/integration/webauthn_credentials_helper.cc
+++ b/chrome/browser/sync/test/integration/webauthn_credentials_helper.cc
@@ -145,7 +145,7 @@
return false;
}
for (const auto& change : changes_observed_) {
- if (base::ranges::none_of(
+ if (std::ranges::none_of(
expected_changes_, [&change](const auto& expected_change) {
return expected_change.first == change.type() &&
expected_change.second == change.passkey().sync_id();
diff --git a/chrome/browser/sync/test/integration/webauthn_credentials_helper.h b/chrome/browser/sync/test/integration/webauthn_credentials_helper.h
index f6d1d9a..677b9f1 100644
--- a/chrome/browser/sync/test/integration/webauthn_credentials_helper.h
+++ b/chrome/browser/sync/test/integration/webauthn_credentials_helper.h
@@ -189,10 +189,10 @@
return arg.sync_id() == expected.sync_id() &&
arg.credential_id() == expected.credential_id() &&
arg.rp_id() == expected.rp_id() &&
- base::ranges::equal(arg.newly_shadowed_credential_ids().begin(),
- arg.newly_shadowed_credential_ids().end(),
- expected.newly_shadowed_credential_ids().begin(),
- expected.newly_shadowed_credential_ids().end()) &&
+ std::ranges::equal(arg.newly_shadowed_credential_ids().begin(),
+ arg.newly_shadowed_credential_ids().end(),
+ expected.newly_shadowed_credential_ids().begin(),
+ expected.newly_shadowed_credential_ids().end()) &&
arg.creation_time() == expected.creation_time() &&
arg.user_name() == expected.user_name() &&
arg.user_display_name() == expected.user_display_name() &&
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
index e288e08..16f3f7b0 100644
--- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
+++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <iterator>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
@@ -155,7 +155,7 @@
bool has_more) {
DCHECK(entries_out);
entries_out->reserve(entries_out->size() + entries.size());
- base::ranges::copy(entries, std::back_inserter(*entries_out));
+ std::ranges::copy(entries, std::back_inserter(*entries_out));
if (!has_more)
std::move(callback_).Run(error);
diff --git a/chrome/browser/task_manager/mock_web_contents_task_manager.cc b/chrome/browser/task_manager/mock_web_contents_task_manager.cc
index 6b8b606..0aa4f9f 100644
--- a/chrome/browser/task_manager/mock_web_contents_task_manager.cc
+++ b/chrome/browser/task_manager/mock_web_contents_task_manager.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/task_manager/mock_web_contents_task_manager.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
namespace task_manager {
@@ -23,7 +24,7 @@
void MockWebContentsTaskManager::TaskRemoved(Task* task) {
DCHECK(task);
- const auto it = base::ranges::find(tasks_, task);
+ const auto it = std::ranges::find(tasks_, task);
CHECK(it != tasks_.end(), base::NotFatalUntil::M130);
tasks_.erase(it);
}
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_tag_browsertest.cc b/chrome/browser/task_manager/providers/web_contents/extension_tag_browsertest.cc
index ed88192..6a37893 100644
--- a/chrome/browser/task_manager/providers/web_contents/extension_tag_browsertest.cc
+++ b/chrome/browser/task_manager/providers/web_contents/extension_tag_browsertest.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -29,8 +30,8 @@
// If no extension task was found, a nullptr will be returned.
Task* FindAndGetExtensionTask(
const MockWebContentsTaskManager& task_manager) {
- auto itr = base::ranges::find(task_manager.tasks(), Task::EXTENSION,
- &Task::GetType);
+ auto itr = std::ranges::find(task_manager.tasks(), Task::EXTENSION,
+ &Task::GetType);
return itr != task_manager.tasks().end() ? *itr : nullptr;
}
diff --git a/chrome/browser/task_manager/providers/web_contents/web_contents_tags_manager.cc b/chrome/browser/task_manager/providers/web_contents/web_contents_tags_manager.cc
index 2537554..0b965f2 100644
--- a/chrome/browser/task_manager/providers/web_contents/web_contents_tags_manager.cc
+++ b/chrome/browser/task_manager/providers/web_contents/web_contents_tags_manager.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/task_manager/providers/web_contents/web_contents_tags_manager.h"
+#include <algorithm>
+
#include "base/memory/singleton.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/task_manager/providers/web_contents/web_contents_task_provider.h"
namespace task_manager {
@@ -25,7 +26,7 @@
void WebContentsTagsManager::RemoveTag(WebContentsTag* tag) {
DCHECK(tag);
- tracked_tags_.erase(base::ranges::find(tracked_tags_, tag));
+ tracked_tags_.erase(std::ranges::find(tracked_tags_, tag));
// No need to inform the provider here. The provider will create an entry
// for each WebContents it's tracking which is a WebContentsObserver and
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 5c0e48b..1f26e131 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -12,6 +12,7 @@
#include <limits.h>
#include <stddef.h>
+#include <algorithm>
#include <array>
#include <limits>
#include <memory>
@@ -29,7 +30,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -168,15 +168,15 @@
};
BrowserThemePack::PersistentID GetPersistentIDByName(const std::string& key) {
- auto* it = base::ranges::find_if(kPersistingImages, [&](const auto& image) {
+ auto* it = std::ranges::find_if(kPersistingImages, [&](const auto& image) {
return base::EqualsCaseInsensitiveASCII(key, image.key);
});
return it == std::end(kPersistingImages) ? PRS::kInvalid : it->persistent_id;
}
BrowserThemePack::PersistentID GetPersistentIDByIDR(int idr) {
- auto* it = base::ranges::find(kPersistingImages, idr,
- &PersistingImagesTable::idr_id);
+ auto* it =
+ std::ranges::find(kPersistingImages, idr, &PersistingImagesTable::idr_id);
return it == std::end(kPersistingImages) ? PRS::kInvalid : it->persistent_id;
}
@@ -1532,7 +1532,7 @@
void BrowserThemePack::BuildSourceImagesArray(const FilePathMap& file_paths) {
source_images_ = new SourceImage[file_paths.size() + 1];
- base::ranges::transform(
+ std::ranges::transform(
file_paths, source_images_.get(),
[](const auto& pair) { return SourceImage{pair.first}; });
source_images_[file_paths.size()].id = -1;
diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc
index 2367d1b..ec6f81f 100644
--- a/chrome/browser/themes/theme_syncable_service_unittest.cc
+++ b/chrome/browser/themes/theme_syncable_service_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/themes/theme_syncable_service.h"
+#include <algorithm>
#include <memory>
#include <optional>
@@ -16,7 +17,6 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/protobuf_matchers.h"
#include "base/test/scoped_feature_list.h"
@@ -3967,7 +3967,7 @@
std::make_unique<syncer::SyncChangeProcessorWrapperForTest>(
fake_change_processor_.get())));
- EXPECT_EQ(2, base::ranges::count_if(
+ EXPECT_EQ(2, std::ranges::count_if(
fake_change_processor_->changes(), [](const auto& e) {
return e.sync_data().GetSpecifics().has_theme();
}));
diff --git a/chrome/browser/thumbnail/cc/thumbnail_cache.cc b/chrome/browser/thumbnail/cc/thumbnail_cache.cc
index 3395516f..73d54f9 100644
--- a/chrome/browser/thumbnail/cc/thumbnail_cache.cc
+++ b/chrome/browser/thumbnail/cc/thumbnail_cache.cc
@@ -24,7 +24,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
@@ -466,7 +465,7 @@
}
void ThumbnailCache::RemoveFromReadQueue(TabId tab_id) {
- auto read_iter = base::ranges::find(read_queue_, tab_id);
+ auto read_iter = std::ranges::find(read_queue_, tab_id);
if (read_iter != read_queue_.end()) {
read_queue_.erase(read_iter);
}
@@ -559,7 +558,7 @@
const gfx::Size& content_size) {
read_in_progress_ = false;
- auto iter = base::ranges::find(read_queue_, tab_id);
+ auto iter = std::ranges::find(read_queue_, tab_id);
if (iter == read_queue_.end()) {
ReadNextThumbnail();
return;
diff --git a/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller.cc b/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller.cc
index 6e2cfe4..aa4db22 100644
--- a/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller.cc
+++ b/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller.h"
+#include <algorithm>
+
#include "base/check_op.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/password_manager/android/grouped_affiliations/acknowledge_grouped_credential_sheet_bridge.h"
#include "chrome/browser/password_manager/android/grouped_affiliations/acknowledge_grouped_credential_sheet_controller.h"
#include "chrome/browser/password_manager/android/password_manager_launcher_android.h"
@@ -39,7 +40,7 @@
// 2) Prefer credentials that were used recently over others.
//
// Note: This ordering matches password_manager_util::FindBestMatches().
- base::ranges::sort(result, std::greater<>{}, [](const UiCredential& cred) {
+ std::ranges::sort(result, std::greater<>{}, [](const UiCredential& cred) {
return std::make_pair(-static_cast<int>(cred.match_type()),
cred.last_used());
});
@@ -175,7 +176,7 @@
}
// Emit UMA if grouped affiliation match was available for the user.
- if (base::ranges::find_if(credentials_, [](const UiCredential& login) {
+ if (std::ranges::find_if(credentials_, [](const UiCredential& login) {
return login.match_type() ==
password_manager_util::GetLoginMatchType::kGrouped;
}) != credentials_.end()) {
diff --git a/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller_autofill_delegate.cc b/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller_autofill_delegate.cc
index a52e14f..93dd2c8 100644
--- a/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller_autofill_delegate.cc
+++ b/chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller_autofill_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/touch_to_fill/password_manager/touch_to_fill_controller_autofill_delegate.h"
+#include <algorithm>
#include <memory>
#include "base/base64.h"
@@ -11,7 +12,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/types/pass_key.h"
#include "chrome/browser/password_manager/android/access_loss/password_access_loss_warning_bridge_impl.h"
#include "chrome/browser/password_manager/android/grouped_affiliations/acknowledge_grouped_credential_sheet_controller.h"
@@ -44,7 +44,7 @@
// Returns whether there is at least one credential with a non-empty username.
bool ContainsNonEmptyUsername(
const base::span<const UiCredential>& credentials) {
- return base::ranges::any_of(credentials, [](const UiCredential& credential) {
+ return std::ranges::any_of(credentials, [](const UiCredential& credential) {
return !credential.username().empty();
});
}
diff --git a/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc b/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc
index 6b91cc3e..0c7a8a8d 100644
--- a/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc
+++ b/chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "build/buildflag.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/google_accounts_private_api_util.h"
@@ -151,8 +151,8 @@
std::vector<std::vector<uint8_t>> keys_as_bytes;
keys_as_bytes.reserve(keys.size());
- base::ranges::transform(keys, std::back_inserter(keys_as_bytes),
- &chrome::mojom::TrustedVaultKey::bytes);
+ std::ranges::transform(keys, std::back_inserter(keys_as_bytes),
+ &chrome::mojom::TrustedVaultKey::bytes);
const int32_t last_key_version = keys.back()->version;
if (security_domain == trusted_vault::SecurityDomainId::kPasskeys) {
diff --git a/chrome/browser/ui/actions/tools/dump_actions.cc b/chrome/browser/ui/actions/tools/dump_actions.cc
index ccfe11849..d45796d 100644
--- a/chrome/browser/ui/actions/tools/dump_actions.cc
+++ b/chrome/browser/ui/actions/tools/dump_actions.cc
@@ -11,13 +11,12 @@
// stdout.
#include <algorithm>
+#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <string>
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "build/build_config.h"
#include "chrome/browser/ui/actions/chrome_action_id.h"
#include "ui/actions/action_id.h"
@@ -40,7 +39,7 @@
int main(int argc, const char* argv[]) {
const size_t longest_name =
- strlen(base::ranges::max(enum_names, base::ranges::less(), strlen)) + 1;
+ strlen(std::ranges::max(enum_names, std::ranges::less(), strlen)) + 1;
std::cout << std::setfill(' ') << std::left;
std::cout << std::setw(longest_name) << "ID";
diff --git a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc
index 0083946..82b3ef9 100644
--- a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc
+++ b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
+#include <algorithm>
#include <utility>
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
@@ -167,7 +167,7 @@
void UsbChooserDialogAndroid::OnItemSelected(JNIEnv* env,
std::string& item_id) {
- auto it = base::ranges::find(item_id_map_, item_id);
+ auto it = std::ranges::find(item_id_map_, item_id);
CHECK(it != item_id_map_.end(), base::NotFatalUntil::M130);
controller_->Select(
{static_cast<size_t>(std::distance(item_id_map_.begin(), it))});
diff --git a/chrome/browser/ui/android/hats/hats_service_android.cc b/chrome/browser/ui/android/hats/hats_service_android.cc
index 76eed40..a4568d11 100644
--- a/chrome/browser/ui/android/hats/hats_service_android.cc
+++ b/chrome/browser/ui/android/hats/hats_service_android.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/android/hats/hats_service_android.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
@@ -12,7 +13,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/android/resource_mapper.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
@@ -247,10 +247,10 @@
// take a survey from the same trigger, regardless of whether the survey was
// updated.
auto trigger_survey_config =
- base::ranges::find(survey_configs_by_triggers_, trigger_id,
- [](const SurveyConfigs::value_type& pair) {
- return pair.second.trigger_id;
- });
+ std::ranges::find(survey_configs_by_triggers_, trigger_id,
+ [](const SurveyConfigs::value_type& pair) {
+ return pair.second.trigger_id;
+ });
CHECK(trigger_survey_config != survey_configs_by_triggers_.end(),
base::NotFatalUntil::M130);
diff --git a/chrome/browser/ui/android/hats/survey_client_android.cc b/chrome/browser/ui/android/hats/survey_client_android.cc
index 7d8481a..635f97d 100644
--- a/chrome/browser/ui/android/hats/survey_client_android.cc
+++ b/chrome/browser/ui/android/hats/survey_client_android.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/android/hats/survey_client_android.h"
+#include <algorithm>
#include <string_view>
#include "base/android/jni_android.h"
@@ -11,7 +12,6 @@
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/containers/heap_array.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/android/hats/survey_config_android.h"
#include "ui/android/window_android.h"
@@ -60,7 +60,7 @@
auto bits_values =
base::HeapArray<bool>::WithSize(product_specific_bits_data.size());
size_t value_iterator = 0u;
- base::ranges::for_each(
+ std::ranges::for_each(
product_specific_bits_data.begin(), product_specific_bits_data.end(),
[&bits_fields, &bits_values,
&value_iterator](const SurveyBitsData::value_type& pair) {
@@ -75,7 +75,7 @@
// Parse string PSDs.
std::vector<std::string> string_fields;
std::vector<std::string> string_values;
- base::ranges::for_each(
+ std::ranges::for_each(
product_specific_string_data.begin(), product_specific_string_data.end(),
[&string_fields,
&string_values](const SurveyStringData::value_type& pair) {
diff --git a/chrome/browser/ui/android/tab_model/tab_model_list.cc b/chrome/browser/ui/android/tab_model/tab_model_list.cc
index 901e2cea..9a4536b2 100644
--- a/chrome/browser/ui/android/tab_model/tab_model_list.cc
+++ b/chrome/browser/ui/android/tab_model/tab_model_list.cc
@@ -6,8 +6,9 @@
#include <jni.h>
+#include <algorithm>
+
#include "base/android/jni_android.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list_observer.h"
@@ -38,7 +39,7 @@
auto& tab_models = tab_model_list_.Get().models_;
TabModelList::iterator remove_tab_model =
- base::ranges::find(tab_models, tab_model);
+ std::ranges::find(tab_models, tab_model);
if (remove_tab_model != tab_models.end()) {
tab_models.erase(remove_tab_model);
diff --git a/chrome/browser/ui/ash/arc/arc_open_url_delegate_impl_browsertest.cc b/chrome/browser/ui/ash/arc/arc_open_url_delegate_impl_browsertest.cc
index 36341c6..444bd0dc 100644
--- a/chrome/browser/ui/ash/arc/arc_open_url_delegate_impl_browsertest.cc
+++ b/chrome/browser/ui/ash/arc/arc_open_url_delegate_impl_browsertest.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/ash/arc/arc_open_url_delegate_impl.h"
+#include <algorithm>
#include <memory>
#include <string>
#include "ash/webui/settings/public/constants/routes.mojom.h"
#include "ash/webui/system_apps/public/system_web_app_type.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -40,11 +40,11 @@
// Return the number of windows that hosts OS Settings.
size_t GetNumberOfSettingsWindows() {
- return base::ranges::count_if(*BrowserList::GetInstance(),
- [](Browser* browser) {
- return ash::IsBrowserForSystemWebApp(
- browser, ash::SystemWebAppType::SETTINGS);
- });
+ return std::ranges::count_if(*BrowserList::GetInstance(),
+ [](Browser* browser) {
+ return ash::IsBrowserForSystemWebApp(
+ browser, ash::SystemWebAppType::SETTINGS);
+ });
}
// Give the underlying function a clearer name.
diff --git a/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc b/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc
index db00f65..797ec054 100644
--- a/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc
+++ b/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/assistant/assistant_test_mixin.h"
+#include <algorithm>
#include <utility>
#include <vector>
@@ -16,7 +17,6 @@
#include "base/auto_reset.h"
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/scoped_run_loop_timeout.h"
diff --git a/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc b/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc
index 45de097..19c835c2 100644
--- a/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc
+++ b/chrome/browser/ui/ash/birch/birch_keyed_service_unittest.cc
@@ -182,10 +182,10 @@
std::vector<raw_ptr<const sync_sessions::SyncedSession,
VectorExperimental>>* sessions) override {
*sessions = foreign_sessions_;
- base::ranges::sort(*sessions, std::greater(),
- [](const sync_sessions::SyncedSession* session) {
- return session->GetModifiedTime();
- });
+ std::ranges::sort(*sessions, std::greater(),
+ [](const sync_sessions::SyncedSession* session) {
+ return session->GetModifiedTime();
+ });
return !sessions->empty();
}
diff --git a/chrome/browser/ui/ash/clipboard/clipboard_image_model_factory_impl.cc b/chrome/browser/ui/ash/clipboard/clipboard_image_model_factory_impl.cc
index 969cf65f..7dc852d 100644
--- a/chrome/browser/ui/ash/clipboard/clipboard_image_model_factory_impl.cc
+++ b/chrome/browser/ui/ash/clipboard/clipboard_image_model_factory_impl.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ui/ash/clipboard/clipboard_image_model_factory_impl.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/profiles/profile.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h"
#include "components/user_manager/user_manager.h"
@@ -66,8 +67,8 @@
return;
}
- auto iter = base::ranges::find(pending_list_, id,
- &ClipboardImageModelRequest::Params::id);
+ auto iter = std::ranges::find(pending_list_, id,
+ &ClipboardImageModelRequest::Params::id);
if (iter == pending_list_.end()) {
return;
}
diff --git a/chrome/browser/ui/ash/desks/desks_client_browsertest.cc b/chrome/browser/ui/ash/desks/desks_client_browsertest.cc
index 12b3a05a..3e37a17 100644
--- a/chrome/browser/ui/ash/desks/desks_client_browsertest.cc
+++ b/chrome/browser/ui/ash/desks/desks_client_browsertest.cc
@@ -883,7 +883,7 @@
// Verify that the settings window has been launched on the new desk (desk B).
EXPECT_EQ(1, desks_controller->GetActiveDeskIndex());
auto it =
- base::ranges::find_if(*BrowserList::GetInstance(), [](Browser* browser) {
+ std::ranges::find_if(*BrowserList::GetInstance(), [](Browser* browser) {
return ash::IsBrowserForSystemWebApp(browser,
ash::SystemWebAppType::SETTINGS);
});
@@ -3531,11 +3531,11 @@
// expect the new window to have an index that is higher than the old.
const auto& container = new_browser_window_one->parent()->children();
size_t new_index_one =
- base::ranges::find(container, new_browser_window_one) - container.begin();
+ std::ranges::find(container, new_browser_window_one) - container.begin();
size_t new_index_two =
- base::ranges::find(container, new_browser_window_two) - container.begin();
+ std::ranges::find(container, new_browser_window_two) - container.begin();
size_t old_index =
- base::ranges::find(container, old_browser_window) - container.begin();
+ std::ranges::find(container, old_browser_window) - container.begin();
EXPECT_GT(new_index_one, new_index_two);
EXPECT_GT(new_index_two, old_index);
diff --git a/chrome/browser/ui/ash/gemini_app/gemini_app_interactive_uitest.cc b/chrome/browser/ui/ash/gemini_app/gemini_app_interactive_uitest.cc
index 9359b21a..a3e8b61 100644
--- a/chrome/browser/ui/ash/gemini_app/gemini_app_interactive_uitest.cc
+++ b/chrome/browser/ui/ash/gemini_app/gemini_app_interactive_uitest.cc
@@ -111,7 +111,7 @@
// Returns the index of `value` in the specified `range`.
template <typename Range, typename Value>
std::optional<size_t> FindIndex(const Range& range, const Value* value) {
- auto it = base::ranges::find(range, value);
+ auto it = std::ranges::find(range, value);
return it != range.end()
? std::make_optional<size_t>(std::distance(range.begin(), it))
: std::make_optional<size_t>();
@@ -133,14 +133,14 @@
// with the specified command `id`.
views::MenuItemView* FindMenuItemViewForCommand(int id) {
std::vector<raw_ptr<views::MenuItemView>> views = FindMenuItemViews();
- auto it = base::ranges::find(views, id, &views::MenuItemView::GetCommand);
+ auto it = std::ranges::find(views, id, &views::MenuItemView::GetCommand);
return it != views.end() ? *it : nullptr;
}
// Returns the `ash::ShelfItem` for the given web app `id`.
const ash::ShelfItem* FindShelfItemForWebApp(std::string_view id) {
const ash::ShelfItems& items = ash::ShelfModel::Get()->items();
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
items, [id](const ash::ShelfItem& item) { return item.id.app_id == id; });
return it != items.end() ? &*it : nullptr;
}
@@ -904,7 +904,7 @@
std::vector<IneligibilityReason> reasons(
static_cast<int>(IneligibilityReason::kMaxValue) -
static_cast<int>(IneligibilityReason::kMinValue) + 1);
- base::ranges::generate(
+ std::ranges::generate(
reasons.begin(), reasons.end(),
[i = static_cast<int>(IneligibilityReason::kMinValue)]() mutable {
return static_cast<IneligibilityReason>(i++);
@@ -937,7 +937,7 @@
std::vector<raw_ptr<ash::AppListItemView>> apps;
FindDescendantsOfClass(apps_grid_view, apps);
return apps.size() &&
- base::ranges::none_of(apps, [&](ash::AppListItemView* app) {
+ std::ranges::none_of(apps, [&](ash::AppListItemView* app) {
return IsAppListItemViewForWebApp(ash::kGeminiAppId, app);
});
}));
@@ -952,7 +952,7 @@
std::vector<raw_ptr<ash::ShelfAppButton>> apps;
FindDescendantsOfClass(shelf, apps);
return apps.size() &&
- base::ranges::none_of(
+ std::ranges::none_of(
apps, [&, shelf = raw_ptr(shelf)](ash::ShelfAppButton* app) {
return IsShelfAppButtonForWebApp(std::cref(shelf),
ash::kGeminiAppId, app);
diff --git a/chrome/browser/ui/ash/graduation/graduation_manager_impl_browsertest.cc b/chrome/browser/ui/ash/graduation/graduation_manager_impl_browsertest.cc
index 3177f2f7..4454b1c 100644
--- a/chrome/browser/ui/ash/graduation/graduation_manager_impl_browsertest.cc
+++ b/chrome/browser/ui/ash/graduation/graduation_manager_impl_browsertest.cc
@@ -114,7 +114,7 @@
bool IsItemPinned(const std::string& item_id) {
const auto& shelf_items = ShelfModel::Get()->items();
auto pinned_item =
- base::ranges::find_if(shelf_items, [&item_id](const auto& shelf_item) {
+ std::ranges::find_if(shelf_items, [&item_id](const auto& shelf_item) {
return shelf_item.id.app_id == item_id;
});
return pinned_item != std::ranges::end(shelf_items);
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_client_impl.cc b/chrome/browser/ui/ash/holding_space/holding_space_client_impl.cc
index f128e4f..48c7bc3 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_client_impl.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_client_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_client_impl.h"
+#include <algorithm>
#include <memory>
#include <optional>
@@ -14,7 +15,6 @@
#include "base/barrier_closure.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/file_manager/fileapi_util.h"
@@ -73,7 +73,7 @@
const HoldingSpaceItem& item) {
CHECK(!item.progress().IsComplete());
- auto command_iter = base::ranges::find(
+ auto command_iter = std::ranges::find(
item.in_progress_commands(), HoldingSpaceCommandId::kOpenItem,
&HoldingSpaceItem::InProgressCommand::command_id);
if (command_iter != item.in_progress_commands().end()) {
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_file_system_delegate.cc b/chrome/browser/ui/ash/holding_space/holding_space_file_system_delegate.cc
index d5718f1..4123fa326 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_file_system_delegate.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_file_system_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_file_system_delegate.h"
+#include <algorithm>
#include <set>
#include <string>
@@ -16,7 +17,6 @@
#include "base/files/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/files/file_util.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
@@ -248,7 +248,7 @@
model()->RemoveIf(base::BindRepeating(
[](const std::set<base::FilePath>& deleted_paths,
const HoldingSpaceItem* item) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
deleted_paths, [&](const base::FilePath& deleted_path) {
return item->file().file_path == deleted_path ||
deleted_path.IsParent(item->file().file_path);
@@ -674,7 +674,7 @@
// The watch for `file_path` should only be removed if no holding space items
// exist in the model which are backed by files it directly parents.
const bool remove_watch =
- base::ranges::none_of(model()->items(), [&file_path](const auto& item) {
+ std::ranges::none_of(model()->items(), [&file_path](const auto& item) {
return item->IsInitialized() &&
item->file().file_path.DirName() == file_path;
});
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service.cc b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service.cc
index 1b4356f..ea452698 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_keyed_service.h"
+#include <algorithm>
#include <set>
#include "ash/constants/ash_features.h"
@@ -16,7 +17,6 @@
#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ash/drive/drive_integration_service.h"
#include "chrome/browser/browser_process.h"
@@ -273,11 +273,11 @@
}
// No-op if `existing_suggestions` are unchanged.
- if (base::ranges::equal(existing_suggestions, suggestions, /*pred=*/{},
- [](const HoldingSpaceItem* item) {
- return std::make_pair(item->type(),
- item->file().file_path);
- })) {
+ if (std::ranges::equal(existing_suggestions, suggestions, /*pred=*/{},
+ [](const HoldingSpaceItem* item) {
+ return std::make_pair(item->type(),
+ item->file().file_path);
+ })) {
return;
}
@@ -288,11 +288,11 @@
for (const auto& [type, file_path] : base::Reversed(suggestions)) {
std::unique_ptr<HoldingSpaceItem> item;
if (auto existing_item =
- base::ranges::find_if(existing_suggestions,
- [&](const HoldingSpaceItem* item) {
- return item->type() == type &&
- item->file().file_path == file_path;
- });
+ std::ranges::find_if(existing_suggestions,
+ [&](const HoldingSpaceItem* item) {
+ return item->type() == type &&
+ item->file().file_path == file_path;
+ });
existing_item != existing_suggestions.end() &&
!(*existing_item)->IsInitialized()) {
// Reuse the existing uninitialized file suggestion item to avoid
@@ -307,13 +307,13 @@
std::stringstream data;
data << "type: " << static_cast<int>((*existing_item)->type());
data << ", existing_count: "
- << base::ranges::count_if(
+ << std::ranges::count_if(
existing_suggestions, [&](const HoldingSpaceItem* item) {
return item->type() == type &&
item->file().file_path == file_path;
});
data << ", new_count: "
- << base::ranges::count_if(
+ << std::ranges::count_if(
suggestions,
[&](const std::pair<HoldingSpaceItem::Type, base::FilePath>&
suggestion) {
@@ -569,7 +569,7 @@
bool HoldingSpaceKeyedService::IsInitialized() const {
return delegates_.size() &&
- base::ranges::none_of(
+ std::ranges::none_of(
delegates_,
&HoldingSpaceKeyedServiceDelegate::is_restoring_persistence);
}
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_browsertest.cc b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_browsertest.cc
index 73fdff6..5571984 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_browsertest.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_browsertest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_keyed_service.h"
+#include <algorithm>
#include <vector>
#include "ash/constants/ash_features.h"
@@ -21,7 +22,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/stringprintf.h"
@@ -108,7 +108,7 @@
void WaitForItemAddition(
base::RepeatingCallback<bool(const HoldingSpaceItem*)> predicate) {
auto* const model = HoldingSpaceController::Get()->model();
- if (base::ranges::any_of(model->items(), [&predicate](const auto& item) {
+ if (std::ranges::any_of(model->items(), [&predicate](const auto& item) {
return predicate.Run(item.get());
})) {
return;
@@ -140,7 +140,7 @@
WaitForItemAddition(predicate);
auto* const model = HoldingSpaceController::Get()->model();
- auto item_it = base::ranges::find_if(
+ auto item_it = std::ranges::find_if(
model->items(),
[&predicate](const auto& item) { return predicate.Run(item.get()); });
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_unittest.cc b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_unittest.cc
index 62cb573..6bcccc2 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_unittest.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_keyed_service_unittest.cc
@@ -196,7 +196,7 @@
result.emplace(
base::StrCat({kTotalCountV2HistogramPrefix, ".All.FileSystemType.",
holding_space_util::ToString(fs_type)}),
- std::vector<Bucket>({Bucket(/*sample=*/base::ranges::count(
+ std::vector<Bucket>({Bucket(/*sample=*/std::ranges::count(
model->items(), fs_type,
[&](const auto& item) {
return item->file().file_system_type;
@@ -209,8 +209,8 @@
result.emplace(base::StrCat({kTotalCountV2HistogramPrefix, ".",
holding_space_util::ToString(type)}),
std::vector<Bucket>({Bucket(
- /*sample=*/base::ranges::count(model->items(), type,
- &HoldingSpaceItem::type),
+ /*sample=*/std::ranges::count(model->items(), type,
+ &HoldingSpaceItem::type),
/*count=*/1u)}));
// Fill "HoldingSpace.Item.TotalCountV2.{type}.FileSystemType.{fs_type}".
@@ -220,7 +220,7 @@
holding_space_util::ToString(type), ".FileSystemType.",
holding_space_util::ToString(fs_type)}),
std::vector<Bucket>({Bucket(
- /*sample=*/base::ranges::count_if(
+ /*sample=*/std::ranges::count_if(
model->items(),
[&](const auto& item) {
return item->type() == type &&
@@ -252,7 +252,7 @@
// Case: Name *did* exist in other map.
for (const auto& bucket : buckets) {
auto bucket_it =
- base::ranges::find(result_buckets, bucket.min, &Bucket::min);
+ std::ranges::find(result_buckets, bucket.min, &Bucket::min);
// Case: Bucket did *not* exist in other map. Add bucket.
if (bucket_it == result_buckets.end()) {
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_persistence_delegate.cc b/chrome/browser/ui/ash/holding_space/holding_space_persistence_delegate.cc
index 3abb6f0..30ef5df6 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_persistence_delegate.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_persistence_delegate.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_persistence_delegate.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/public/cpp/holding_space/holding_space_file.h"
@@ -12,7 +14,6 @@
#include "ash/public/cpp/holding_space/holding_space_progress.h"
#include "ash/public/cpp/holding_space/holding_space_util.h"
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/file_manager/path_util.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -108,7 +109,7 @@
// Attempt to find the finalized `item` in persistent storage.
ScopedListPrefUpdate update(profile()->GetPrefs(), kPersistencePath);
base::Value::List& list = update.Get();
- auto item_it = base::ranges::find(
+ auto item_it = std::ranges::find(
list, item->id(), [](const base::Value& persisted_item) {
return HoldingSpaceItem::DeserializeId(persisted_item.GetDict());
});
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_suggestions_delegate.cc b/chrome/browser/ui/ash/holding_space/holding_space_suggestions_delegate.cc
index 6ccf6f1d..0c37492 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_suggestions_delegate.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_suggestions_delegate.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_suggestions_delegate.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/holding_space/holding_space_file.h"
#include "base/containers/adapters.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/file_manager/path_util.h"
#include "chrome/browser/ash/file_suggest/file_suggest_keyed_service_factory.h"
@@ -69,7 +70,7 @@
void HoldingSpaceSuggestionsDelegate::OnHoldingSpaceItemsAdded(
const std::vector<const HoldingSpaceItem*>& items) {
- if (base::ranges::any_of(items, [&](const HoldingSpaceItem* item) {
+ if (std::ranges::any_of(items, [&](const HoldingSpaceItem* item) {
return item->IsInitialized() &&
ItemIsPinnedSuggestion(item, suggestions_by_type_);
})) {
@@ -81,7 +82,7 @@
void HoldingSpaceSuggestionsDelegate::OnHoldingSpaceItemsRemoved(
const std::vector<const HoldingSpaceItem*>& items) {
- if (base::ranges::any_of(items, [&](const HoldingSpaceItem* item) {
+ if (std::ranges::any_of(items, [&](const HoldingSpaceItem* item) {
return item->IsInitialized() &&
ItemIsPinnedSuggestion(item, suggestions_by_type_);
})) {
@@ -168,8 +169,8 @@
// Extract file paths from `suggestions`.
std::vector<base::FilePath> updated_suggestions(suggestions->size());
- base::ranges::transform(*suggestions, updated_suggestions.begin(),
- &FileSuggestData::file_path);
+ std::ranges::transform(*suggestions, updated_suggestions.begin(),
+ &FileSuggestData::file_path);
// No-op if `updated_suggestions` are unchanged.
const HoldingSpaceItem::Type item_type = GetItemTypeFromSuggestionType(type);
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc b/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc
index 2d57dd1..f4c83f3 100644
--- a/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc
+++ b/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ui/ash/holding_space/holding_space_test_util.h"
+#include <algorithm>
+
#include "ash/public/cpp/holding_space/holding_space_controller.h"
#include "ash/public/cpp/holding_space/holding_space_file.h"
#include "ash/public/cpp/holding_space/holding_space_model.h"
#include "ash/public/cpp/holding_space/mock_holding_space_model_observer.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ui/ash/holding_space/holding_space_browsertest_base.h"
@@ -84,7 +85,7 @@
void WaitForItemRemoval(
base::FunctionRef<bool(const HoldingSpaceItem*)> predicate) {
auto* const model = HoldingSpaceController::Get()->model();
- if (base::ranges::none_of(model->items(), [&predicate](const auto& item) {
+ if (std::ranges::none_of(model->items(), [&predicate](const auto& item) {
return predicate(item.get());
})) {
return;
diff --git a/chrome/browser/ui/ash/input_method/candidate_view_unittest.cc b/chrome/browser/ui/ash/input_method/candidate_view_unittest.cc
index cd8ef5a6..cd8b6c6 100644
--- a/chrome/browser/ui/ash/input_method/candidate_view_unittest.cc
+++ b/chrome/browser/ui/ash/input_method/candidate_view_unittest.cc
@@ -11,9 +11,10 @@
#include <stddef.h>
+#include <algorithm>
+
#include "base/check.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
@@ -92,13 +93,13 @@
size_t GetHighlightedCount() const {
const auto& children = container_->children();
- return base::ranges::count_if(
+ return std::ranges::count_if(
children, [](const views::View* v) { return !!v->background(); });
}
int GetHighlightedIndex() const {
const auto& children = container_->children();
- const auto it = base::ranges::find_if(
+ const auto it = std::ranges::find_if(
children, [](const views::View* v) { return !!v->background(); });
return (it == children.cend()) ? -1 : std::distance(children.cbegin(), it);
}
diff --git a/chrome/browser/ui/ash/input_method/suggestion_window_view_unittest.cc b/chrome/browser/ui/ash/input_method/suggestion_window_view_unittest.cc
index 298d3d13..85ea5cc 100644
--- a/chrome/browser/ui/ash/input_method/suggestion_window_view_unittest.cc
+++ b/chrome/browser/ui/ash/input_method/suggestion_window_view_unittest.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/ash/input_method/suggestion_window_view.h"
+#include <algorithm>
#include <optional>
#include <string>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/ash/input_method/assistive_window_properties.h"
#include "chrome/browser/ui/ash/input_method/assistive_delegate.h"
@@ -70,7 +70,7 @@
const auto& children =
suggestion_window_view_->multiple_candidate_area_for_testing()
->children();
- return base::ranges::count_if(
+ return std::ranges::count_if(
children, [](const views::View* v) { return !!v->background(); });
}
@@ -78,7 +78,7 @@
const auto& children =
suggestion_window_view_->multiple_candidate_area_for_testing()
->children();
- const auto it = base::ranges::find_if(
+ const auto it = std::ranges::find_if(
children, [](const views::View* v) { return !!v->background(); });
return (it == children.cend())
? std::nullopt
diff --git a/chrome/browser/ui/ash/quick_insert/quick_insert_client_impl.cc b/chrome/browser/ui/ash/quick_insert/quick_insert_client_impl.cc
index 3935c5f..fb7691b 100644
--- a/chrome/browser/ui/ash/quick_insert/quick_insert_client_impl.cc
+++ b/chrome/browser/ui/ash/quick_insert/quick_insert_client_impl.cc
@@ -4,7 +4,9 @@
#include "chrome/browser/ui/ash/quick_insert/quick_insert_client_impl.h"
+#include <algorithm>
#include <cstdint>
+#include <functional>
#include <memory>
#include <optional>
#include <string>
@@ -30,8 +32,6 @@
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/notimplemented.h"
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ash/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ash/app_list/search/chrome_search_result.h"
@@ -173,10 +173,10 @@
CHECK(result);
}
- base::ranges::sort(results, base::ranges::greater(),
- [](const std::unique_ptr<ChromeSearchResult>& result) {
- return result->relevance();
- });
+ std::ranges::sort(results, std::ranges::greater(),
+ [](const std::unique_ptr<ChromeSearchResult>& result) {
+ return result->relevance();
+ });
for (const std::unique_ptr<ChromeSearchResult>& result : results) {
switch (result->result_type()) {
diff --git a/chrome/browser/ui/ash/session/session_controller_client_impl.cc b/chrome/browser/ui/ash/session/session_controller_client_impl.cc
index 6a9dd12..171b09d 100644
--- a/chrome/browser/ui/ash/session/session_controller_client_impl.cc
+++ b/chrome/browser/ui/ash/session/session_controller_client_impl.cc
@@ -14,7 +14,6 @@
#include "ash/public/cpp/session/session_types.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
@@ -510,8 +509,7 @@
AccountId account_id = UserManager::Get()->GetActiveUser()->GetAccountId();
// Get an iterator positioned at the active user.
- auto it =
- base::ranges::find(logged_in_users, account_id, &User::GetAccountId);
+ auto it = std::ranges::find(logged_in_users, account_id, &User::GetAccountId);
// Active user not found.
if (it == logged_in_users.end()) {
diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
index f9fc9a7f..41ed96a 100644
--- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
+++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include <vector>
@@ -12,7 +13,6 @@
#include "ash/shell.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/stringprintf.h"
@@ -791,13 +791,13 @@
auto is_hidden = [](const apps::Instance* instance) {
return instance->Window()->GetProperty(ash::kHideInShelfKey);
};
- EXPECT_EQ(1, base::ranges::count_if(instances, is_hidden));
+ EXPECT_EQ(1, std::ranges::count_if(instances, is_hidden));
// The hidden window should be task_id 2.
aura::Window* window1 =
- (*(base::ranges::find_if_not(instances, is_hidden)))->Window();
+ (*(std::ranges::find_if_not(instances, is_hidden)))->Window();
aura::Window* window2 =
- (*(base::ranges::find_if(instances, is_hidden)))->Window();
+ (*(std::ranges::find_if(instances, is_hidden)))->Window();
apps::InstanceState latest_state =
app_service_proxy_->InstanceRegistry().GetState(window1);
@@ -821,7 +821,7 @@
app_host()->OnTaskDestroyed(1);
instances = app_service_proxy_->InstanceRegistry().GetInstances(app_id);
EXPECT_EQ(1u, instances.size());
- EXPECT_EQ(0, base::ranges::count_if(instances, is_hidden));
+ EXPECT_EQ(0, std::ranges::count_if(instances, is_hidden));
// Close second window.
app_host()->OnTaskDestroyed(2);
@@ -861,7 +861,7 @@
auto is_hidden = [](const apps::Instance* instance) {
return instance->Window()->GetProperty(ash::kHideInShelfKey);
};
- EXPECT_EQ(1, base::ranges::count_if(instances, is_hidden));
+ EXPECT_EQ(1, std::ranges::count_if(instances, is_hidden));
// No windows should remain if we close the payment window
payment_window->CloseNow();
diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc
index 49690dc..4bb65e93 100644
--- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc
+++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.h"
+#include <algorithm>
#include <memory>
#include "ash/constants/ash_features.h"
@@ -14,7 +15,6 @@
#include "ash/public/cpp/window_properties.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/ash/app_list/arc/arc_app_utils.h"
@@ -335,7 +335,7 @@
// then removed. Since it is not registered we don't need to do anything
// anyways. As such, all which is left to do here is to get rid of our own
// reference.
- WindowList::iterator it = base::ranges::find(window_list_, update.Window());
+ WindowList::iterator it = std::ranges::find(window_list_, update.Window());
if (it != window_list_.end()) {
window_list_.erase(it);
}
@@ -470,8 +470,8 @@
std::vector<aura::Window*> AppServiceAppWindowShelfController::GetArcWindows() {
std::vector<aura::Window*> arc_windows;
- base::ranges::copy_if(window_list_, std::back_inserter(arc_windows),
- &ash::IsArcWindow);
+ std::ranges::copy_if(window_list_, std::back_inserter(arc_windows),
+ &ash::IsArcWindow);
return arc_windows;
}
diff --git a/chrome/browser/ui/ash/shelf/app_shortcut_shelf_item_controller.cc b/chrome/browser/ui/ash/shelf/app_shortcut_shelf_item_controller.cc
index 8841cdf..6bb4326 100644
--- a/chrome/browser/ui/ash/shelf/app_shortcut_shelf_item_controller.cc
+++ b/chrome/browser/ui/ash/shelf/app_shortcut_shelf_item_controller.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <memory>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ash/app_list/arc/arc_app_utils.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -109,7 +109,7 @@
size_t index = 0;
if (active_item) {
DCHECK(base::Contains(items, active_item));
- auto it = base::ranges::find(items, active_item);
+ auto it = std::ranges::find(items, active_item);
index = (it - items.cbegin() + 1) % items.size();
}
std::move(activate_callback).Run(items[index]);
@@ -489,7 +489,7 @@
return;
}
// Reset pointers to the closed browser, but leave menu indices intact.
- auto it = base::ranges::find(app_menu_browsers_, browser);
+ auto it = std::ranges::find(app_menu_browsers_, browser);
if (it != app_menu_browsers_.end()) {
*it = nullptr;
}
diff --git a/chrome/browser/ui/ash/shelf/app_window_shelf_item_controller.cc b/chrome/browser/ui/ash/shelf/app_window_shelf_item_controller.cc
index 5569662..54a71d9c 100644
--- a/chrome/browser/ui/ash/shelf/app_window_shelf_item_controller.cc
+++ b/chrome/browser/ui/ash/shelf/app_window_shelf_item_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/shelf/app_window_shelf_item_controller.h"
+#include <algorithm>
#include <iterator>
#include <utility>
@@ -11,7 +12,6 @@
#include "ash/public/cpp/window_properties.h"
#include "ash/wm/window_animations.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/ash/shelf/app_window_base.h"
#include "chrome/browser/ui/ash/shelf/chrome_shelf_controller.h"
#include "chrome/browser/ui/ash/shelf/shelf_context_menu.h"
@@ -43,7 +43,7 @@
const AppWindowShelfItemController::WindowList& windows) {
DCHECK(window_to_show);
- auto i = base::ranges::find(windows, window_to_show);
+ auto i = std::ranges::find(windows, window_to_show);
if (i != windows.end()) {
if (++i != windows.end()) {
window_to_show = *i;
@@ -94,7 +94,7 @@
AppWindowShelfItemController::WindowList::iterator
AppWindowShelfItemController::GetFromNativeWindow(aura::Window* window,
WindowList& list) {
- return base::ranges::find(list, window, &AppWindowBase::GetNativeWindow);
+ return std::ranges::find(list, window, &AppWindowBase::GetNativeWindow);
}
void AppWindowShelfItemController::RemoveWindow(AppWindowBase* app_window) {
@@ -106,11 +106,11 @@
if (app_window == last_active_window_) {
last_active_window_ = nullptr;
}
- auto iter = base::ranges::find(windows_, app_window);
+ auto iter = std::ranges::find(windows_, app_window);
if (iter != windows_.end()) {
windows_.erase(iter);
} else {
- iter = base::ranges::find(hidden_windows_, app_window);
+ iter = std::ranges::find(hidden_windows_, app_window);
if (iter == hidden_windows_.end()) {
return;
}
diff --git a/chrome/browser/ui/ash/shelf/browser_shortcut_shelf_item_controller.cc b/chrome/browser/ui/ash/shelf/browser_shortcut_shelf_item_controller.cc
index 227d1a3..90a666f 100644
--- a/chrome/browser/ui/ash/shelf/browser_shortcut_shelf_item_controller.cc
+++ b/chrome/browser/ui/ash/shelf/browser_shortcut_shelf_item_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/shelf/browser_shortcut_shelf_item_controller.h"
+#include <algorithm>
#include <limits>
#include <utility>
#include <vector>
@@ -14,7 +15,6 @@
#include "ash/wm/window_animations.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ash/app_restore/full_restore_service.h"
#include "chrome/browser/ash/app_restore/full_restore_service_factory.h"
@@ -353,7 +353,7 @@
// If there is more than one suitable browser, we advance to the next if
// |browser| is already active - or - check the last used browser if it can
// be used.
- std::vector<Browser*>::iterator i = base::ranges::find(items, browser);
+ std::vector<Browser*>::iterator i = std::ranges::find(items, browser);
if (i != items.end()) {
if (browser->window()->IsActive()) {
browser = (++i == items.end()) ? items[0] : *i;
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller.cc
index 89ca8233..65bb45a 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/shelf/chrome_shelf_controller.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
@@ -25,7 +26,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
@@ -232,7 +232,7 @@
// a set<AccountId>
std::string user_id =
multi_user_util::GetAccountIdFromProfile(profile).GetUserEmail();
- auto it = base::ranges::find(added_user_ids_waiting_for_profiles_, user_id);
+ auto it = std::ranges::find(added_user_ids_waiting_for_profiles_, user_id);
if (it != added_user_ids_waiting_for_profiles_.end()) {
added_user_ids_waiting_for_profiles_.erase(it);
AddUser(profile->GetOriginalProfile());
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
index 6c4bb7e..3dedf7b 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
@@ -1370,7 +1370,7 @@
syncer::SyncData GetSyncDataFor(std::string_view app_id) const {
auto sync_data = app_list_syncable_service_->GetAllSyncDataForTesting();
- auto itr = base::ranges::find(sync_data, app_id, [](const auto& sync_item) {
+ auto itr = std::ranges::find(sync_data, app_id, [](const auto& sync_item) {
return sync_item.GetSpecifics().app_list().item_id();
});
EXPECT_FALSE(itr == sync_data.end());
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.cc
index dcb4afd..de7509a 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/ui/ash/shelf/chrome_shelf_controller_util.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "ash/constants/web_app_id_constants.h"
#include "ash/public/cpp/shelf_item_delegate.h"
#include "ash/public/cpp/shelf_model.h"
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/apps/app_service/policy_util.h"
@@ -70,7 +71,7 @@
}
if (ash::DemoSession::Get() &&
- base::ranges::none_of(*policy_ids, [](const auto& policy_id) {
+ std::ranges::none_of(*policy_ids, [](const auto& policy_id) {
return ash::DemoSession::Get()->ShouldShowAppInShelf(policy_id);
})) {
return AppListControllerDelegate::PIN_EDITABLE;
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_prefs.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_prefs.cc
index 010f79a5..5bc35953 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_prefs.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_prefs.cc
@@ -28,7 +28,6 @@
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/browser/apps/app_preload_service/app_preload_service.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@@ -588,12 +587,12 @@
}
// Sort pins according their ordinals.
- base::ranges::sort(pin_infos, syncer::StringOrdinal::LessThanFn(),
- &PinInfo::item_ordinal);
+ std::ranges::sort(pin_infos, syncer::StringOrdinal::LessThanFn(),
+ &PinInfo::item_ordinal);
// Convert to ShelfID array.
std::vector<ash::ShelfID> pins;
- base::ranges::transform(
+ std::ranges::transform(
pin_infos, std::back_inserter(pins),
[](const auto& pin_info) { return ash::ShelfID(pin_info.app_id); });
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_prefs_unittest.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_prefs_unittest.cc
index 825b92f5..74fc1b5 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_prefs_unittest.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_prefs_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/shelf/chrome_shelf_prefs.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <vector>
@@ -15,7 +16,6 @@
#include "base/containers/contains.h"
#include "base/containers/to_vector.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/test/scoped_feature_list.h"
#include "build/branding_buildflags.h"
diff --git a/chrome/browser/ui/ash/wallpaper/test_wallpaper_controller.cc b/chrome/browser/ui/ash/wallpaper/test_wallpaper_controller.cc
index c77453bb..080820d6 100644
--- a/chrome/browser/ui/ash/wallpaper/test_wallpaper_controller.cc
+++ b/chrome/browser/ui/ash/wallpaper/test_wallpaper_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/wallpaper/test_wallpaper_controller.h"
+#include <algorithm>
#include <optional>
#include <string>
@@ -14,7 +15,6 @@
#include "ash/public/cpp/wallpaper/wallpaper_types.h"
#include "ash/webui/common/mojom/sea_pen.mojom.h"
#include "base/containers/adapters.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "components/account_id/account_id.h"
@@ -139,16 +139,16 @@
const AccountId& account_id,
const DailyGooglePhotosIdCache& ids) {
id_cache_.ShrinkToSize(0);
- base::ranges::for_each(base::Reversed(ids),
- [&](uint id) { id_cache_.Put(std::move(id)); });
+ std::ranges::for_each(base::Reversed(ids),
+ [&](uint id) { id_cache_.Put(std::move(id)); });
return true;
}
bool TestWallpaperController::GetDailyGooglePhotosWallpaperIdCache(
const AccountId& account_id,
DailyGooglePhotosIdCache& ids_out) const {
- base::ranges::for_each(base::Reversed(id_cache_),
- [&](uint id) { ids_out.Put(std::move(id)); });
+ std::ranges::for_each(base::Reversed(id_cache_),
+ [&](uint id) { ids_out.Put(std::move(id)); });
return true;
}
diff --git a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc
index 68b30fb..2934463 100644
--- a/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc
+++ b/chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/wallpaper/wallpaper_controller_client_impl.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -26,7 +27,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
@@ -664,7 +664,7 @@
base::RandomShuffle(photos.begin(), photos.end());
// Get the first photo from the shuffled set that is not in the LRU cache.
- auto selected_itr = base::ranges::find_if(
+ auto selected_itr = std::ranges::find_if(
photos,
[&ids](
const ash::personalization_app::mojom::GooglePhotosPhotoPtr& photo) {
diff --git a/chrome/browser/ui/ash/wm/coral_browsertest.cc b/chrome/browser/ui/ash/wm/coral_browsertest.cc
index b6ac6c8..f13d276 100644
--- a/chrome/browser/ui/ash/wm/coral_browsertest.cc
+++ b/chrome/browser/ui/ash/wm/coral_browsertest.cc
@@ -78,7 +78,7 @@
// Returns the native window associated with `swa_type`, if it exists.
aura::Window* GetNativeWindowForSwa(SystemWebAppType swa_type) {
BrowserList* browsers = BrowserList::GetInstance();
- auto it = base::ranges::find_if(*browsers, [swa_type](Browser* browser) {
+ auto it = std::ranges::find_if(*browsers, [swa_type](Browser* browser) {
return IsBrowserForSystemWebApp(browser, swa_type);
});
return it == browsers->end() ? nullptr : (*it)->window()->GetNativeWindow();
@@ -171,7 +171,7 @@
BrowserList* browsers = BrowserList::GetInstance();
ASSERT_EQ(browsers->size(), 4u);
// Verify the chrome browser.
- EXPECT_TRUE(base::ranges::any_of(*browsers, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browsers, [](Browser* browser) {
TabStripModel* tab_strip_model = browser->tab_strip_model();
return tab_strip_model->count() == 3 &&
tab_strip_model->GetWebContentsAt(0)->GetVisibleURL() ==
@@ -183,7 +183,7 @@
}));
// Verify the PWA.
- EXPECT_TRUE(base::ranges::any_of(*browsers, [](Browser* browser) {
+ EXPECT_TRUE(std::ranges::any_of(*browsers, [](Browser* browser) {
if (browser->type() != Browser::TYPE_APP) {
return false;
}
diff --git a/chrome/browser/ui/autofill/address_editor_controller_unittest.cc b/chrome/browser/ui/autofill/address_editor_controller_unittest.cc
index aa45738..381bb81 100644
--- a/chrome/browser/ui/autofill/address_editor_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/address_editor_controller_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/autofill/address_editor_controller.h"
+#include <algorithm>
#include <memory>
#include "base/callback_list.h"
-#include "base/ranges/algorithm.h"
#include "base/test/mock_callback.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/autofill/core/browser/data_manager/test_personal_data_manager.h"
@@ -126,8 +126,8 @@
// `country` is null when it represents a separator. There must be exactly 1
// separator in the country list.
EXPECT_EQ(
- base::ranges::count_if(controller_->GetCountryComboboxModel().countries(),
- [](const auto& country) { return !country; }),
+ std::ranges::count_if(controller_->GetCountryComboboxModel().countries(),
+ [](const auto& country) { return !country; }),
1l);
}
@@ -171,7 +171,7 @@
// to the set of editor fields.
for (auto type : std::vector<FieldType>{
ADDRESS_HOME_COUNTRY, PHONE_HOME_WHOLE_NUMBER, EMAIL_ADDRESS}) {
- EXPECT_EQ(base::ranges::count_if(
+ EXPECT_EQ(std::ranges::count_if(
controller_->editor_fields(),
[type](auto field) { return field.type == type; }),
1);
diff --git a/chrome/browser/ui/autofill/autofill_context_menu_manager.cc b/chrome/browser/ui/autofill/autofill_context_menu_manager.cc
index 00be2dae..946d1ce 100644
--- a/chrome/browser/ui/autofill/autofill_context_menu_manager.cc
+++ b/chrome/browser/ui/autofill/autofill_context_menu_manager.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/autofill/autofill_context_menu_manager.h"
+#include <algorithm>
#include <string>
#include "base/feature_list.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/app/vector_icons/vector_icons.h"
@@ -194,7 +194,7 @@
FieldGlobalId field_global_id = {
frame_token, FieldRendererId(params.field_renderer_id)};
auto field =
- base::ranges::find_if(*form, [&field_global_id](const auto& field) {
+ std::ranges::find_if(*form, [&field_global_id](const auto& field) {
return field->global_id() == field_global_id;
});
if (field != form->end()) {
diff --git a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
index 1b3d2a56..a016fcf 100644
--- a/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_keyboard_accessory_controller_impl.cc
@@ -605,8 +605,8 @@
void AutofillKeyboardAccessoryControllerImpl::
OrderSuggestionsAndCreateLabels() {
// If there is an Undo suggestion, move it to the front.
- if (auto it = base::ranges::find(suggestions_, SuggestionType::kUndoOrClear,
- &Suggestion::type);
+ if (auto it = std::ranges::find(suggestions_, SuggestionType::kUndoOrClear,
+ &Suggestion::type);
it != suggestions_.end()) {
std::rotate(suggestions_.begin(), it, it + 1);
}
diff --git a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
index 7673db1..fea5c26 100644
--- a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
+++ b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
@@ -173,8 +173,8 @@
&feature_engagement::kIPHAutofillVirtualCardCVCSuggestionFeature,
"autofill_virtual_card_cvc_suggestion_accepted"}});
if (auto it =
- base::ranges::find(kIphFeatures, suggestion.iph_metadata.feature,
- &IphEventPair::first);
+ std::ranges::find(kIphFeatures, suggestion.iph_metadata.feature,
+ &IphEventPair::first);
it != kIphFeatures.end()) {
feature_engagement::TrackerFactory::GetForBrowserContext(
contents->GetBrowserContext())
diff --git a/chrome/browser/ui/autofill/payments/offer_notification_controller_android.cc b/chrome/browser/ui/autofill/payments/offer_notification_controller_android.cc
index 7e06ee2..ef24e502 100644
--- a/chrome/browser/ui/autofill/payments/offer_notification_controller_android.cc
+++ b/chrome/browser/ui/autofill/payments/offer_notification_controller_android.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/ui/autofill/payments/offer_notification_controller_android.h"
+#include <algorithm>
#include <memory>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/android/resource_mapper.h"
#include "components/autofill/core/browser/data_model/autofill_offer_data.h"
#include "components/grit/components_scaled_resources.h"
diff --git a/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc b/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
index ab166d0..14a5434 100644
--- a/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
+++ b/chrome/browser/ui/autofill/payments/offer_notification_controller_android_browsertest.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/autofill/payments/offer_notification_controller_android.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/autofill/autofill_uitest_util.h"
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
index cd8a13ae..f9efb4851 100644
--- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
@@ -140,8 +140,8 @@
selection) {
CHECK(!selection.empty());
// Nodes must be not null.
- CHECK(base::ranges::all_of(selection,
- [](const BookmarkNode* node) { return node; }));
+ CHECK(std::ranges::all_of(selection,
+ [](const BookmarkNode* node) { return node; }));
// Check not repeated nodes.
std::set<const BookmarkNode*> nodes_set(selection.begin(), selection.end());
@@ -570,12 +570,12 @@
bool BookmarkContextMenuController::IsCommandIdEnabled(int command_id) const {
PrefService* prefs = profile_->GetPrefs();
- bool is_any_node_permanent = base::ranges::any_of(
+ bool is_any_node_permanent = std::ranges::any_of(
selection_,
[](const BookmarkNode* node) { return node->is_permanent_node(); });
bool can_edit =
prefs->GetBoolean(bookmarks::prefs::kEditBookmarksEnabled) &&
- base::ranges::all_of(selection_, [&](const BookmarkNode* node) {
+ std::ranges::all_of(selection_, [&](const BookmarkNode* node) {
return !bookmark_service_->IsNodeManaged(node);
});
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
index 711f306..4cc1f49 100644
--- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
+++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc
@@ -6,11 +6,12 @@
#include <stddef.h>
+#include <algorithm>
+
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/browser/bookmark_model.h"
@@ -147,10 +148,10 @@
// that we don't remove `parent_node_`.
// TODO(pbos): Look at returning -1 here if there's no default index. Right
// now a lot of code in Combobox assumes an index within `items_` bounds.
- auto it = base::ranges::find(items_, Item(parent_node_, Item::TYPE_NODE));
+ auto it = std::ranges::find(items_, Item(parent_node_, Item::TYPE_NODE));
if (it == items_.end()) {
- it = base::ranges::find(items_,
- Item(parent_node_, Item::TYPE_ALL_BOOKMARKS_NODE));
+ it = std::ranges::find(items_,
+ Item(parent_node_, Item::TYPE_ALL_BOOKMARKS_NODE));
}
return it == items_.end() ? 0 : static_cast<int>(it - items_.begin());
}
@@ -251,7 +252,7 @@
}
void RecentlyUsedFoldersComboModel::RemoveNode(const BookmarkNode* node) {
- auto it = base::ranges::find(items_, Item(node, Item::TYPE_NODE));
+ auto it = std::ranges::find(items_, Item(node, Item::TYPE_NODE));
if (it != items_.end()) {
items_.erase(it);
}
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index cc51ab0..aed09858 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <algorithm>
#include <array>
#include <memory>
#include <string>
@@ -20,7 +21,6 @@
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/strcat.h"
@@ -1411,7 +1411,7 @@
// Find the new browser.
BrowserList* browsers = BrowserList::GetInstance();
- auto new_browser_iter = base::ranges::find_if_not(
+ auto new_browser_iter = std::ranges::find_if_not(
*browsers, [this](Browser* b) { return b == browser(); });
ASSERT_NE(browsers->end(), new_browser_iter);
diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc
index b6c55117..05c8a81 100644
--- a/chrome/browser/ui/browser_finder.cc
+++ b/chrome/browser/ui/browser_finder.cc
@@ -6,8 +6,9 @@
#include <stdint.h>
+#include <algorithm>
+
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
@@ -308,7 +309,7 @@
Browser* FindBrowserWithTab(const WebContents* web_contents) {
DCHECK(web_contents);
auto& all_tabs = AllTabContentses();
- auto it = base::ranges::find(all_tabs, web_contents);
+ auto it = std::ranges::find(all_tabs, web_contents);
return (it == all_tabs.end()) ? nullptr : it.browser();
}
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index 28964a41..d9d178e 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/browser_list.h"
+#include <algorithm>
+
#include "base/auto_reset.h"
#include "base/check.h"
#include "base/containers/contains.h"
@@ -11,7 +13,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/lifetime/application_lifetime_desktop.h"
@@ -202,7 +203,7 @@
// calling before unload handlers.
skip_beforeunload =
skip_beforeunload &&
- base::ranges::none_of(browsers_to_close, &Browser::is_type_devtools);
+ std::ranges::none_of(browsers_to_close, &Browser::is_type_devtools);
TryToCloseBrowserList(browsers_to_close, on_close_success, on_close_aborted,
profile->GetPath(), skip_beforeunload);
}
@@ -366,7 +367,7 @@
// static
int BrowserList::GetOffTheRecordBrowsersActiveForProfile(Profile* profile) {
BrowserList* list = BrowserList::GetInstance();
- return base::ranges::count_if(*list, [profile](Browser* browser) {
+ return std::ranges::count_if(*list, [profile](Browser* browser) {
return browser->profile()->IsSameOrParent(profile) &&
browser->profile()->IsOffTheRecord() && !browser->is_type_devtools();
});
@@ -375,7 +376,7 @@
// static
size_t BrowserList::GetIncognitoBrowserCount() {
BrowserList* list = BrowserList::GetInstance();
- return base::ranges::count_if(*list, [](Browser* browser) {
+ return std::ranges::count_if(*list, [](Browser* browser) {
return browser->profile()->IsIncognitoProfile() &&
!browser->is_type_devtools();
});
@@ -384,7 +385,7 @@
// static
size_t BrowserList::GetGuestBrowserCount() {
BrowserList* list = BrowserList::GetInstance();
- return base::ranges::count_if(*list, [](Browser* browser) {
+ return std::ranges::count_if(*list, [](Browser* browser) {
return browser->profile()->IsGuestSession() && !browser->is_type_devtools();
});
}
@@ -392,7 +393,7 @@
// static
bool BrowserList::IsOffTheRecordBrowserInUse(Profile* profile) {
BrowserList* list = BrowserList::GetInstance();
- return base::ranges::any_of(*list, [profile](Browser* browser) {
+ return std::ranges::any_of(*list, [profile](Browser* browser) {
return browser->profile()->IsSameOrParent(profile) &&
browser->profile()->IsOffTheRecord();
});
@@ -408,7 +409,7 @@
// static
void BrowserList::RemoveBrowserFrom(Browser* browser,
BrowserVector* browser_list) {
- auto remove_browser = base::ranges::find(*browser_list, browser);
+ auto remove_browser = std::ranges::find(*browser_list, browser);
if (remove_browser != browser_list->end()) {
browser_list->erase(remove_browser);
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm
index 73c6e951..2890518 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm
@@ -4,11 +4,11 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
+#include <algorithm>
#include <string>
#include <vector>
#include "base/containers/span.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/user_action_tester.h"
#include "base/uuid.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
diff --git a/chrome/browser/ui/cocoa/task_manager_mac_browsertest.mm b/chrome/browser/ui/cocoa/task_manager_mac_browsertest.mm
index 2c438fa..a02c7c6 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac_browsertest.mm
+++ b/chrome/browser/ui/cocoa/task_manager_mac_browsertest.mm
@@ -13,8 +13,9 @@
#include <Foundation/Foundation.h>
#include <stddef.h>
+#include <algorithm>
+
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/pattern.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/task_manager/task_manager_browsertest_util.h"
@@ -108,8 +109,8 @@
// Looks up a tab based on its tab ID.
content::WebContents* FindWebContentsByTabId(SessionID tab_id) {
auto& all_tabs = AllTabContentses();
- auto it = base::ranges::find(all_tabs, tab_id,
- &sessions::SessionTabHelper::IdForTab);
+ auto it = std::ranges::find(all_tabs, tab_id,
+ &sessions::SessionTabHelper::IdForTab);
return (it == all_tabs.end()) ? nullptr : *it;
}
diff --git a/chrome/browser/ui/commerce/add_to_comparison_table_sub_menu_model.cc b/chrome/browser/ui/commerce/add_to_comparison_table_sub_menu_model.cc
index 0bec0c9..6b6765c5 100644
--- a/chrome/browser/ui/commerce/add_to_comparison_table_sub_menu_model.cc
+++ b/chrome/browser/ui/commerce/add_to_comparison_table_sub_menu_model.cc
@@ -111,10 +111,10 @@
const std::u16string& title = url_info.title;
std::vector<UrlInfo> existing_url_infos = set->url_infos();
- auto it = base::ranges::find_if(existing_url_infos,
- [&url](const UrlInfo& query_url_info) {
- return query_url_info.url == url;
- });
+ auto it = std::ranges::find_if(existing_url_infos,
+ [&url](const UrlInfo& query_url_info) {
+ return query_url_info.url == url;
+ });
// Add the URL to the set. If it is already in the set (because it was added
// after the menu was opened), then we still show the toast.
diff --git a/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc b/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc
index ee23ed9..76bf9d5 100644
--- a/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc
+++ b/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc
@@ -173,7 +173,7 @@
is_in_recommended_set_ = true;
} else {
GURL current_url = current_url_;
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
existing_url_infos, [¤t_url](const UrlInfo& query_url_info) {
return query_url_info.url == current_url;
});
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc
index 020817f..418e858a 100644
--- a/chrome/browser/ui/content_settings/content_setting_image_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/content_settings/content_setting_image_model.h"
+#include <algorithm>
#include <string>
#include <utility>
@@ -11,7 +12,6 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h"
@@ -1091,7 +1091,7 @@
return false;
}
bool has_blocked_requests =
- base::ranges::any_of(entries, [](auto& entry) { return !entry.second; });
+ std::ranges::any_of(entries, [](auto& entry) { return !entry.second; });
SetIcon(ContentSettingsType::STORAGE_ACCESS,
/*blocked=*/has_blocked_requests);
diff --git a/chrome/browser/ui/extensions/extensions_overrides/simple_overrides.cc b/chrome/browser/ui/extensions/extensions_overrides/simple_overrides.cc
index ba0f4a0d..280b42e 100644
--- a/chrome/browser/ui/extensions/extensions_overrides/simple_overrides.cc
+++ b/chrome/browser/ui/extensions/extensions_overrides/simple_overrides.cc
@@ -59,7 +59,7 @@
// Return true only if the extension has exclusively allowlisted keys in the
// manifest.
for (const auto [key, value] : extension.manifest()->available_values()) {
- if (base::ranges::find(kAllowlistedManifestKeys, key) ==
+ if (std::ranges::find(kAllowlistedManifestKeys, key) ==
std::end(kAllowlistedManifestKeys)) {
return false;
}
diff --git a/chrome/browser/ui/extensions/settings_overridden_params_providers.cc b/chrome/browser/ui/extensions/settings_overridden_params_providers.cc
index 159a481..60e06cf9 100644
--- a/chrome/browser/ui/extensions/settings_overridden_params_providers.cc
+++ b/chrome/browser/ui/extensions/settings_overridden_params_providers.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ui/extensions/settings_overridden_params_providers.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/extensions/extension_util.h"
@@ -41,8 +42,8 @@
auto* const settings = extensions::SettingsOverrides::Get(extension.get());
return settings && settings->search_engine;
};
- return base::ranges::count_if(registry->enabled_extensions(),
- overrides_search);
+ return std::ranges::count_if(registry->enabled_extensions(),
+ overrides_search);
}
// Returns true if the given |template_url| corresponds to Google search.
diff --git a/chrome/browser/ui/extensions/settings_overridden_params_providers_browsertest.cc b/chrome/browser/ui/extensions/settings_overridden_params_providers_browsertest.cc
index 8e0a829..76f7644 100644
--- a/chrome/browser/ui/extensions/settings_overridden_params_providers_browsertest.cc
+++ b/chrome/browser/ui/extensions/settings_overridden_params_providers_browsertest.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/extensions/settings_overridden_params_providers.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
@@ -68,7 +69,7 @@
TemplateURLService* const template_url_service = GetTemplateURLService();
TemplateURLService::TemplateURLVector template_urls =
template_url_service->GetTemplateURLs();
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
template_urls, [template_url_service, new_search_shows_in_default_list](
const TemplateURL* turl) {
return !turl->HasGoogleBaseURLs(
@@ -415,7 +416,7 @@
TemplateURLService* const template_url_service = GetTemplateURLService();
TemplateURLService::TemplateURLVector template_urls =
template_url_service->GetTemplateURLs();
- auto iter = base::ranges::find_if_not(
+ auto iter = std::ranges::find_if_not(
template_urls, [template_url_service](const TemplateURL* turl) {
// For the test, we can be a bit lazier and just use HasGoogleBaseURLs()
// instead of getting the full search URL.
diff --git a/chrome/browser/ui/global_error/global_error_service.cc b/chrome/browser/ui/global_error/global_error_service.cc
index e172e47..81f15bfc 100644
--- a/chrome/browser/ui/global_error/global_error_service.cc
+++ b/chrome/browser/ui/global_error/global_error_service.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <algorithm>
+
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
@@ -46,7 +47,7 @@
void GlobalErrorService::RemoveUnownedGlobalError(GlobalError* error) {
DCHECK(owned_errors_.find(error) == owned_errors_.end());
- all_errors_.erase(base::ranges::find(all_errors_, error));
+ all_errors_.erase(std::ranges::find(all_errors_, error));
GlobalErrorBubbleViewBase* bubble = error->GetBubbleView();
if (bubble) {
bubble->CloseBubbleView();
diff --git a/chrome/browser/ui/global_media_controls/cast_media_notification_producer.cc b/chrome/browser/ui/global_media_controls/cast_media_notification_producer.cc
index 1dbcb637..467cfec1 100644
--- a/chrome/browser/ui/global_media_controls/cast_media_notification_producer.cc
+++ b/chrome/browser/ui/global_media_controls/cast_media_notification_producer.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/ui/global_media_controls/cast_media_notification_producer.h"
+#include <algorithm>
#include <map>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/profiles/profile.h"
@@ -168,8 +168,8 @@
continue;
}
- auto item_it = base::ranges::find(items_, route.media_route_id(),
- &Items::value_type::first);
+ auto item_it = std::ranges::find(items_, route.media_route_id(),
+ &Items::value_type::first);
if (item_it == items_.end()) {
mojo::Remote<media_router::mojom::MediaController> controller_remote;
mojo::PendingReceiver<media_router::mojom::MediaController>
@@ -203,7 +203,6 @@
}
bool CastMediaNotificationProducer::HasLocalMediaRoute() const {
- return base::ranges::any_of(items_,
- &CastMediaNotificationItem::route_is_local,
- &Items::value_type::second);
+ return std::ranges::any_of(items_, &CastMediaNotificationItem::route_is_local,
+ &Items::value_type::second);
}
diff --git a/chrome/browser/ui/global_media_controls/media_notification_device_monitor.cc b/chrome/browser/ui/global_media_controls/media_notification_device_monitor.cc
index 22cfb11..e70e371 100644
--- a/chrome/browser/ui/global_media_controls/media_notification_device_monitor.cc
+++ b/chrome/browser/ui/global_media_controls/media_notification_device_monitor.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/global_media_controls/media_notification_device_monitor.h"
+#include <algorithm>
#include <iterator>
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -131,10 +131,10 @@
return;
}
- if (!base::ranges::equal(descriptions, device_ids_, std::equal_to<>(),
- &media::AudioDeviceDescription::unique_id)) {
+ if (!std::ranges::equal(descriptions, device_ids_, std::equal_to<>(),
+ &media::AudioDeviceDescription::unique_id)) {
device_ids_.clear();
- base::ranges::transform(
+ std::ranges::transform(
descriptions, std::back_inserter(device_ids_),
[](auto& description) { return std::move(description.unique_id); });
NotifyObservers();
diff --git a/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl.cc b/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl.cc
index 8a4fa64..fb5c5e2 100644
--- a/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl.cc
+++ b/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/global_media_controls/media_notification_device_monitor.h"
#include "content/public/browser/audio_service.h"
#include "media/audio/audio_device_description.h"
@@ -18,7 +17,7 @@
// overwritten with |media::AudioDeviceDescription::kDefaultDeviceId|.
void MaybeRemoveDefaultDevice(media::AudioDeviceDescriptions& descriptions) {
// Determine which of the audio devices is the fallback "default" device.
- auto default_device_it = base::ranges::find(
+ auto default_device_it = std::ranges::find(
descriptions, media::AudioDeviceDescription::kDefaultDeviceId,
&media::AudioDeviceDescription::unique_id);
diff --git a/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl_unittest.cc b/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl_unittest.cc
index e02e3166..22ae7df 100644
--- a/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl_unittest.cc
+++ b/chrome/browser/ui/global_media_controls/media_notification_device_provider_impl_unittest.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ui/global_media_controls/media_notification_device_provider_impl.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "media/audio/audio_device_description.h"
#include "media/audio/audio_system.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -59,7 +60,7 @@
bool DescriptionsAreEqual(const media::AudioDeviceDescriptions& lhs,
const media::AudioDeviceDescriptions& rhs) {
- return base::ranges::equal(lhs, rhs, [](const auto& lhs, const auto& rhs) {
+ return std::ranges::equal(lhs, rhs, [](const auto& lhs, const auto& rhs) {
// Group IDs are not used by this test and are therefore ignored in
// comparison.
return lhs.device_name == rhs.device_name && lhs.unique_id == rhs.unique_id;
diff --git a/chrome/browser/ui/global_media_controls/media_notification_service.cc b/chrome/browser/ui/global_media_controls/media_notification_service.cc
index d9868b3..6bb92e0 100644
--- a/chrome/browser/ui/global_media_controls/media_notification_service.cc
+++ b/chrome/browser/ui/global_media_controls/media_notification_service.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/global_media_controls/media_notification_service.h"
+#include <algorithm>
#include <memory>
#include "base/callback_list.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/unguessable_token.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/media/router/media_router_feature.h"
@@ -585,7 +585,7 @@
content::WebContents* web_contents) const {
DCHECK(web_contents);
auto item_ids = media_session_item_producer_->GetActiveControllableItemIds();
- return base::ranges::any_of(item_ids, [web_contents](const auto& item_id) {
+ return std::ranges::any_of(item_ids, [web_contents](const auto& item_id) {
return web_contents ==
content::MediaSession::GetWebContentsFromRequestId(item_id);
});
diff --git a/chrome/browser/ui/hats/hats_service_desktop.cc b/chrome/browser/ui/hats/hats_service_desktop.cc
index dd66b37..5cabe41 100644
--- a/chrome/browser/ui/hats/hats_service_desktop.cc
+++ b/chrome/browser/ui/hats/hats_service_desktop.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/hats/hats_service_desktop.h"
+#include <algorithm>
#include <memory>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/values.h"
#include "base/version.h"
@@ -585,10 +585,10 @@
// take a survey from the same trigger, regardless of whether the survey was
// updated.
auto trigger_survey_config =
- base::ranges::find(survey_configs_by_triggers_, trigger_id,
- [](const SurveyConfigs::value_type& pair) {
- return pair.second.trigger_id;
- });
+ std::ranges::find(survey_configs_by_triggers_, trigger_id,
+ [](const SurveyConfigs::value_type& pair) {
+ return pair.second.trigger_id;
+ });
CHECK(trigger_survey_config != survey_configs_by_triggers_.end(),
base::NotFatalUntil::M130);
diff --git a/chrome/browser/ui/hid/hid_chooser_controller.cc b/chrome/browser/ui/hid/hid_chooser_controller.cc
index 3c4908a..15e6cfc 100644
--- a/chrome/browser/ui/hid/hid_chooser_controller.cc
+++ b/chrome/browser/ui/hid/hid_chooser_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/hid/hid_chooser_controller.h"
+#include <algorithm>
#include <utility>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/chooser_controller/title_util.h"
#include "chrome/browser/hid/hid_chooser_context.h"
@@ -68,7 +68,7 @@
}
} else if (filter->usage->is_usage_and_page()) {
const auto& usage_and_page = filter->usage->get_usage_and_page();
- if (base::ranges::none_of(
+ if (std::ranges::none_of(
device.collections,
[&usage_and_page](const device::mojom::HidCollectionInfoPtr& c) {
return usage_and_page->usage_page == c->usage->usage_page &&
@@ -242,7 +242,7 @@
void HidChooserController::OnDeviceRemoved(
const device::mojom::HidDeviceInfo& device) {
auto id = PhysicalDeviceIdFromDeviceInfo(device);
- auto items_it = base::ranges::find(items_, id);
+ auto items_it = std::ranges::find(items_, id);
if (items_it == items_.end()) {
return;
}
@@ -413,8 +413,8 @@
auto physical_device_it = device_map_.find(id);
CHECK(physical_device_it != device_map_.end(), base::NotFatalUntil::M130);
auto& device_infos = physical_device_it->second;
- auto device_it = base::ranges::find(device_infos, device.guid,
- &device::mojom::HidDeviceInfo::guid);
+ auto device_it = std::ranges::find(device_infos, device.guid,
+ &device::mojom::HidDeviceInfo::guid);
CHECK(device_it != device_infos.end(), base::NotFatalUntil::M130);
*device_it = device.Clone();
}
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc
index ff28bc2..5540315 100644
--- a/chrome/browser/ui/hung_plugin_tab_helper.cc
+++ b/chrome/browser/ui/hung_plugin_tab_helper.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/hung_plugin_tab_helper.h"
+#include <algorithm>
#include <memory>
#include "base/files/file_path.h"
@@ -11,7 +12,6 @@
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
#include "base/process/process.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/browser/hang_monitor/hang_crash_dump.h"
#include "chrome/browser/plugins/hung_plugin_infobar_delegate.h"
@@ -70,8 +70,8 @@
// For now, just do a brute-force search to see if we have this plugin. Since
// we'll normally have 0 or 1, this is fast.
const auto i =
- base::ranges::find(hung_plugins_, plugin_path,
- [](const auto& elem) { return elem.second->path; });
+ std::ranges::find(hung_plugins_, plugin_path,
+ [](const auto& elem) { return elem.second->path; });
if (i != hung_plugins_.end()) {
if (i->second->infobar) {
infobars::ContentInfoBarManager* infobar_manager =
@@ -121,8 +121,8 @@
void HungPluginTabHelper::OnInfoBarRemoved(infobars::InfoBar* infobar,
bool animate) {
const auto i =
- base::ranges::find(hung_plugins_, infobar,
- [](const auto& elem) { return elem.second->infobar; });
+ std::ranges::find(hung_plugins_, infobar,
+ [](const auto& elem) { return elem.second->infobar; });
if (i != hung_plugins_.end()) {
PluginState* state = i->second.get();
state->infobar = nullptr;
diff --git a/chrome/browser/ui/hung_renderer/hung_renderer_core.cc b/chrome/browser/ui/hung_renderer/hung_renderer_core.cc
index 4f64cf8b..61165f8 100644
--- a/chrome/browser/ui/hung_renderer/hung_renderer_core.cc
+++ b/chrome/browser/ui/hung_renderer/hung_renderer_core.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/hung_renderer/hung_renderer_core.h"
+#include <algorithm>
+
#include "base/i18n/rtl.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
@@ -80,13 +81,12 @@
return IsWebContentsHung(web_contents, hung_process) &&
!web_contents->IsCrashed();
};
- base::ranges::copy_if(AllTabContentses(), std::back_inserter(result),
- is_hung);
+ std::ranges::copy_if(AllTabContentses(), std::back_inserter(result), is_hung);
// Move |hung_web_contents| to the front. It might be missing from the
// initial |results| when it hasn't yet committed a navigation into the hung
// process.
- auto first = base::ranges::find(result, hung_web_contents);
+ auto first = std::ranges::find(result, hung_web_contents);
if (first != result.end()) {
std::rotate(result.begin(), first, std::next(first));
} else {
diff --git a/chrome/browser/ui/login/login_handler_browsertest.cc b/chrome/browser/ui/login/login_handler_browsertest.cc
index 0de4671c..68e3a0a 100644
--- a/chrome/browser/ui/login/login_handler_browsertest.cc
+++ b/chrome/browser/ui/login/login_handler_browsertest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/login/login_handler.h"
+#include <algorithm>
#include <list>
#include <map>
#include <tuple>
@@ -13,7 +14,6 @@
#include "base/location.h"
#include "base/metrics/field_trial.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
@@ -902,7 +902,7 @@
for (int i = 0; i < kMultiRealmTestRealmCount; ++i) {
auto handlers = LoginHandler::GetAllLoginHandlersForTest();
auto it =
- base::ranges::find_if(handlers, [&seen_realms](LoginHandler* handler) {
+ std::ranges::find_if(handlers, [&seen_realms](LoginHandler* handler) {
return seen_realms.count(handler->auth_info().realm) == 0;
});
ASSERT_TRUE(it != handlers.end());
diff --git a/chrome/browser/ui/media_router/media_route_starter.cc b/chrome/browser/ui/media_router/media_route_starter.cc
index f2ded47..509f0d9d5b 100644
--- a/chrome/browser/ui/media_router/media_route_starter.cc
+++ b/chrome/browser/ui/media_router/media_route_starter.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/media_router/media_route_starter.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -96,7 +97,7 @@
// If |start_presentation_context_| still exists, then it means presentation
// route request was never attempted.
if (start_presentation_context_) {
- bool presentation_sinks_available = base::ranges::any_of(
+ bool presentation_sinks_available = std::ranges::any_of(
GetQueryResultManager()->GetSinksWithCastModes(),
[](const MediaSinkWithCastModes& sink) {
return base::Contains(sink.cast_modes, MediaCastMode::PRESENTATION) ||
diff --git a/chrome/browser/ui/media_router/media_route_starter_unittest.cc b/chrome/browser/ui/media_router/media_route_starter_unittest.cc
index c57add5f..533aa8e 100644
--- a/chrome/browser/ui/media_router/media_route_starter_unittest.cc
+++ b/chrome/browser/ui/media_router/media_route_starter_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/media_router/media_route_starter.h"
+#include <algorithm>
+
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "build/build_config.h"
#include "build/buildflag.h"
@@ -200,7 +201,7 @@
// this to occur).
ON_CALL(*media_router(), UnregisterMediaSinksObserver(_))
.WillByDefault([this](MediaSinksObserver* observer) {
- auto it = base::ranges::find(media_sinks_observers_, observer);
+ auto it = std::ranges::find(media_sinks_observers_, observer);
if (it != media_sinks_observers_.end()) {
media_sinks_observers_.erase(it);
}
diff --git a/chrome/browser/ui/media_router/media_router_ui.cc b/chrome/browser/ui/media_router/media_router_ui.cc
index 0ee26f0..a39edb7 100644
--- a/chrome/browser/ui/media_router/media_router_ui.cc
+++ b/chrome/browser/ui/media_router/media_router_ui.cc
@@ -435,8 +435,8 @@
std::vector<UIMediaSink> media_sinks;
for (const MediaSinkWithCastModes& sink : GetEnabledSinks()) {
- auto route_it = base::ranges::find(routes(), sink.sink.id(),
- &MediaRoute::media_sink_id);
+ auto route_it =
+ std::ranges::find(routes(), sink.sink.id(), &MediaRoute::media_sink_id);
const MediaRoute* route = route_it == routes().end() ? nullptr : &*route_it;
media_sinks.push_back(ConvertToUISink(sink, route, issue_));
}
diff --git a/chrome/browser/ui/media_router/query_result_manager.cc b/chrome/browser/ui/media_router/query_result_manager.cc
index 58841e9..8759d04 100644
--- a/chrome/browser/ui/media_router/query_result_manager.cc
+++ b/chrome/browser/ui/media_router/query_result_manager.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/media_router/query_result_manager.h"
+#include <algorithm>
#include <unordered_set>
#include <utility>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "components/media_router/browser/media_router.h"
#include "components/media_router/browser/media_sinks_observer.h"
#include "content/public/browser/browser_thread.h"
@@ -278,7 +278,7 @@
bool has_cast_mode = cast_mode_it != cast_mode_sources_.end();
// If a source has already been registered, then it must be associated with
// |cast_mode|.
- return base::ranges::none_of(sources, [=, this](const MediaSource& source) {
+ return std::ranges::none_of(sources, [=, this](const MediaSource& source) {
return base::Contains(sinks_observers_, source) &&
(!has_cast_mode || !base::Contains(cast_mode_it->second, source));
});
diff --git a/chrome/browser/ui/omnibox/omnibox_pedal_implementations_unittest.cc b/chrome/browser/ui/omnibox/omnibox_pedal_implementations_unittest.cc
index 4217e7b..4bfc8b413 100644
--- a/chrome/browser/ui/omnibox/omnibox_pedal_implementations_unittest.cc
+++ b/chrome/browser/ui/omnibox/omnibox_pedal_implementations_unittest.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
@@ -17951,7 +17950,7 @@
sequence.ResetLinks();
return pedal.second->IsConceptMatch(sequence);
};
- auto iter = base::ranges::find_if(pedals, is_match);
+ auto iter = std::ranges::find_if(pedals, is_match);
EXPECT_NE(iter, pedals.end()) << "Pedal not found for: " << expression;
EXPECT_EQ(iter->second.get(), canonical_pedal)
<< "Found wrong Pedal for: " << expression;
diff --git a/chrome/browser/ui/page_info/page_info_unittest.cc b/chrome/browser/ui/page_info/page_info_unittest.cc
index fbfbca6d..69e1887 100644
--- a/chrome/browser/ui/page_info/page_info_unittest.cc
+++ b/chrome/browser/ui/page_info/page_info_unittest.cc
@@ -347,9 +347,9 @@
const PermissionInfoList& permissions,
const base::Location& location = FROM_HERE) {
std::set<ContentSettingsType> actual_types;
- base::ranges::transform(permissions,
- std::inserter(actual_types, actual_types.end()),
- [](const auto& p) { return p.type; });
+ std::ranges::transform(permissions,
+ std::inserter(actual_types, actual_types.end()),
+ [](const auto& p) { return p.type; });
EXPECT_THAT(actual_types, expected_types)
<< "(expected at " << location.ToString() << ")";
diff --git a/chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc
index bf46e1ef..8e45b9f 100644
--- a/chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc
+++ b/chrome/browser/ui/passwords/bubble_controllers/manage_passwords_bubble_controller.cc
@@ -290,7 +290,7 @@
if (!delegate_) {
return false;
}
- return base::ranges::any_of(
+ return std::ranges::any_of(
GetCredentials(),
[&username](const std::unique_ptr<password_manager::PasswordForm>& form) {
return form->username_value == username;
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc
index 77686bed..2cd6c51 100644
--- a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc
+++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/metrics/field_trial_params.h"
-#include "base/ranges/algorithm.h"
#include "base/time/default_clock.h"
#include "chrome/browser/password_manager/profile_password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -75,7 +76,7 @@
const std::vector<std::unique_ptr<password_manager::PasswordForm>>& forms) {
std::vector<password_manager::PasswordForm> result;
result.reserve(forms.size());
- base::ranges::transform(
+ std::ranges::transform(
forms, std::back_inserter(result),
&std::unique_ptr<password_manager::PasswordForm>::operator*);
return result;
diff --git a/chrome/browser/ui/passwords/manage_passwords_state.cc b/chrome/browser/ui/passwords/manage_passwords_state.cc
index de0c70cd..c89a40d 100644
--- a/chrome/browser/ui/passwords/manage_passwords_state.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_state.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/passwords/manage_passwords_state.h"
+#include <algorithm>
#include <utility>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "components/autofill/core/browser/logging/log_manager.h"
#include "components/autofill/core/browser/logging/log_router.h"
#include "components/password_manager/core/browser/browser_save_password_progress_logger.h"
@@ -48,7 +48,7 @@
// Returns true if the form was found and updated.
bool UpdateFormInVector(const PasswordForm& updated_form,
std::vector<std::unique_ptr<PasswordForm>>* forms) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
*forms, [&updated_form](const std::unique_ptr<PasswordForm>& form) {
return ArePasswordFormUniqueKeysEqual(*form, updated_form);
});
@@ -63,7 +63,7 @@
// Returns true iff the form was deleted.
bool RemoveFormFromVector(const PasswordForm& form_to_delete,
std::vector<std::unique_ptr<PasswordForm>>* forms) {
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
*forms, [&form_to_delete](const std::unique_ptr<PasswordForm>& form) {
return ArePasswordFormUniqueKeysEqual(*form, form_to_delete);
});
@@ -167,7 +167,7 @@
// pending password is already present in the `local_credentials_forms_`. That
// can happen when this is a confirmation of a password update done via
// CredentialManager.
- auto it = base::ranges::find_if(
+ auto it = std::ranges::find_if(
local_credentials_forms_,
[this](const std::unique_ptr<PasswordForm>& form) {
return ArePasswordFormUniqueKeysEqual(
diff --git a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
index 28c4655..911218cc 100644
--- a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/passwords/manage_passwords_state.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/mock_callback.h"
#include "components/password_manager/core/browser/mock_password_form_manager_for_ui.h"
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index 569077e..52f7726f 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -15,7 +16,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/timer/timer.h"
@@ -140,7 +140,7 @@
const password_manager::InteractionsStats* FindStatsByUsername(
base::span<const password_manager::InteractionsStats> stats,
const std::u16string& username) {
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
stats, username, &password_manager::InteractionsStats::username_value);
return it == stats.end() ? nullptr : &*it;
}
@@ -396,7 +396,7 @@
return;
}
- const bool has_unnotified_shared_credentials = base::ranges::any_of(
+ const bool has_unnotified_shared_credentials = std::ranges::any_of(
GetCurrentForms(),
[](const std::unique_ptr<password_manager::PasswordForm>& form) {
return form->type ==
@@ -411,7 +411,7 @@
return;
}
- const bool has_non_empty_note = !base::ranges::all_of(
+ const bool has_non_empty_note = !std::ranges::all_of(
GetCurrentForms(), &std::u16string::empty,
&password_manager::PasswordForm::GetNoteWithEmptyUniqueDisplayName);
// Only one of these promos will be able to show. Try the more specific one
diff --git a/chrome/browser/ui/profiles/profile_picker.cc b/chrome/browser/ui/profiles/profile_picker.cc
index 7d27468..f36a769 100644
--- a/chrome/browser/ui/profiles/profile_picker.cc
+++ b/chrome/browser/ui/profiles/profile_picker.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/profiles/profile_picker.h"
+#include <algorithm>
#include <string>
#include "base/containers/flat_set.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
@@ -160,7 +160,7 @@
std::vector<ProfileAttributesEntry*> profile_attributes =
profile_manager->GetProfileAttributesStorage().GetAllProfilesAttributes();
- int number_of_active_profiles = base::ranges::count_if(
+ int number_of_active_profiles = std::ranges::count_if(
profile_attributes, [](ProfileAttributesEntry* entry) {
return (base::Time::Now() - entry->GetActiveTime() <
kActiveTimeThreshold);
diff --git a/chrome/browser/ui/safety_hub/extensions_result.cc b/chrome/browser/ui/safety_hub/extensions_result.cc
index 53e09b8..33b4982c 100644
--- a/chrome/browser/ui/safety_hub/extensions_result.cc
+++ b/chrome/browser/ui/safety_hub/extensions_result.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/safety_hub/extensions_result.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/extensions/extension_management.h"
@@ -141,8 +141,8 @@
if (!is_unpublished_extensions_only_) {
return false;
}
- return !base::ranges::includes(previous_triggering_extensions,
- triggering_extensions_);
+ return !std::ranges::includes(previous_triggering_extensions,
+ triggering_extensions_);
}
std::u16string SafetyHubExtensionsResult::GetNotificationString() const {
diff --git a/chrome/browser/ui/safety_hub/notification_permission_review_service.cc b/chrome/browser/ui/safety_hub/notification_permission_review_service.cc
index 55d5873..7c599de6 100644
--- a/chrome/browser/ui/safety_hub/notification_permission_review_service.cc
+++ b/chrome/browser/ui/safety_hub/notification_permission_review_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/safety_hub/notification_permission_review_service.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <set>
@@ -13,7 +14,6 @@
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/safety_hub/safety_hub_service.h"
@@ -175,7 +175,7 @@
*notification_permission.FindString(kSafetyHubOriginKey)));
}
std::set<ContentSettingsPattern> new_origins = GetOrigins();
- return !base::ranges::includes(old_origins, new_origins);
+ return !std::ranges::includes(old_origins, new_origins);
}
std::u16string NotificationPermissionsReviewService::
diff --git a/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc b/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
index 21cedf7d..c953c5d0 100644
--- a/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
+++ b/chrome/browser/ui/safety_hub/unused_site_permissions_service.cc
@@ -307,7 +307,7 @@
}
std::set<ContentSettingsPattern> new_origins = GetRevokedOrigins();
- return !base::ranges::includes(old_origins, new_origins);
+ return !std::ranges::includes(old_origins, new_origins);
}
std::u16string UnusedSitePermissionsService::UnusedSitePermissionsResult::
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index dd63e30..923add97 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/search_engines/template_url_table_model.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <tuple>
@@ -13,7 +14,6 @@
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/i18n/string_compare.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/grit/generated_resources.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
@@ -134,8 +134,8 @@
}
}
- base::ranges::sort(active_entries, OrderByManagedAndAlphabetically());
- base::ranges::sort(other_entries, OrderByManagedAndAlphabetically());
+ std::ranges::sort(active_entries, OrderByManagedAndAlphabetically());
+ std::ranges::sort(other_entries, OrderByManagedAndAlphabetically());
last_search_engine_index_ = default_entries.size();
last_active_engine_index_ = last_search_engine_index_ + active_entries.size();
diff --git a/chrome/browser/ui/serial/serial_chooser_controller.cc b/chrome/browser/ui/serial/serial_chooser_controller.cc
index 0a72bc4..2736675 100644
--- a/chrome/browser/ui/serial/serial_chooser_controller.cc
+++ b/chrome/browser/ui/serial/serial_chooser_controller.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/serial/serial_chooser_controller.h"
+#include <algorithm>
#include <utility>
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/unguessable_token.h"
@@ -185,7 +185,7 @@
bool SerialChooserController::DisplayServiceClassId(
const device::mojom::SerialPortInfo& port) const {
CHECK_EQ(port.type, device::mojom::SerialPortType::BLUETOOTH_CLASSIC_RFCOMM);
- return base::ranges::any_of(
+ return std::ranges::any_of(
ports_, [&port](const device::mojom::SerialPortInfoPtr& p) {
return p->token != port.token &&
p->type == SerialPortType::BLUETOOTH_CLASSIC_RFCOMM &&
@@ -348,8 +348,8 @@
void SerialChooserController::OnPortRemoved(
const device::mojom::SerialPortInfo& port) {
- const auto it = base::ranges::find(ports_, port.token,
- &device::mojom::SerialPortInfo::token);
+ const auto it = std::ranges::find(ports_, port.token,
+ &device::mojom::SerialPortInfo::token);
if (it != ports_.end()) {
const size_t index = it - ports_.begin();
ports_.erase(it);
diff --git a/chrome/browser/ui/settings_window_manager_browsertest_chromeos.cc b/chrome/browser/ui/settings_window_manager_browsertest_chromeos.cc
index 462ea1f94..598fa1c 100644
--- a/chrome/browser/ui/settings_window_manager_browsertest_chromeos.cc
+++ b/chrome/browser/ui/settings_window_manager_browsertest_chromeos.cc
@@ -4,9 +4,10 @@
#include <stddef.h>
+#include <algorithm>
+
#include "ash/webui/settings/public/constants/routes.mojom.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/test_future.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
@@ -41,7 +42,7 @@
// Return the number of windows that hosts OS Settings.
size_t GetNumberOfSettingsWindows() {
auto* browser_list = BrowserList::GetInstance();
- return base::ranges::count_if(*browser_list, [](Browser* browser) {
+ return std::ranges::count_if(*browser_list, [](Browser* browser) {
return ash::IsBrowserForSystemWebApp(browser,
ash::SystemWebAppType::SETTINGS);
});
diff --git a/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_manager.cc b/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_manager.cc
index 008c3b9..cc0a63c 100644
--- a/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_manager.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_manager.cc
@@ -222,7 +222,7 @@
void DefaultBrowserPromptManager::OnInfoBarRemoved(infobars::InfoBar* infobar,
bool animate) {
- auto infobars_entry = base::ranges::find(
+ auto infobars_entry = std::ranges::find(
infobars_, infobar, &decltype(infobars_)::value_type::second);
if (infobars_entry == infobars_.end()) {
return;
diff --git a/chrome/browser/ui/startup/startup_browser_creator_corrupt_profiles_browsertest_win.cc b/chrome/browser/ui/startup/startup_browser_creator_corrupt_profiles_browsertest_win.cc
index bd129b3..0f4dd63 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_corrupt_profiles_browsertest_win.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_corrupt_profiles_browsertest_win.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <string>
#include <vector>
@@ -11,7 +12,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/test/test_file_util.h"
@@ -54,7 +54,7 @@
browser->profile()->GetBaseName().AsUTF8Unsafe());
}
- if (!base::ranges::is_permutation(actual_basepaths, expected_basepaths)) {
+ if (!std::ranges::is_permutation(actual_basepaths, expected_basepaths)) {
ADD_FAILURE()
<< "Expected profile paths are different from actual profile paths."
"\n Actual profile paths: "
diff --git a/chrome/browser/ui/startup/startup_tab_provider.cc b/chrome/browser/ui/startup/startup_tab_provider.cc
index 95797701..25d03e96 100644
--- a/chrome/browser/ui/startup/startup_tab_provider.cc
+++ b/chrome/browser/ui/startup/startup_tab_provider.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/startup/startup_tab_provider.h"
+#include <algorithm>
#include <string>
#include <string_view>
@@ -11,7 +12,6 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "build/branding_buildflags.h"
@@ -70,7 +70,7 @@
// Attempts to find an existing, non-empty tabbed browser for this profile.
bool ProfileHasOtherTabbedBrowser(Profile* profile) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
*BrowserList::GetInstance(), [profile](Browser* browser) {
return browser->profile() == profile && browser->is_type_normal() &&
!browser->tab_strip_model()->empty();
@@ -379,7 +379,7 @@
// available in |other_startup_tabs|.
StartupTabs tabs;
const bool suitable_tab_available =
- base::ranges::any_of(other_startup_tabs, [&](const StartupTab& tab) {
+ std::ranges::any_of(other_startup_tabs, [&](const StartupTab& tab) {
// The generic new tab URL is only suitable if the user has a Chrome
// controlled New Tab Page.
if (tab.url.host() == chrome::kChromeUINewTabHost) {
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
index d767195..b9eda87 100644
--- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
+++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h"
+#include <algorithm>
+
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/public/tab_interface.h"
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.cc b/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.cc
index 2ec0fb56..2110049 100644
--- a/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.cc
+++ b/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.cc
@@ -259,7 +259,7 @@
browser->tab_strip_model()->SupportsTabGroups()) {
std::vector<LocalTabGroupID> local_groups =
browser->tab_strip_model()->group_model()->ListTabGroups();
- base::ranges::copy(local_groups, std::back_inserter(local_group_ids));
+ std::ranges::copy(local_groups, std::back_inserter(local_group_ids));
}
}
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy_unittest.cc b/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy_unittest.cc
index 887918eb..515e8f3 100644
--- a/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy_unittest.cc
+++ b/chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy_unittest.cc
@@ -234,7 +234,7 @@
TEST_P(TabGroupSyncServiceProxyUnitTest, UpdateGroupPositionIndex) {
auto get_index = [&](const LocalTabGroupID& local_id) -> int {
std::vector<SavedTabGroup> groups = service()->GetAllGroups();
- auto it = base::ranges::find_if(groups, [&](const SavedTabGroup& group) {
+ auto it = std::ranges::find_if(groups, [&](const SavedTabGroup& group) {
return group.local_group_id() == local_id;
});
diff --git a/chrome/browser/ui/tabs/tab_dialog_manager.cc b/chrome/browser/ui/tabs/tab_dialog_manager.cc
index cc742bd..949177b1 100644
--- a/chrome/browser/ui/tabs/tab_dialog_manager.cc
+++ b/chrome/browser/ui/tabs/tab_dialog_manager.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/tabs/public/tab_dialog_manager.h"
+#include <algorithm>
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
#include "chrome/browser/ui/tabs/public/tab_features.h"
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 3c55317..f6d8b8a 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -33,7 +33,6 @@
#include "base/not_fatal_until.h"
#include "base/notreached.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/trace_event/common/trace_event_common.h"
#include "base/trace_event/trace_event.h"
#include "base/types/pass_key.h"
@@ -473,7 +472,7 @@
selection.old_model = notifications->selection_model;
selection.new_model = selection_model_;
selection.reason = TabStripModelObserver::CHANGE_REASON_NONE;
- selection.selected_tabs_were_removed = base::ranges::any_of(
+ selection.selected_tabs_were_removed = std::ranges::any_of(
notifications->detached_tab, [¬ifications](auto& dt) {
return notifications->selection_model.IsSelected(
dt->index_before_any_removals);
@@ -1119,8 +1118,8 @@
// Ensure that the indices are nonempty, sorted, and unique.
CHECK_GT(indices.size(), 0u);
- CHECK(base::ranges::is_sorted(indices));
- CHECK(base::ranges::adjacent_find(indices) == indices.end());
+ CHECK(std::ranges::is_sorted(indices));
+ CHECK(std::ranges::adjacent_find(indices) == indices.end());
CHECK(!group_model_->ContainsTabGroup(group_id));
AddToNewGroupImpl(indices, group_id, visual_data);
@@ -1140,8 +1139,8 @@
// Ensure that the indices are nonempty, sorted, and unique.
CHECK_GT(indices.size(), 0u);
- CHECK(base::ranges::is_sorted(indices));
- CHECK(base::ranges::adjacent_find(indices) == indices.end());
+ CHECK(std::ranges::is_sorted(indices));
+ CHECK(std::ranges::adjacent_find(indices) == indices.end());
// The odds of |new_group| colliding with an existing group are astronomically
// low. If there is a collision, a DCHECK will fail in |AddToNewGroupImpl()|,
@@ -1169,8 +1168,8 @@
CHECK(SupportsTabGroups());
// Ensure that the indices are sorted and unique.
- DCHECK(base::ranges::is_sorted(indices));
- DCHECK(base::ranges::adjacent_find(indices) == indices.end());
+ DCHECK(std::ranges::is_sorted(indices));
+ DCHECK(std::ranges::adjacent_find(indices) == indices.end());
CHECK(ContainsIndex(*(indices.begin())));
CHECK(ContainsIndex(*(indices.rbegin())));
@@ -2883,7 +2882,7 @@
[pinned_tab_count](int index) { return index >= pinned_tab_count; });
CHECK(all_tabs_pinned || all_tabs_unpinned);
- CHECK(base::ranges::is_sorted(tab_indices));
+ CHECK(std::ranges::is_sorted(tab_indices));
const std::vector<MoveNotification> notifications =
PrepareTabsToMoveToIndex(tab_indices, destination_index);
diff --git a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
index 18a5857..7d1f9b4 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h"
+#include <algorithm>
#include <utility>
#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/supports_user_data.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
diff --git a/chrome/browser/ui/tabs/tab_ukm_test_helper.cc b/chrome/browser/ui/tabs/tab_ukm_test_helper.cc
index 9d9969d9..b68a644 100644
--- a/chrome/browser/ui/tabs/tab_ukm_test_helper.cc
+++ b/chrome/browser/ui/tabs/tab_ukm_test_helper.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/tabs/tab_ukm_test_helper.h"
+#include <algorithm>
#include <sstream>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -61,7 +61,7 @@
const std::vector<raw_ptr<const ukm::mojom::UkmEntry, VectorExperimental>>&
entries,
const UkmMetricMap& expected_metrics) {
- return base::ranges::find_if(
+ return std::ranges::find_if(
entries, [&expected_metrics](const ukm::mojom::UkmEntry* entry) {
return EntryContainsMetrics(entry, expected_metrics);
});
diff --git a/chrome/browser/ui/task_manager/task_manager_table_model.cc b/chrome/browser/ui/task_manager/task_manager_table_model.cc
index b0d3e56..8e99aba4 100644
--- a/chrome/browser/ui/task_manager/task_manager_table_model.cc
+++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc
@@ -11,6 +11,7 @@
#include <stddef.h>
+#include <algorithm>
#include <string>
#include <vector>
@@ -20,7 +21,6 @@
#include "base/i18n/string_search.h"
#include "base/i18n/time_formatting.h"
#include "base/process/process_handle.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -761,7 +761,7 @@
if (table_model_observer_) {
std::vector<TaskId>::difference_type index =
- base::ranges::find(tasks_, id) - tasks_.begin();
+ std::ranges::find(tasks_, id) - tasks_.begin();
table_model_observer_->OnItemsAdded(index, 1);
}
}
@@ -776,7 +776,7 @@
return;
}
- auto index = base::ranges::find(tasks_, id);
+ auto index = std::ranges::find(tasks_, id);
if (index == tasks_.end()) {
return;
}
@@ -1003,7 +1003,7 @@
content::WebContents* web_contents) {
TaskId task_id =
observed_task_manager()->GetTaskIdForWebContents(web_contents);
- auto index = base::ranges::find(tasks_, task_id);
+ auto index = std::ranges::find(tasks_, task_id);
if (index == tasks_.end()) {
return std::nullopt;
}
@@ -1014,7 +1014,7 @@
if (!active_task_id_.has_value()) {
return std::nullopt;
}
- auto index = base::ranges::find(tasks_, active_task_id_.value());
+ auto index = std::ranges::find(tasks_, active_task_id_.value());
if (index == tasks_.end()) {
return std::nullopt;
}
@@ -1099,7 +1099,7 @@
if (base::i18n::StringSearchIgnoringCaseAndAccents(
search_terms_, observed_task_manager()->GetTitle(id),
/*match_index=*/nullptr, /*match_length=*/nullptr) &&
- base::ranges::find(tasks_, id) != tasks_.end()) {
+ std::ranges::find(tasks_, id) != tasks_.end()) {
// There is at least one matched task in task group, we need to
// keep it.
return true;
@@ -1154,10 +1154,10 @@
FilterTaskList(filtered_task_list);
for (TaskId id : task_list) {
- auto filtered_iter = base::ranges::find(filtered_task_list, id);
+ auto filtered_iter = std::ranges::find(filtered_task_list, id);
bool should_keep_task = filtered_iter != filtered_task_list.end();
// Indicate if the task is in current task list.
- auto task_iter = base::ranges::find(tasks_, id);
+ auto task_iter = std::ranges::find(tasks_, id);
bool task_id_exists = task_iter != tasks_.end();
if (should_keep_task == task_id_exists) {
// The task already displays as the filter logic.
diff --git a/chrome/browser/ui/test/test_app_window_icon_observer.cc b/chrome/browser/ui/test/test_app_window_icon_observer.cc
index dfbfc35..03fa25ab 100644
--- a/chrome/browser/ui/test/test_app_window_icon_observer.cc
+++ b/chrome/browser/ui/test/test_app_window_icon_observer.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/test/test_app_window_icon_observer.h"
+#include <algorithm>
#include <string_view>
#include <utility>
#include "base/hash/md5.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "extensions/browser/app_window/app_window.h"
#include "ui/aura/client/aura_constants.h"
@@ -63,7 +63,7 @@
extensions::AppWindow* app_window) {
aura::Window* window = app_window->GetNativeWindow();
if (window) {
- windows_.erase(base::ranges::find(windows_, window));
+ windows_.erase(std::ranges::find(windows_, window));
window->RemoveObserver(this);
}
}
diff --git a/chrome/browser/ui/test/test_infobar.cc b/chrome/browser/ui/test/test_infobar.cc
index b733a8f9..8e6e1553 100644
--- a/chrome/browser/ui/test/test_infobar.cc
+++ b/chrome/browser/ui/test/test_infobar.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include <iterator>
-#include "base/ranges/algorithm.h"
#include "chrome/browser/infobars/infobar_observer.h"
#include "chrome/browser/ui/browser.h"
#include "components/infobars/content/content_infobar_manager.h"
@@ -27,8 +26,8 @@
return false;
}
- return base::ranges::equal(*infobars, expected_identifiers_, {},
- &infobars::InfoBar::GetIdentifier);
+ return std::ranges::equal(*infobars, expected_identifiers_, {},
+ &infobars::InfoBar::GetIdentifier);
}
void TestInfoBar::WaitForUserDismissal() {
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image.cc b/chrome/browser/ui/thumbnails/thumbnail_image.cc
index 8396ddf..cc889be0 100644
--- a/chrome/browser/ui/thumbnails/thumbnail_image.cc
+++ b/chrome/browser/ui/thumbnails/thumbnail_image.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/thumbnails/thumbnail_image.h"
+#include <algorithm>
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
@@ -286,7 +286,7 @@
// The order of |subscribers_| does not matter. We can simply swap
// |subscription| in |subscribers_| with the last element, then pop it
// off the back.
- auto it = base::ranges::find(subscribers_, subscription);
+ auto it = std::ranges::find(subscribers_, subscription);
CHECK(it != subscribers_.end(), base::NotFatalUntil::M130);
std::swap(*it, *(subscribers_.end() - 1));
subscribers_.pop_back();
diff --git a/chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.cc b/chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.cc
index 834f2973..73ec366a 100644
--- a/chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.cc
+++ b/chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/toolbar/cast/cast_toolbar_button_controller.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -73,7 +74,7 @@
void CastToolbarButtonController::OnRoutesUpdated(
const std::vector<media_router::MediaRoute>& routes) {
has_local_display_route_ =
- base::ranges::any_of(routes, [](const media_router::MediaRoute& route) {
+ std::ranges::any_of(routes, [](const media_router::MediaRoute& route) {
// The Cast icon should be hidden if there only are
// non-local and non-display routes.
if (!route.is_local()) {
diff --git a/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.cc b/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.cc
index 8834299..b09420a 100644
--- a/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.cc
+++ b/chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/metrics/field_trial_params.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/browser_process.h"
@@ -112,10 +113,10 @@
}
#endif
- return base::ranges::any_of(model->GetLabInfo(),
- [&profile](const LabInfo& lab) {
- return IsChromeLabsFeatureValid(lab, profile);
- });
+ return std::ranges::any_of(model->GetLabInfo(),
+ [&profile](const LabInfo& lab) {
+ return IsChromeLabsFeatureValid(lab, profile);
+ });
}
bool AreNewChromeLabsExperimentsAvailable(const ChromeLabsModel* model,
@@ -133,7 +134,7 @@
std::vector<std::string> lab_internal_names;
const std::vector<LabInfo>& all_labs = model->GetLabInfo();
- return base::ranges::any_of(
+ return std::ranges::any_of(
all_labs.begin(), all_labs.end(), [&new_badge_prefs](const LabInfo& lab) {
std::optional<int> new_badge_pref_value =
new_badge_prefs.FindInt(lab.internal_name);
diff --git a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
index c2c1636..4f43ad6 100644
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
@@ -67,7 +67,7 @@
bool PinnedToolbarActionsModel::Contains(
const actions::ActionId& action_id) const {
- auto iter = base::ranges::find(pinned_action_ids_, action_id);
+ auto iter = std::ranges::find(pinned_action_ids_, action_id);
return iter != pinned_action_ids_.end();
}
@@ -117,7 +117,7 @@
return;
}
- auto action_to_move = base::ranges::find(pinned_action_ids_, action_id);
+ auto action_to_move = std::ranges::find(pinned_action_ids_, action_id);
if (action_to_move == pinned_action_ids_.end()) {
// Do nothing if this action is not pinned.
return;
@@ -130,11 +130,11 @@
std::vector<actions::ActionId> updated_pinned_action_ids = pinned_action_ids_;
- auto start_iter = base::ranges::find(updated_pinned_action_ids, action_id);
+ auto start_iter = std::ranges::find(updated_pinned_action_ids, action_id);
CHECK(start_iter != updated_pinned_action_ids.end());
- auto end_iter = base::ranges::find(updated_pinned_action_ids,
- pinned_action_ids_[target_index]);
+ auto end_iter = std::ranges::find(updated_pinned_action_ids,
+ pinned_action_ids_[target_index]);
CHECK(end_iter != updated_pinned_action_ids.end());
// Rotate |action_id| to be in the target position.
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model.cc b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
index 7d47d28..ee61cd1 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
@@ -18,7 +18,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/observer_list.h"
#include "base/one_shot_event.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/extensions/extension_management.h"
@@ -147,7 +146,7 @@
// the active pinned set.
DCHECK(!IsActionPinned(action_id));
auto stored_pinned_actions = extension_prefs_->GetPinnedExtensions();
- auto iter = base::ranges::find(stored_pinned_actions, action_id);
+ auto iter = std::ranges::find(stored_pinned_actions, action_id);
if (iter != stored_pinned_actions.end()) {
stored_pinned_actions.erase(iter);
extension_prefs_->SetPinnedExtensions(stored_pinned_actions);
@@ -239,7 +238,7 @@
// If nay extension has access, we want to properly message that (since
// saying "No extensions can run..." is inaccurate). Other extensions
// will still be properly attributed in UI.
- return base::ranges::all_of(action_ids(), [this, url](ActionId id) {
+ return std::ranges::all_of(action_ids(), [this, url](ActionId id) {
// action_ids() could include disabled extensions that haven't been removed
// yet from the set due to race conditions. Thus, we don't consider them in
// the restricted url computation.
@@ -314,7 +313,7 @@
<< "Changing action position is disallowed in incognito.";
auto current_position_on_toolbar =
- base::ranges::find(pinned_action_ids_, action_id);
+ std::ranges::find(pinned_action_ids_, action_id);
CHECK(current_position_on_toolbar != pinned_action_ids_.end(),
base::NotFatalUntil::M130);
size_t current_index_on_toolbar =
@@ -384,11 +383,11 @@
non_force_pinned_neighbor == pinned_action_ids_.end();
auto target_position = move_to_end
? stored_pinned_actions.end()
- : base::ranges::find(stored_pinned_actions,
- *non_force_pinned_neighbor);
+ : std::ranges::find(stored_pinned_actions,
+ *non_force_pinned_neighbor);
auto current_position_in_prefs =
- base::ranges::find(stored_pinned_actions, action_id);
+ std::ranges::find(stored_pinned_actions, action_id);
CHECK(current_position_in_prefs != stored_pinned_actions.end(),
base::NotFatalUntil::M130);
@@ -532,7 +531,7 @@
auto* management =
extensions::ExtensionManagementFactory::GetForBrowserContext(profile_);
// O(n^2), but there are typically very few force-pinned extensions.
- base::ranges::copy_if(
+ std::ranges::copy_if(
management->GetForcePinnedList(), std::back_inserter(pinned),
[&pinned](const std::string& id) { return !base::Contains(pinned, id); });
diff --git a/chrome/browser/ui/unload_controller.cc b/chrome/browser/ui/unload_controller.cc
index dc044cd..b98d7d3 100644
--- a/chrome/browser/ui/unload_controller.cc
+++ b/chrome/browser/ui/unload_controller.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/unload_controller.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/location.h"
-#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/lifetime/application_lifetime_desktop.h"
@@ -452,7 +453,7 @@
content::WebContents* web_contents) {
DCHECK(is_attempting_to_close_browser_);
- auto iter = base::ranges::find(*set, web_contents);
+ auto iter = std::ranges::find(*set, web_contents);
if (iter != set->end()) {
set->erase(iter);
return true;
diff --git a/chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_browsertest.cc b/chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_browsertest.cc
index d5360919..20a34af 100644
--- a/chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_browsertest.cc
+++ b/chrome/browser/ui/views/autofill/payments/card_unmask_authentication_selection_dialog_browsertest.cc
@@ -104,7 +104,7 @@
VerifyUi();
// Select the CVC challenge option in the dialog.
- auto cvc_challenge_option = base::ranges::find_if(
+ auto cvc_challenge_option = std::ranges::find_if(
GetChallengeOptions(), [](const auto& challenge_option) {
return challenge_option.type == CardUnmaskChallengeOptionType::kCvc;
});
diff --git a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc
index 4c8a6c4..67ed92f7 100644
--- a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc
+++ b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/views/autofill/payments/payments_view_util.h"
+#include <algorithm>
#include <memory>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "build/branding_buildflags.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
index 9dbe9eb..0caddda 100644
--- a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
+++ b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -20,7 +21,6 @@
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
diff --git a/chrome/browser/ui/views/autofill/update_address_profile_view.cc b/chrome/browser/ui/views/autofill/update_address_profile_view.cc
index 8b5339d..cb84e3b 100644
--- a/chrome/browser/ui/views/autofill/update_address_profile_view.cc
+++ b/chrome/browser/ui/views/autofill/update_address_profile_view.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/ranges/algorithm.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/views/autofill/autofill_bubble_utils.h"
diff --git a/chrome/browser/ui/views/bluetooth_device_credentials_view.cc b/chrome/browser/ui/views/bluetooth_device_credentials_view.cc
index 2aa610a4..80a2ded 100644
--- a/chrome/browser/ui/views/bluetooth_device_credentials_view.cc
+++ b/chrome/browser/ui/views/bluetooth_device_credentials_view.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/bluetooth_device_credentials_view.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ui/bluetooth/bluetooth_dialogs.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
@@ -40,7 +41,7 @@
namespace {
bool IsInputTextValid(const std::u16string& text) {
- const size_t num_digits = base::ranges::count_if(
+ const size_t num_digits = std::ranges::count_if(
text, [](char16_t ch) { return base::IsAsciiDigit(ch); });
// This dialog is currently only used to prompt for Bluetooth PINs which
// are always six digit numeric values as per the spec. This function could
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 0988e637..63fe45a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -28,7 +28,6 @@
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
@@ -568,8 +567,8 @@
if (const BookmarkNode* node = folder.as_non_permanent_folder();
node && node->is_folder() &&
node->parent()->type() == BookmarkNode::Type::BOOKMARK_BAR) {
- auto it = base::ranges::find(bookmark_buttons_, node,
- &BookmarkButtonAndNode::second);
+ auto it = std::ranges::find(bookmark_buttons_, node,
+ &BookmarkButtonAndNode::second);
CHECK(it != bookmark_buttons_.end());
return static_cast<MenuButton*>(it->first);
}
@@ -1548,7 +1547,7 @@
}
size_t BookmarkBarView::GetFirstHiddenNodeIndex() const {
- const auto i = base::ranges::find_if_not(
+ const auto i = std::ranges::find_if_not(
bookmark_buttons_, [](const BookmarkButtonAndNode& pair) {
return pair.first->GetVisible();
});
@@ -1800,8 +1799,8 @@
return;
}
- auto it = base::ranges::find(bookmark_buttons_, node,
- &BookmarkButtonAndNode::second);
+ auto it = std::ranges::find(bookmark_buttons_, node,
+ &BookmarkButtonAndNode::second);
if (it == bookmark_buttons_.end()) {
return; // Buttons are created as needed.
}
@@ -1986,8 +1985,8 @@
}
const BookmarkNode* BookmarkBarView::GetNodeForSender(View* sender) const {
- const auto i = base::ranges::find(bookmark_buttons_, sender,
- &BookmarkButtonAndNode::first);
+ const auto i = std::ranges::find(bookmark_buttons_, sender,
+ &BookmarkButtonAndNode::first);
DCHECK(i != bookmark_buttons_.cend());
return i->second;
}
@@ -2157,8 +2156,8 @@
}
size_t BookmarkBarView::GetIndexForButton(views::View* button) {
- auto it = base::ranges::find(bookmark_buttons_, button,
- &BookmarkButtonAndNode::first);
+ auto it = std::ranges::find(bookmark_buttons_, button,
+ &BookmarkButtonAndNode::first);
if (it == bookmark_buttons_.cend()) {
return static_cast<size_t>(-1);
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index ffd6744b..8f49e71 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -15,7 +16,6 @@
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_multi_source_observation.h"
#include "base/scoped_observation.h"
@@ -1445,7 +1445,7 @@
// Find the first separator.
views::SubmenuView* submenu = context_menu->GetSubmenu();
- const auto i = base::ranges::find_if_not(
+ const auto i = std::ranges::find_if_not(
submenu->children(), views::IsViewClass<views::MenuItemView>);
ASSERT_FALSE(i == submenu->children().end());
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
index b3474f0..896b899 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h"
+#include <algorithm>
#include <set>
#include <string>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_expanded_state_tracker_factory.h"
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 313bdf6..cf11161 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -104,7 +104,7 @@
bool ShouldBuildPermanentNode(const BookmarkMergedSurfaceService* service,
const BookmarkParentFolder& folder) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
service->GetUnderlyingNodes(folder), [](const BookmarkNode* node) {
return node->IsVisible() && !node->children().empty();
});
diff --git a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc
index a3d8e59..4e0011a 100644
--- a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc
+++ b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc
@@ -263,7 +263,7 @@
std::optional<size_t> SavedTabGroupBar::GetIndexOfGroup(
const base::Uuid& guid) const {
std::vector<SavedTabGroup> groups = tab_group_service_->GetAllGroups();
- auto it = base::ranges::find_if(groups, [&](const SavedTabGroup& group) {
+ auto it = std::ranges::find_if(groups, [&](const SavedTabGroup& group) {
return group.saved_guid() == guid;
});
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc
index 58cee3c..ade4cd23 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -10,7 +10,6 @@
#include <vector>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
@@ -165,7 +164,7 @@
link->SetCallback(base::BindRepeating(
[](const std::vector<Row>* items, const views::Link* link,
ContentSettingBubbleContents* parent, const ui::Event& event) {
- const auto it = base::ranges::find(*items, link, &Row::second);
+ const auto it = std::ranges::find(*items, link, &Row::second);
DCHECK(it != items->cend());
parent->LinkClicked(std::distance(items->cbegin(), it), event);
},
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents_interactive_uitest.cc b/chrome/browser/ui/views/content_setting_bubble_contents_interactive_uitest.cc
index 5a7b88f..20766a6d 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents_interactive_uitest.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents_interactive_uitest.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/views/content_setting_bubble_contents.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
@@ -39,7 +40,7 @@
ContentSettingImageModel::ImageType image_type) {
LocationBarView* location_bar_view =
BrowserView::GetBrowserViewForBrowser(browser())->GetLocationBarView();
- return **base::ranges::find(
+ return **std::ranges::find(
location_bar_view->GetContentSettingViewsForTest(), image_type,
&ContentSettingImageView::GetType);
}
diff --git a/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc b/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
index a1108dc3..839cd01 100644
--- a/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
+++ b/chrome/browser/ui/views/default_link_capturing_interactive_uitest.cc
@@ -108,8 +108,8 @@
// correct item and select that.
const auto& app_infos =
web_app::intent_picker_bubble()->app_info_for_testing(); // IN-TEST
- auto it = base::ranges::find(app_infos, outer_app_id,
- &apps::IntentPickerAppInfo::launch_name);
+ auto it = std::ranges::find(app_infos, outer_app_id,
+ &apps::IntentPickerAppInfo::launch_name);
ASSERT_NE(it, app_infos.end());
size_t index = it - app_infos.begin();
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc
index b40075c..d96a6f8 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc
@@ -8,7 +8,6 @@
#include <string>
#include <utility>
-#include "base/ranges/algorithm.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/media/webrtc/desktop_media_list.h"
#include "chrome/browser/media/webrtc/window_icon_util.h"
@@ -287,7 +286,7 @@
DesktopMediaSourceView* DesktopMediaListView::GetSelectedView() {
const auto i =
- base::ranges::find_if(children(), &DesktopMediaSourceView::GetSelected,
- &AsDesktopMediaSourceView);
+ std::ranges::find_if(children(), &DesktopMediaSourceView::GetSelected,
+ &AsDesktopMediaSourceView);
return (i == children().cend()) ? nullptr : AsDesktopMediaSourceView(*i);
}
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
index 6002767..d2868705 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
+#include <algorithm>
#include <string>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/media/webrtc/desktop_capture_devices_util.h"
@@ -1050,8 +1050,8 @@
size_t fallback_pane_index = std::distance(
categories_.begin(),
- base::ranges::find(categories_, DesktopMediaList::Type::kWebContents,
- &DisplaySurfaceCategory::type));
+ std::ranges::find(categories_, DesktopMediaList::Type::kWebContents,
+ &DisplaySurfaceCategory::type));
if (fallback_pane_index >= categories_.size()) {
Reject();
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_test_api.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_test_api.cc
index 630ae90..b7222537 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_test_api.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_test_api.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_test_api.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
@@ -96,7 +97,7 @@
void DesktopMediaPickerViewsTestApi::SelectTabForSourceType(
DesktopMediaList::Type source_type) {
const auto& categories = picker_->dialog_->categories_;
- const auto i = base::ranges::find(
+ const auto i = std::ranges::find(
categories, source_type,
&DesktopMediaPickerDialogView::DisplaySurfaceCategory::type);
DCHECK(i != categories.cend());
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc
index 98afd1a1..f6cb5d99 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc
@@ -988,8 +988,8 @@
const std::vector<DesktopMediaList::Type>& delegated_source_types) {
source_types_ = source_types;
delegated_source_types_ = delegated_source_types;
- ASSERT_FALSE(base::ranges::any_of(
- source_types_, [this](DesktopMediaList::Type type) {
+ ASSERT_FALSE(
+ std::ranges::any_of(source_types_, [this](DesktopMediaList::Type type) {
return base::Contains(delegated_source_types_, type);
}));
}
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc
index 8446a7a..dcb6a6e 100644
--- a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc
+++ b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc
@@ -509,7 +509,7 @@
views::View::Views DownloadBubbleRowView::GetChildrenInZOrder() {
auto children = views::View::GetChildrenInZOrder();
const auto move_child_to_top = [&](View* child) {
- auto it = base::ranges::find(children, child);
+ auto it = std::ranges::find(children, child);
CHECK(it != children.end(), base::NotFatalUntil::M130);
std::rotate(it, it + 1, children.end());
};
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 9dfd37c..6dc4c25 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <array>
#include <cmath>
+#include <functional>
#include <memory>
#include <numbers>
#include <numeric>
@@ -22,8 +23,6 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "build/buildflag.h"
@@ -590,7 +589,7 @@
kStartPadding * 2 + icon_size.width() + label->width() + kEndPadding;
height = std::max(height, icon_size.height());
const int visible_buttons =
- base::ranges::count(buttons(), true, &views::View::GetVisible);
+ std::ranges::count(buttons(), true, &views::View::GetVisible);
if (visible_buttons > 0) {
const gfx::Size button_size = GetButtonSize();
width += kLabelPadding + button_size.width() * visible_buttons +
@@ -1182,8 +1181,8 @@
// TODO(pkasting): Can use std::iota_view() when C++20 is available.
std::vector<int> widths(max_width + 1 - min_width);
std::iota(widths.begin(), widths.end(), min_width);
- return *base::ranges::lower_bound(widths, 2, base::ranges::greater{},
- std::move(lines_for_width));
+ return *std::ranges::lower_bound(widths, 2, std::ranges::greater{},
+ std::move(lines_for_width));
}
void DownloadItemView::SetDropdownPressed(bool pressed) {
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index fb877ea..f6ff57b 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
+#include <algorithm>
#include <optional>
#include <utility>
#include "base/check.h"
#include "base/containers/adapters.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/download/download_ui_model.h"
#include "chrome/browser/themes/theme_properties.h"
@@ -253,7 +253,7 @@
}
void DownloadShelfView::AutoClose() {
- if (base::ranges::all_of(download_views_, [](const DownloadItemView* view) {
+ if (std::ranges::all_of(download_views_, [](const DownloadItemView* view) {
return view->model()->GetOpened();
})) {
mouse_watcher_.Start(GetWidget()->GetNativeWindow());
@@ -262,7 +262,7 @@
void DownloadShelfView::RemoveDownloadView(View* view) {
DCHECK(view);
- const auto i = base::ranges::find(download_views_, view);
+ const auto i = std::ranges::find(download_views_, view);
CHECK(i != download_views_.end(), base::NotFatalUntil::M130);
download_views_.erase(i);
RemoveChildViewT(view);
diff --git a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
index 9f86d73..e6163a1a 100644
--- a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
+++ b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <initializer_list>
#include <memory>
#include <string>
@@ -16,7 +17,6 @@
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
@@ -682,8 +682,8 @@
});
};
- return base::ranges::count_if(received_events_,
- received_event_has_matching_event_type);
+ return std::ranges::count_if(received_events_,
+ received_event_has_matching_event_type);
}
void StoreAccumulatedEvents() {
diff --git a/chrome/browser/ui/views/enable_link_capturing_infobar_browsertest.cc b/chrome/browser/ui/views/enable_link_capturing_infobar_browsertest.cc
index d97a82c..245d3033 100644
--- a/chrome/browser/ui/views/enable_link_capturing_infobar_browsertest.cc
+++ b/chrome/browser/ui/views/enable_link_capturing_infobar_browsertest.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <tuple>
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/user_action_tester.h"
#include "base/test/test_future.h"
#include "chrome/browser/apps/app_service/app_registry_cache_waiter.h"
@@ -443,8 +443,8 @@
// correct item and select that.
const auto& app_infos =
web_app::intent_picker_bubble()->app_info_for_testing();
- auto it = base::ranges::find(app_infos, outer_app_id,
- &apps::IntentPickerAppInfo::launch_name);
+ auto it = std::ranges::find(app_infos, outer_app_id,
+ &apps::IntentPickerAppInfo::launch_name);
ASSERT_NE(it, app_infos.end());
size_t index = it - app_infos.begin();
diff --git a/chrome/browser/ui/views/extensions/device_chooser_extension_browsertest.cc b/chrome/browser/ui/views/extensions/device_chooser_extension_browsertest.cc
index 08ce10e..d758d3cf 100644
--- a/chrome/browser/ui/views/extensions/device_chooser_extension_browsertest.cc
+++ b/chrome/browser/ui/views/extensions/device_chooser_extension_browsertest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <string>
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_future.h"
#include "build/buildflag.h"
diff --git a/chrome/browser/ui/views/extensions/dialogs/settings_overridden_dialog_browsertest.cc b/chrome/browser/ui/views/extensions/dialogs/settings_overridden_dialog_browsertest.cc
index 455bd91..d511206 100644
--- a/chrome/browser/ui/views/extensions/dialogs/settings_overridden_dialog_browsertest.cc
+++ b/chrome/browser/ui/views/extensions/dialogs/settings_overridden_dialog_browsertest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/extensions/dialogs/settings_overridden_dialog.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/profiles/profile.h"
@@ -213,7 +214,7 @@
TemplateURLService::TemplateURLVector template_urls =
template_url_service->GetTemplateURLs();
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
template_urls, [template_url_service, new_search_shows_in_default_list](
const TemplateURL* turl) {
return !turl->HasGoogleBaseURLs(
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_interactive_uitest.cc b/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_interactive_uitest.cc
index defa7dd..054c987 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_interactive_uitest.cc
@@ -749,10 +749,10 @@
std::vector<ExtensionMenuItemView*> menu_items = main_page->GetMenuItems();
- auto iter = base::ranges::find(menu_items, extension_id,
- [](ExtensionMenuItemView* view) {
- return view->view_controller()->GetId();
- });
+ auto iter = std::ranges::find(menu_items, extension_id,
+ [](ExtensionMenuItemView* view) {
+ return view->view_controller()->GetId();
+ });
return (iter == menu_items.end()) ? nullptr : *iter;
}
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_unittest.cc b/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_unittest.cc
index 524fbba..211cad3 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_unittest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_main_page_view_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/extensions/extensions_menu_main_page_view.h"
+#include <algorithm>
+
#include "base/containers/to_vector.h"
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/user_action_tester.h"
#include "chrome/app/vector_icons/vector_icons.h"
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.cc
index fdbddd5..2e25f24 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/views/extensions/extensions_menu_site_permissions_page_view.h"
+#include <algorithm>
#include <string>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/extensions/permissions/site_permissions_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
@@ -68,7 +68,7 @@
std::vector<views::RadioButton*> site_access_buttons;
site_access_buttons.reserve(buttons.size());
- base::ranges::transform(
+ std::ranges::transform(
buttons, std::back_inserter(site_access_buttons),
[](views::View* button) {
return views::AsViewClass<views::RadioButton>(button);
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc b/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc
index 9aeaf603..777a77ba 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/views/extensions/extensions_menu_test_util.h"
+#include <algorithm>
+
#include "base/containers/flat_set.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/extension_action_view_controller.h"
@@ -204,7 +205,7 @@
}
auto iter =
- base::ranges::find(menu_items, id, [](ExtensionMenuItemView* view) {
+ std::ranges::find(menu_items, id, [](ExtensionMenuItemView* view) {
return view->view_controller()->GetId();
});
return (iter == menu_items.end()) ? nullptr : *iter;
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_view.cc
index 510e8d3..2b988a8 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_view.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_view.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/ui/views/extensions/extensions_menu_view.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/i18n/case_conversion.h"
#include "base/memory/ptr_util.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
@@ -455,10 +456,10 @@
void ExtensionsMenuView::OnToolbarActionRemoved(
const ToolbarActionsModel::ActionId& action_id) {
- auto iter = base::ranges::find(extensions_menu_items_, action_id,
- [](const ExtensionMenuItemView* item) {
- return item->view_controller()->GetId();
- });
+ auto iter = std::ranges::find(extensions_menu_items_, action_id,
+ [](const ExtensionMenuItemView* item) {
+ return item->view_controller()->GetId();
+ });
CHECK(iter != extensions_menu_items_.end(), base::NotFatalUntil::M130);
ExtensionMenuItemView* const view = *iter;
DCHECK(Contains(view));
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view_controller.cc b/chrome/browser/ui/views/extensions/extensions_menu_view_controller.cc
index f9c8f54..25d608be 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_view_controller.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_view_controller.cc
@@ -108,11 +108,11 @@
base::i18n::ToLower(toolbar_model.GetExtensionName(action_id));
auto sorted_action_ids = SortExtensionsByName(toolbar_model);
return static_cast<size_t>(
- base::ranges::lower_bound(sorted_action_ids, extension_name, {},
- [&toolbar_model](std::string id) {
- return base::i18n::ToLower(
- toolbar_model.GetExtensionName(id));
- }) -
+ std::ranges::lower_bound(sorted_action_ids, extension_name, {},
+ [&toolbar_model](std::string id) {
+ return base::i18n::ToLower(
+ toolbar_model.GetExtensionName(id));
+ }) -
sorted_action_ids.begin());
}
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc
index 52aa3162..58c1e0a 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc
@@ -6,7 +6,6 @@
#include <optional>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/browsertest_util.h"
@@ -121,7 +120,7 @@
void TriggerExtensionButton(const std::string& id) {
auto menu_items = GetExtensionMenuItemViews();
auto iter =
- base::ranges::find(menu_items, id, [](ExtensionMenuItemView* view) {
+ std::ranges::find(menu_items, id, [](ExtensionMenuItemView* view) {
return view->view_controller()->GetId();
});
ASSERT_TRUE(iter != menu_items.end());
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view_unittest.cc b/chrome/browser/ui/views/extensions/extensions_menu_view_unittest.cc
index f3d51c34..bbd1445 100644
--- a/chrome/browser/ui/views/extensions/extensions_menu_view_unittest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_menu_view_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/extensions/extensions_menu_view.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/containers/to_vector.h"
#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/user_action_tester.h"
@@ -176,7 +176,7 @@
base::flat_set<raw_ptr<ExtensionMenuItemView, CtnExperimental>> menu_items =
extensions_menu()->extensions_menu_items_for_testing();
auto iter =
- base::ranges::find(menu_items, name, [](ExtensionMenuItemView* item) {
+ std::ranges::find(menu_items, name, [](ExtensionMenuItemView* item) {
return base::UTF16ToUTF8(item->view_controller()->GetActionName());
});
return iter == menu_items.end() ? nullptr : *iter;
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
index 219bbaf..38d67b1 100644
--- a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
+++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
@@ -12,7 +12,6 @@
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/extensions/extension_tab_util.h"
@@ -260,8 +259,8 @@
// could be handled inside the model and be invisible to the container when
// permissions are unchanged.
- auto iter = base::ranges::find(actions_, action_id,
- &ToolbarActionViewController::GetId);
+ auto iter = std::ranges::find(actions_, action_id,
+ &ToolbarActionViewController::GetId);
CHECK(iter != actions_.end(), base::NotFatalUntil::M130);
// Ensure the action outlives the UI element to perform any cleanup.
std::unique_ptr<ToolbarActionViewController> controller = std::move(*iter);
@@ -427,8 +426,8 @@
views::Widget*
ExtensionsToolbarContainer::GetAnchoredWidgetForExtensionForTesting(
const std::string& extension_id) {
- auto iter = base::ranges::find(anchored_widgets_, extension_id,
- &AnchoredWidget::extension_id);
+ auto iter = std::ranges::find(anchored_widgets_, extension_id,
+ &AnchoredWidget::extension_id);
return iter == anchored_widgets_.end() ? nullptr : iter->widget.get();
}
@@ -525,7 +524,7 @@
void ExtensionsToolbarContainer::AnchorAndShowWidgetImmediately(
MayBeDangling<views::Widget> widget) {
auto iter =
- base::ranges::find(anchored_widgets_, widget, &AnchoredWidget::widget);
+ std::ranges::find(anchored_widgets_, widget, &AnchoredWidget::widget);
if (iter == anchored_widgets_.end()) {
// This should mean that the Widget destructed before we got to showing it.
@@ -746,7 +745,7 @@
ui::OSExchangeData* data) {
DCHECK(data);
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
model_->pinned_action_ids(), sender,
[this](const std::string& action_id) { return GetViewForId(action_id); });
DCHECK(it != model_->pinned_action_ids().cend());
@@ -781,7 +780,7 @@
}
// Only pinned extensions should be draggable.
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
model_->pinned_action_ids(), sender,
[this](const std::string& action_id) { return GetViewForId(action_id); });
if (it == model_->pinned_action_ids().cend()) {
@@ -884,7 +883,7 @@
void ExtensionsToolbarContainer::OnWidgetDestroying(views::Widget* widget) {
auto iter =
- base::ranges::find(anchored_widgets_, widget, &AnchoredWidget::widget);
+ std::ranges::find(anchored_widgets_, widget, &AnchoredWidget::widget);
CHECK(iter != anchored_widgets_.end(), base::NotFatalUntil::M130);
iter->widget->RemoveObserver(this);
const std::string extension_id = std::move(iter->extension_id);
@@ -910,7 +909,7 @@
void ExtensionsToolbarContainer::SetExtensionIconVisibility(
ToolbarActionsModel::ActionId id,
bool visible) {
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
model_->pinned_action_ids(), GetViewForId(id),
[this](const std::string& action_id) { return GetViewForId(action_id); });
if (it == model_->pinned_action_ids().cend()) {
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_container_unittest.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_container_unittest.cc
index f43dc924..68d010a 100644
--- a/chrome/browser/ui/views/extensions/extensions_toolbar_container_unittest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
+#include <algorithm>
#include <string>
#include "base/json/json_reader.h"
-#include "base/ranges/algorithm.h"
#include "base/test/metrics/user_action_tester.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_action_runner.h"
@@ -107,7 +107,7 @@
const extensions::ExtensionId& extension_id) {
std::vector<ToolbarActionView*> actions = GetPinnedExtensionViews();
auto it =
- base::ranges::find(actions, extension_id, [](ToolbarActionView* action) {
+ std::ranges::find(actions, extension_id, [](ToolbarActionView* action) {
return action->view_controller()->GetId();
});
if (it == actions.end()) {
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_unittest.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_unittest.cc
index e62d6cb..c3cd5e10 100644
--- a/chrome/browser/ui/views/extensions/extensions_toolbar_unittest.cc
+++ b/chrome/browser/ui/views/extensions/extensions_toolbar_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/extensions/extensions_toolbar_unittest.h"
+#include <algorithm>
+
#include "base/command_line.h"
#include "base/containers/to_vector.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "build/build_config.h"
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc
index 7f0202de..191d28ef 100644
--- a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc
+++ b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h"
+#include <algorithm>
#include <iterator>
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/file_system_access/chrome_file_system_access_permission_context.h"
@@ -27,8 +27,8 @@
std::vector<base::FilePath> GetPaths(
const std::vector<content::PathInfo>& path_infos) {
std::vector<base::FilePath> result;
- base::ranges::transform(path_infos, std::back_inserter(result),
- &content::PathInfo::path);
+ std::ranges::transform(path_infos, std::back_inserter(result),
+ &content::PathInfo::path);
return result;
}
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
index 97a90843..cb1554a 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
@@ -593,9 +593,9 @@
content_settings::PageSpecificContentSettings::GetForFrame(frame);
content_settings->OnContentAllowed(ContentSettingsType::GEOLOCATION);
- return *base::ranges::find(*content_setting_views_,
- ContentSettingImageModel::ImageType::GEOLOCATION,
- &ContentSettingImageView::GetType);
+ return *std::ranges::find(*content_setting_views_,
+ ContentSettingImageModel::ImageType::GEOLOCATION,
+ &ContentSettingImageView::GetType);
}
void SimulateClickOnView(views::View* view) {
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 938280f8..17d3261e 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
@@ -26,7 +27,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -518,7 +518,7 @@
views::View::ConvertRectToTarget(target, child, &child_rect);
return child->HitTestRect(gfx::ToEnclosingRect(child_rect));
};
- return base::ranges::any_of(children, hits_child);
+ return std::ranges::any_of(children, hits_child);
}
};
@@ -2632,8 +2632,8 @@
views::Widget::Widgets widgets;
views::Widget::GetAllOwnedWidgets(anchor_widget->GetNativeView(), &widgets);
- return base::ranges::any_of(widgets, [point_in_screen_coords,
- anchor_widget](views::Widget* widget) {
+ return std::ranges::any_of(widgets, [point_in_screen_coords,
+ anchor_widget](views::Widget* widget) {
return widget != anchor_widget && widget->IsVisible() &&
widget->GetWindowBoundsInScreen().Contains(point_in_screen_coords);
});
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index 013be2b..05427e2 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -513,9 +513,9 @@
// when this is a window using WindowControlsOverlay, to make sure the window
// controls are in fact drawn on top of the web contents.
if (delegate_->IsWindowControlsOverlayEnabled()) {
- auto top_container_iter = base::ranges::find(result, top_container_);
+ auto top_container_iter = std::ranges::find(result, top_container_);
auto contents_container_iter =
- base::ranges::find(result, contents_container_);
+ std::ranges::find(result, contents_container_);
CHECK(contents_container_iter != result.end());
// When in Immersive Fullscreen `top_container_` might not be one of our
// children at all. While Window Controls Overlay shouldn't be enabled in
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
index 75277770..489c6de 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
@@ -6,12 +6,12 @@
#include <AppKit/AppKit.h>
+#include <algorithm>
#include <vector>
#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/feature_list.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/fullscreen_util_mac.h"
@@ -530,7 +530,7 @@
traverse_order.push_back(browser_view_->tab_overlay_widget());
}
- auto current_widget_it = base::ranges::find_if(
+ auto current_widget_it = std::ranges::find_if(
traverse_order, [starting_view](const views::Widget* widget) {
return widget->GetRootView()->Contains(starting_view);
});
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc
index f3d1e5a..1873682 100644
--- a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc
+++ b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/views/frame/webui_tab_strip_field_trial.h"
+#include <algorithm>
#include <string_view>
#include <vector>
#include "base/command_line.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/field_trial.h"
-#include "base/ranges/algorithm.h"
#include "base/test/mock_entropy_provider.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
@@ -56,10 +56,10 @@
LOG(ERROR) << group_id.name << " " << group_id.group;
}
- return base::ranges::any_of(active_groups,
- [=](const variations::ActiveGroupId& e) {
- return e.name == id.name && e.group == id.group;
- });
+ return std::ranges::any_of(active_groups,
+ [=](const variations::ActiveGroupId& e) {
+ return e.name == id.name && e.group == id.group;
+ });
}
} // namespace
diff --git a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.cc b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.cc
index 6de4e5f..437a01f1 100644
--- a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.cc
+++ b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.h"
+#include <algorithm>
#include <utility>
#include "base/containers/contains.h"
@@ -11,7 +12,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/global_media_controls/media_item_ui_device_selector_delegate.h"
#include "chrome/browser/ui/global_media_controls/media_item_ui_metrics.h"
@@ -201,7 +201,7 @@
}
// Find DeviceEntryView* from |device_entry_ui_map_| with |current_device_id|.
- auto it = base::ranges::find(
+ auto it = std::ranges::find(
device_entry_ui_map_, current_device_id,
[](const auto& pair) { return pair.second->raw_device_id(); });
@@ -376,7 +376,7 @@
// * Or, there are two devices and one of them has the default ID but not the
// default name.
if (device_entry_views_container_->children().size() == 2) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
device_entry_views_container_->children(), [this](views::View* view) {
DeviceEntryUI* entry = GetDeviceEntryUI(view);
return entry->raw_device_id() ==
diff --git a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc
index 47fde79..e7115ef 100644
--- a/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc
+++ b/chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/views/global_media_controls/media_item_ui_device_selector_view.h"
+#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/callback_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
@@ -390,8 +390,8 @@
// There should be only one highlighted button. It should be the first button.
// It's text should be "Speaker"
auto highlight_pred = [this](views::View* v) { return IsHighlighted(v); };
- EXPECT_EQ(base::ranges::count_if(container_children, highlight_pred), 1);
- EXPECT_EQ(base::ranges::find_if(container_children, highlight_pred),
+ EXPECT_EQ(std::ranges::count_if(container_children, highlight_pred), 1);
+ EXPECT_EQ(std::ranges::find_if(container_children, highlight_pred),
container_children.begin());
EXPECT_EQ(EntryLabelText(container_children.front()), "Speaker");
@@ -399,8 +399,8 @@
view_->UpdateCurrentAudioDevice("3");
// The button for "Earbuds" should come before all others & be highlighted.
- EXPECT_EQ(base::ranges::count_if(container_children, highlight_pred), 1);
- EXPECT_EQ(base::ranges::find_if(container_children, highlight_pred),
+ EXPECT_EQ(std::ranges::count_if(container_children, highlight_pred), 1);
+ EXPECT_EQ(std::ranges::find_if(container_children, highlight_pred),
container_children.begin());
EXPECT_EQ(EntryLabelText(container_children.front()), "Earbuds");
}
diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.cc b/chrome/browser/ui/views/infobars/confirm_infobar.cc
index 550b2e74..1f7aa265 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -111,7 +111,7 @@
}
if constexpr (!views::PlatformStyle::kIsOkButtonLeading) {
- base::ranges::reverse(order_of_buttons);
+ std::ranges::reverse(order_of_buttons);
}
for (views::MdTextButton* button : order_of_buttons) {
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.cc b/chrome/browser/ui/views/intent_picker_bubble_view.cc
index b1e75d9b..c7d2096 100644
--- a/chrome/browser/ui/views/intent_picker_bubble_view.cc
+++ b/chrome/browser/ui/views/intent_picker_bubble_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/intent_picker_bubble_view.h"
+#include <algorithm>
#include <string_view>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -178,7 +178,7 @@
}
Views siblings = parent()->children();
- auto it = base::ranges::find_if(siblings, [](views::View* v) {
+ auto it = std::ranges::find_if(siblings, [](views::View* v) {
return views::AsViewClass<IntentPickerAppGridButton>(v)->selected_;
});
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view_interactive_uitest.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view_interactive_uitest.cc
index 68d2cf4..a8c2f8b5 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view_interactive_uitest.cc
@@ -73,7 +73,7 @@
}
ContentSettingImageView* GetNotificationView() {
- return *base::ranges::find(
+ return *std::ranges::find(
*content_setting_views_,
ContentSettingImageModel::ImageType::NOTIFICATIONS,
&ContentSettingImageView::GetType);
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc b/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
index dac214e..c190e7e 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include <algorithm>
+
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -93,7 +94,7 @@
ContentSettingImageModel::ImageType image_type) {
LocationBarView* location_bar_view =
BrowserView::GetBrowserViewForBrowser(browser())->GetLocationBarView();
- return **base::ranges::find(
+ return **std::ranges::find(
location_bar_view->GetContentSettingViewsForTest(), image_type,
&ContentSettingImageView::GetType);
}
diff --git a/chrome/browser/ui/views/media_preview/mic_preview/mic_coordinator.cc b/chrome/browser/ui/views/media_preview/mic_preview/mic_coordinator.cc
index 023ab81..2c3134e 100644
--- a/chrome/browser/ui/views/media_preview/mic_preview/mic_coordinator.cc
+++ b/chrome/browser/ui/views/media_preview/mic_preview/mic_coordinator.cc
@@ -9,7 +9,6 @@
#include <utility>
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/media/prefs/capture_device_ranking.h"
#include "chrome/browser/ui/views/media_preview/media_preview_metrics.h"
#include "chrome/browser/ui/views/media_preview/media_view.h"
diff --git a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc
index 5446048a..49b430f78 100644
--- a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc
+++ b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ui/views/media_router/presentation_receiver_window_view.h"
+#include <algorithm>
+
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
@@ -149,7 +150,7 @@
DCHECK(result);
#else
const auto accelerators = GetAcceleratorList();
- const auto fullscreen_accelerator = base::ranges::find(
+ const auto fullscreen_accelerator = std::ranges::find(
accelerators, IDC_FULLSCREEN, &AcceleratorMapping::command_id);
CHECK(fullscreen_accelerator != accelerators.end(),
base::NotFatalUntil::M130);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
index 8a0dcb0..640df4c7 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/omnibox/omnibox_theme.h"
@@ -367,7 +368,7 @@
const bool is_any_child_visible =
embeddings_chip_->GetVisible() || keyword_button_->GetVisible() ||
- base::ranges::any_of(action_buttons_, [](const auto& action_button) {
+ std::ranges::any_of(action_buttons_, [](const auto& action_button) {
return action_button->GetVisible();
});
SetVisible(is_any_child_visible);
@@ -412,8 +413,8 @@
// Find the button that matches model selection.
auto selected_button =
- base::ranges::find(buttons, popup_view_->GetSelection(),
- &OmniboxSuggestionRowButton::selection);
+ std::ranges::find(buttons, popup_view_->GetSelection(),
+ &OmniboxSuggestionRowButton::selection);
return selected_button == buttons.end() ? nullptr : *selected_button;
}
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 5d55b9c..b7604f3f 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
@@ -16,7 +17,6 @@
#include "base/i18n/rtl.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
@@ -752,7 +752,7 @@
// fakebox is hidden and there's only whitespace in the omnibox, it's
// difficult for the user to see that the focus moved to the omnibox.
(model()->focus_state() == OMNIBOX_FOCUS_INVISIBLE &&
- base::ranges::all_of(text, base::IsUnicodeWhitespace<char16_t>))) {
+ std::ranges::all_of(text, base::IsUnicodeWhitespace<char16_t>))) {
return;
}
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_controller.cc b/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
index 80cf986..b41c7ca 100644
--- a/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
+++ b/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
@@ -4,13 +4,14 @@
#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
+#include <algorithm>
+
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/immediate_crash.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
@@ -356,7 +357,7 @@
}
bool PageActionIconController::IsAnyIconVisible() const {
- return base::ranges::any_of(page_action_icon_views_, [](auto icon_item) {
+ return std::ranges::any_of(page_action_icon_views_, [](auto icon_item) {
return icon_item.second->GetVisible();
});
}
@@ -427,9 +428,9 @@
std::vector<const PageActionIconView*>
PageActionIconController::GetPageActionIconViewsForTesting() const {
std::vector<const PageActionIconView*> icon_views;
- base::ranges::transform(page_action_icon_views_,
- std::back_inserter(icon_views),
- &IconViews::value_type::second);
+ std::ranges::transform(page_action_icon_views_,
+ std::back_inserter(icon_views),
+ &IconViews::value_type::second);
return icon_views;
}
@@ -458,7 +459,7 @@
}
int PageActionIconController::VisibleEphemeralActionCount() const {
- return base::ranges::count_if(
+ return std::ranges::count_if(
page_action_icon_views_,
[](std::pair<PageActionIconType, PageActionIconView*> view) {
return view.second->ephemeral() && view.second->GetVisible();
diff --git a/chrome/browser/ui/views/page_info/page_info_permission_content_view.cc b/chrome/browser/ui/views/page_info/page_info_permission_content_view.cc
index 79df13f5..aed6865 100644
--- a/chrome/browser/ui/views/page_info/page_info_permission_content_view.cc
+++ b/chrome/browser/ui/views/page_info/page_info_permission_content_view.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/views/page_info/page_info_permission_content_view.h"
+#include <algorithm>
+
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/file_system_access/chrome_file_system_access_permission_context.h"
@@ -201,8 +202,8 @@
void PageInfoPermissionContentView::SetPermissionInfo(
const PermissionInfoList& permission_info_list,
ChosenObjectInfoList chosen_object_info_list) {
- auto permission_it = base::ranges::find(permission_info_list, type_,
- &PageInfo::PermissionInfo::type);
+ auto permission_it = std::ranges::find(permission_info_list, type_,
+ &PageInfo::PermissionInfo::type);
CHECK(permission_it != permission_info_list.end());
diff --git a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc
index 2fd9032..bd64e92c 100644
--- a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc
+++ b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
@@ -1268,7 +1268,7 @@
}
}
- size_t expected_event_count = base::ranges::count_if(
+ size_t expected_event_count = std::ranges::count_if(
test_cases, [](const HeuristicsTestCase& test_case) {
return test_case.expected_lookalike;
});
diff --git a/chrome/browser/ui/views/permissions/chip/permission_chip_interactive_uitest.cc b/chrome/browser/ui/views/permissions/chip/permission_chip_interactive_uitest.cc
index 999bf96..f069b55 100644
--- a/chrome/browser/ui/views/permissions/chip/permission_chip_interactive_uitest.cc
+++ b/chrome/browser/ui/views/permissions/chip/permission_chip_interactive_uitest.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
diff --git a/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc b/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc
index c2faf2f..4564c64 100644
--- a/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc
+++ b/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/test_with_browser_view.h"
#include "chrome/browser/ui/views/permissions/chip/chip_controller.h"
diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view_browsertest.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view_browsertest.cc
index 1064f99..8036aa4 100644
--- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view_browsertest.cc
+++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view_browsertest.cc
@@ -9,7 +9,6 @@
#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
@@ -125,7 +124,7 @@
ContentSettingImageModel::ImageType image_type) {
LocationBarView* location_bar_view =
BrowserView::GetBrowserViewForBrowser(browser())->GetLocationBarView();
- return **base::ranges::find(
+ return **std::ranges::find(
location_bar_view->GetContentSettingViewsForTest(), image_type,
&ContentSettingImageView::GetType);
}
diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_one_origin_view_unittest.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_one_origin_view_unittest.cc
index 29c0569..aa2bdb90 100644
--- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_one_origin_view_unittest.cc
+++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_one_origin_view_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_one_origin_view.h"
+#include <algorithm>
+
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.h"
diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view_unittest.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view_unittest.cc
index b036e78..439ae261 100644
--- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view_unittest.cc
+++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view.h"
+#include <algorithm>
+
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service_factory.h"
diff --git a/chrome/browser/ui/views/permissions/permission_prompt_chip.cc b/chrome/browser/ui/views/permissions/permission_prompt_chip.cc
index d6bfd6e..b41b1d6 100644
--- a/chrome/browser/ui/views/permissions/permission_prompt_chip.cc
+++ b/chrome/browser/ui/views/permissions/permission_prompt_chip.cc
@@ -10,7 +10,6 @@
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/permissions/chip/chip_controller.h"
#include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/permissions/permission_prompt_factory.cc b/chrome/browser/ui/views/permissions/permission_prompt_factory.cc
index 641926d..0f19f3e 100644
--- a/chrome/browser/ui/views/permissions/permission_prompt_factory.cc
+++ b/chrome/browser/ui/views/permissions/permission_prompt_factory.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/lens/lens_overlay_controller.h"
#include "chrome/browser/ui/permission_bubble/permission_prompt.h"
@@ -107,7 +107,7 @@
std::vector<raw_ptr<permissions::PermissionRequest, VectorExperimental>>
requests = delegate->Requests();
- return base::ranges::all_of(
+ return std::ranges::all_of(
requests, [](permissions::PermissionRequest* request) {
return request
->GetRequestChipText(
@@ -126,7 +126,7 @@
permissions::PermissionPrompt::Delegate* delegate) {
std::vector<raw_ptr<permissions::PermissionRequest, VectorExperimental>>
requests = delegate->Requests();
- return base::ranges::all_of(
+ return std::ranges::all_of(
requests, [](permissions::PermissionRequest* request) {
return request->request_type() ==
permissions::RequestType::kNotifications ||
@@ -139,7 +139,7 @@
permissions::PermissionPrompt::Delegate* delegate) {
std::vector<raw_ptr<permissions::PermissionRequest, VectorExperimental>>
requests = delegate->Requests();
- return base::ranges::all_of(
+ return std::ranges::all_of(
requests, [](permissions::PermissionRequest* request) {
return request->request_type() ==
permissions::RequestType::kPointerLock ||
diff --git a/chrome/browser/ui/views/profiles/profile_picker_flow_controller.cc b/chrome/browser/ui/views/profiles/profile_picker_flow_controller.cc
index e09f1f8..893f78f 100644
--- a/chrome/browser/ui/views/profiles/profile_picker_flow_controller.cc
+++ b/chrome/browser/ui/views/profiles/profile_picker_flow_controller.cc
@@ -714,7 +714,7 @@
->GetProfileAttributesStorage()
.GetAllProfilesAttributes();
int profile_count =
- base::ranges::count(entries, false, &ProfileAttributesEntry::IsOmitted);
+ std::ranges::count(entries, false, &ProfileAttributesEntry::IsOmitted);
if (profile_count > 1 && !open_settings &&
selected_profile_target_url_.is_empty()) {
browser->window()->MaybeShowProfileSwitchIPH();
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc
index a8fb51b..6fdd660 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/ui/views/sad_tab_view.h"
+#include <algorithm>
#include <string>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc
index ab9cf22a..c75a1993 100644
--- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc
+++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h"
+#include <algorithm>
+
#include "base/containers/adapters.h"
#include "base/containers/to_vector.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h"
#include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h"
#include "chrome/test/base/testing_profile.h"
@@ -40,8 +41,8 @@
std::vector<views::View*> result;
EnumerateDescendants(root, descendants);
- base::ranges::copy_if(descendants, std::back_inserter(result),
- [=](views::View* view) { return predicate.Run(view); });
+ std::ranges::copy_if(descendants, std::back_inserter(result),
+ [=](views::View* view) { return predicate.Run(view); });
return result;
}
diff --git a/chrome/browser/ui/views/side_panel/side_panel_registry.cc b/chrome/browser/ui/views/side_panel/side_panel_registry.cc
index bfe22702..38101b2 100644
--- a/chrome/browser/ui/views/side_panel/side_panel_registry.cc
+++ b/chrome/browser/ui/views/side_panel/side_panel_registry.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/views/side_panel/side_panel_registry.h"
+#include <algorithm>
+
#include "base/containers/unique_ptr_adapters.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
#include "chrome/browser/ui/tabs/public/tab_features.h"
@@ -39,7 +40,7 @@
SidePanelEntry* SidePanelRegistry::GetEntryForKey(
const SidePanelEntry::Key& entry_key) {
- auto it = base::ranges::find(entries_, entry_key, &SidePanelEntry::key);
+ auto it = std::ranges::find(entries_, entry_key, &SidePanelEntry::key);
return it == entries_.end() ? nullptr : it->get();
}
diff --git a/chrome/browser/ui/views/site_data/page_specific_site_data_dialog.cc b/chrome/browser/ui/views/site_data/page_specific_site_data_dialog.cc
index 81c94ee..bdd9ccb 100644
--- a/chrome/browser/ui/views/site_data/page_specific_site_data_dialog.cc
+++ b/chrome/browser/ui/views/site_data/page_specific_site_data_dialog.cc
@@ -514,7 +514,7 @@
// If none of the children (except the empty state label) are visible, show
// a label to explain the empty state.
bool none_children_visible =
- base::ranges::none_of(children(), [=, this](views::View* v) {
+ std::ranges::none_of(children(), [=, this](views::View* v) {
return v != empty_state_label_ && v->GetVisible();
});
empty_state_label_->SetVisible(none_children_visible);
diff --git a/chrome/browser/ui/views/site_data/page_specific_site_data_dialog_unittest.cc b/chrome/browser/ui/views/site_data/page_specific_site_data_dialog_unittest.cc
index a3c21bb..51527d6 100644
--- a/chrome/browser/ui/views/site_data/page_specific_site_data_dialog_unittest.cc
+++ b/chrome/browser/ui/views/site_data/page_specific_site_data_dialog_unittest.cc
@@ -47,10 +47,10 @@
// Hosts should match in order.
EXPECT_TRUE(
- base::ranges::equal(sites, expected_sites_in_order,
- [](const auto& site, const auto& expected_site) {
- return site.origin.host() == expected_site.host();
- }));
+ std::ranges::equal(sites, expected_sites_in_order,
+ [](const auto& site, const auto& expected_site) {
+ return site.origin.host() == expected_site.host();
+ }));
}
blink::StorageKey CreateUnpartitionedStorageKey(const GURL& url) {
diff --git a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc
index 505ac1d..a8e188b 100644
--- a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc
+++ b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/ui/webui/signin/inline_login_ui.h"
+#include <algorithm>
+
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -851,9 +852,9 @@
return false;
}
- return base::ranges::all_of(
+ return std::ranges::all_of(
it->second, [&required_params](const QueryParamSet& request_params) {
- return base::ranges::includes(request_params, required_params);
+ return std::ranges::includes(request_params, required_params);
});
}
diff --git a/chrome/browser/ui/views/tab_sharing/tab_sharing_infobar.cc b/chrome/browser/ui/views/tab_sharing/tab_sharing_infobar.cc
index 97dce86..567abe2b 100644
--- a/chrome/browser/ui/views/tab_sharing/tab_sharing_infobar.cc
+++ b/chrome/browser/ui/views/tab_sharing/tab_sharing_infobar.cc
@@ -230,7 +230,7 @@
}
if constexpr (!views::PlatformStyle::kIsOkButtonLeading) {
- base::ranges::reverse(order_of_buttons);
+ std::ranges::reverse(order_of_buttons);
}
for (views::MdTextButton* button : order_of_buttons) {
diff --git a/chrome/browser/ui/views/tab_sharing/tab_sharing_ui_views.cc b/chrome/browser/ui/views/tab_sharing/tab_sharing_ui_views.cc
index 7bf4136..b99b4c6 100644
--- a/chrome/browser/ui/views/tab_sharing/tab_sharing_ui_views.cc
+++ b/chrome/browser/ui/views/tab_sharing/tab_sharing_ui_views.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/tab_sharing/tab_sharing_ui_views.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -18,7 +19,6 @@
#include "base/functional/callback_forward.h"
#include "base/hash/hash.h"
#include "base/location.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -362,7 +362,7 @@
void TabSharingUIViews::OnInfoBarRemoved(infobars::InfoBar* infobar,
bool animate) {
auto infobars_entry =
- base::ranges::find(infobars_, infobar, &InfoBars::value_type::second);
+ std::ranges::find(infobars_, infobar, &InfoBars::value_type::second);
if (infobars_entry == infobars_.end()) {
return;
}
diff --git a/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
index 5ba6310e..700d33e7 100644
--- a/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
@@ -22,7 +22,6 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
@@ -480,7 +479,7 @@
ref->InitDragData(dragging_views[i], &(ref->drag_data_[i]));
}
ref->source_view_index_ =
- base::ranges::find(dragging_views, source_view) - dragging_views.begin();
+ std::ranges::find(dragging_views, source_view) - dragging_views.begin();
// Listen for Esc key presses and mouse releases.
ref->event_tracker_ = std::make_unique<EventTracker>(
diff --git a/chrome/browser/ui/views/tabs/tab_container_impl.cc b/chrome/browser/ui/views/tabs/tab_container_impl.cc
index 10108d1..4b91acd 100644
--- a/chrome/browser/ui/views/tabs/tab_container_impl.cc
+++ b/chrome/browser/ui/views/tabs/tab_container_impl.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/views/tabs/tab_container_impl.h"
+#include <algorithm>
#include <memory>
#include "base/bits.h"
#include "base/containers/adapters.h"
-#include "base/ranges/algorithm.h"
#include "base/types/to_address.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/features.h"
@@ -496,7 +496,7 @@
// user can rapidly close tabs by clicking the close button and not have
// the animations interfere with that.
std::vector<Tab*> all_tabs = layout_helper_->GetTabs();
- auto it = base::ranges::find(all_tabs, tab);
+ auto it = std::ranges::find(all_tabs, tab);
while (it < all_tabs.end() && (*it)->closing()) {
it++;
}
@@ -1508,7 +1508,7 @@
// |slot_view| is in the wrong place in children(). Fix it.
std::vector<TabSlotView*> slots = layout_helper_->GetTabSlotViews();
size_t target_slot_index =
- base::ranges::find(slots, slot_view) - slots.begin();
+ std::ranges::find(slots, slot_view) - slots.begin();
// Find the index in children() that corresponds to |target_slot_index|.
size_t view_index = 0;
for (size_t slot_index = 0; slot_index < target_slot_index; ++slot_index) {
diff --git a/chrome/browser/ui/views/tabs/tab_container_unittest.cc b/chrome/browser/ui/views/tabs/tab_container_unittest.cc
index d06a08e..305fa5f3 100644
--- a/chrome/browser/ui/views/tabs/tab_container_unittest.cc
+++ b/chrome/browser/ui/views/tabs/tab_container_unittest.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <memory>
#include "base/memory/raw_ref.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/ui_features.h"
@@ -900,7 +900,7 @@
tab_container_->CompleteAnimationAndLayout();
std::vector<TabGroupViews*> views = ListGroupViews();
- auto views_it = base::ranges::find(views, group1, [](TabGroupViews* view) {
+ auto views_it = std::ranges::find(views, group1, [](TabGroupViews* view) {
return view->header()->group();
});
ASSERT_TRUE(views_it != views.end());
diff --git a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
index 4d95ed2..b4aa1cd 100644
--- a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
+++ b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -22,7 +23,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/collaboration/collaboration_service_factory.h"
@@ -592,7 +592,7 @@
// TODO(tluk) remove the reliance on the ordering of the color pairs in the
// vector and use the ColorLabelMap structure instead.
- base::ranges::copy(color_map, std::back_inserter(colors_));
+ std::ranges::copy(color_map, std::back_inserter(colors_));
// Keep track of the current group's color, to be returned as the initial
// selected value.
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index b76e2da5..e8a3af0 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -33,7 +33,6 @@
#include "base/not_fatal_until.h"
#include "base/numerics/safe_conversions.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -681,8 +680,8 @@
// The index of `source_view` in the TabStrip's viewmodel.
std::optional<int> source_view_model_index = GetIndexOf(source_view);
// The index of `source_view` as a child of this TabDragContext.
- int source_view_index = static_cast<int>(
- base::ranges::find(views, source_view) - views.begin());
+ int source_view_index =
+ static_cast<int>(std::ranges::find(views, source_view) - views.begin());
const auto should_animate_tab = [&](size_t index_in_views) {
// If the tab at `index_in_views` is already animating, don't interrupt
diff --git a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc
index b7a6e81..e3e0daa 100644
--- a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/views/tabs/tab_strip_layout_helper.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <utility>
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_style.h"
@@ -116,7 +116,7 @@
}
void TabStripLayoutHelper::RemoveTab(Tab* tab) {
- auto it = base::ranges::find_if(slots_, [tab](const TabSlot& slot) {
+ auto it = std::ranges::find_if(slots_, [tab](const TabSlot& slot) {
return slot.type == ViewType::kTab && slot.view == tab;
});
if (it != slots_.end()) {
@@ -389,7 +389,7 @@
int TabStripLayoutHelper::GetSlotIndexForGroupHeader(
tab_groups::TabGroupId group) const {
- const auto it = base::ranges::find_if(slots_, [group](const auto& slot) {
+ const auto it = std::ranges::find_if(slots_, [group](const auto& slot) {
return slot.type == ViewType::kGroupHeader &&
static_cast<TabGroupHeader*>(slot.view)->group() == group;
});
diff --git a/chrome/browser/ui/views/task_manager_view_browsertest.cc b/chrome/browser/ui/views/task_manager_view_browsertest.cc
index f3773a3..ef574fa 100644
--- a/chrome/browser/ui/views/task_manager_view_browsertest.cc
+++ b/chrome/browser/ui/views/task_manager_view_browsertest.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <algorithm>
+
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/pattern.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
@@ -106,8 +107,8 @@
// Looks up a tab based on its tab ID.
content::WebContents* FindWebContentsByTabId(SessionID tab_id) {
auto& all_tabs = AllTabContentses();
- auto it = base::ranges::find(all_tabs, tab_id,
- &sessions::SessionTabHelper::IdForTab);
+ auto it = std::ranges::find(all_tabs, tab_id,
+ &sessions::SessionTabHelper::IdForTab);
return (it == all_tabs.end()) ? nullptr : *it;
}
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 3eb1efba..dd0dbe2 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -1338,7 +1338,7 @@
static constexpr auto kSafetyHubCommandIds =
std::array{IDC_OPEN_SAFETY_HUB, IDC_SAFETY_HUB_MANAGE_EXTENSIONS,
IDC_SAFETY_HUB_SHOW_PASSWORD_CHECKUP};
- const bool has_safety_hub_notification = base::ranges::any_of(
+ const bool has_safety_hub_notification = std::ranges::any_of(
kSafetyHubCommandIds,
[&](int id) { return command_id_to_entry_.contains(id); });
if (has_safety_hub_notification &&
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc
index b607b204..fc3be73 100644
--- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc
+++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button.h"
+#include <algorithm>
+
#include "base/command_line.h"
-#include "base/ranges/algorithm.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
diff --git a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc
index 3214c38cb..a5d32db 100644
--- a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.cc
@@ -231,7 +231,7 @@
DCHECK(IsActionPinned(id));
const auto& pinned_action_ids = model_->PinnedActionIds();
- auto iter = base::ranges::find(pinned_action_ids, id);
+ auto iter = std::ranges::find(pinned_action_ids, id);
CHECK(iter != pinned_action_ids.end());
int current_index = std::distance(pinned_action_ids.begin(), iter);
@@ -303,7 +303,7 @@
const int offset_into_icon_area = GetMirroredXInView(event.x());
const size_t before_icon_unclamped = WidthToIconCount(offset_into_icon_area);
- const size_t visible_pinned_icons = base::ranges::count_if(
+ const size_t visible_pinned_icons = std::ranges::count_if(
pinned_buttons_,
[](PinnedActionToolbarButton* button) { return button->GetVisible(); });
const size_t button_offset = pinned_buttons_.size() - visible_pinned_icons;
@@ -374,7 +374,7 @@
ui::OSExchangeData* data) {
DCHECK(data);
- const auto iter = base::ranges::find(pinned_buttons_, sender);
+ const auto iter = std::ranges::find(pinned_buttons_, sender);
CHECK(iter != pinned_buttons_.end(), base::NotFatalUntil::M130);
auto* button = (*iter).get();
@@ -405,7 +405,7 @@
// We don't allow dragging buttons that aren't pinned, or if
// the profile is incognito (to avoid changing state from an incognito
// window).
- const auto iter = base::ranges::find(pinned_buttons_, sender);
+ const auto iter = std::ranges::find(pinned_buttons_, sender);
return iter != pinned_buttons_.end() &&
!browser_view_->GetProfile()->IsOffTheRecord();
}
@@ -435,7 +435,7 @@
void PinnedToolbarActionsContainer::MaybeRemovePoppedOutButtonFor(
const actions::ActionId& id) {
- const auto iter = base::ranges::find(
+ const auto iter = std::ranges::find(
popped_out_buttons_, id,
[](PinnedActionToolbarButton* button) { return button->GetActionId(); });
if (iter == popped_out_buttons_.end() ||
@@ -460,10 +460,10 @@
return;
}
if (GetPoppedOutButtonFor(id)) {
- const auto iter = base::ranges::find(popped_out_buttons_, id,
- [](PinnedActionToolbarButton* button) {
- return button->GetActionId();
- });
+ const auto iter = std::ranges::find(popped_out_buttons_, id,
+ [](PinnedActionToolbarButton* button) {
+ return button->GetActionId();
+ });
(*iter)->SetPinned(true);
pinned_buttons_.push_back(*iter);
popped_out_buttons_.erase(iter);
@@ -483,7 +483,7 @@
void PinnedToolbarActionsContainer::RemovePinnedActionButtonFor(
const actions::ActionId& id) {
- const auto iter = base::ranges::find(
+ const auto iter = std::ranges::find(
pinned_buttons_, id,
[](PinnedActionToolbarButton* button) { return button->GetActionId(); });
if (iter == pinned_buttons_.end()) {
@@ -503,7 +503,7 @@
PinnedActionToolbarButton* PinnedToolbarActionsContainer::GetPinnedButtonFor(
const actions::ActionId& id) {
- const auto iter = base::ranges::find(
+ const auto iter = std::ranges::find(
pinned_buttons_, id,
[](PinnedActionToolbarButton* button) { return button->GetActionId(); });
return iter == pinned_buttons_.end() ? nullptr : *iter;
@@ -511,7 +511,7 @@
PinnedActionToolbarButton* PinnedToolbarActionsContainer::GetPoppedOutButtonFor(
const actions::ActionId& id) {
- const auto iter = base::ranges::find(
+ const auto iter = std::ranges::find(
popped_out_buttons_, id,
[](PinnedActionToolbarButton* button) { return button->GetActionId(); });
return iter == popped_out_buttons_.end() ? nullptr : *iter;
diff --git a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container_unittest.cc b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container_unittest.cc
index a040bc9..2ef8f32 100644
--- a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container_unittest.cc
+++ b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container_unittest.cc
@@ -99,16 +99,16 @@
auto* container =
browser_view()->toolbar()->pinned_toolbar_actions_container();
if (should_be_popped_out) {
- ASSERT_NE(base::ranges::find(container->popped_out_buttons_, id,
- [](PinnedActionToolbarButton* button) {
- return button->GetActionId();
- }),
+ ASSERT_NE(std::ranges::find(container->popped_out_buttons_, id,
+ [](PinnedActionToolbarButton* button) {
+ return button->GetActionId();
+ }),
container->popped_out_buttons_.end());
} else {
- ASSERT_EQ(base::ranges::find(container->popped_out_buttons_, id,
- [](PinnedActionToolbarButton* button) {
- return button->GetActionId();
- }),
+ ASSERT_EQ(std::ranges::find(container->popped_out_buttons_, id,
+ [](PinnedActionToolbarButton* button) {
+ return button->GetActionId();
+ }),
container->popped_out_buttons_.end());
}
}
@@ -117,16 +117,16 @@
auto* container =
browser_view()->toolbar()->pinned_toolbar_actions_container();
if (should_be_pinned) {
- ASSERT_NE(base::ranges::find(container->pinned_buttons_, id,
- [](PinnedActionToolbarButton* button) {
- return button->GetActionId();
- }),
+ ASSERT_NE(std::ranges::find(container->pinned_buttons_, id,
+ [](PinnedActionToolbarButton* button) {
+ return button->GetActionId();
+ }),
container->pinned_buttons_.end());
} else {
- ASSERT_EQ(base::ranges::find(container->pinned_buttons_, id,
- [](PinnedActionToolbarButton* button) {
- return button->GetActionId();
- }),
+ ASSERT_EQ(std::ranges::find(container->pinned_buttons_, id,
+ [](PinnedActionToolbarButton* button) {
+ return button->GetActionId();
+ }),
container->pinned_buttons_.end());
}
}
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
index c5d82bf2..e3000c5 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -16,7 +16,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -760,7 +759,7 @@
DCHECK(display_mode_ == DisplayMode::NORMAL);
const std::array<views::Button*, 5> kButtons{back_, forward_, reload_, home_,
avatar_};
- auto* button = *base::ranges::find(kButtons, id, &views::Button::tag);
+ auto* button = *std::ranges::find(kButtons, id, &views::Button::tag);
DCHECK(button);
button->SetEnabled(enabled);
}
diff --git a/chrome/browser/ui/views/user_education/feature_promo_dialog_interactive_uitest.cc b/chrome/browser/ui/views/user_education/feature_promo_dialog_interactive_uitest.cc
index f8e9ca76..e449a87 100644
--- a/chrome/browser/ui/views/user_education/feature_promo_dialog_interactive_uitest.cc
+++ b/chrome/browser/ui/views/user_education/feature_promo_dialog_interactive_uitest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <optional>
#include <string>
#include <vector>
@@ -10,7 +11,6 @@
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
@@ -162,7 +162,7 @@
std::vector<const base::Feature*> iph_features =
feature_engagement::GetAllFeatures();
auto feature_it =
- base::ranges::find(iph_features, name, &base::Feature::name);
+ std::ranges::find(iph_features, name, &base::Feature::name);
CHECK(feature_it != iph_features.end());
return *feature_it;
}
diff --git a/chrome/browser/ui/web_applications/diagnostics/web_app_icon_health_checks.cc b/chrome/browser/ui/web_applications/diagnostics/web_app_icon_health_checks.cc
index 70cc90d7..93eb7bf 100644
--- a/chrome/browser/ui/web_applications/diagnostics/web_app_icon_health_checks.cc
+++ b/chrome/browser/ui/web_applications/diagnostics/web_app_icon_health_checks.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/ui/web_applications/diagnostics/web_app_icon_health_checks.h"
+#include <algorithm>
+
#include "base/barrier_closure.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "chrome/browser/web_applications/app_service/web_app_publisher_helper.h"
#include "chrome/browser/web_applications/commands/web_app_icon_diagnostic_command.h"
@@ -81,7 +82,7 @@
using Result = WebAppIconDiagnosticResult;
auto count = [&](auto member) {
- return base::ranges::count(results_, true, member);
+ return std::ranges::count(results_, true, member);
};
base::UmaHistogramCounts100("WebApp.Icon.AppsWithEmptyDownloadedIconSizes",
diff --git a/chrome/browser/ui/web_applications/share_target_utils.cc b/chrome/browser/ui/web_applications/share_target_utils.cc
index d0642e8..ae547dec 100644
--- a/chrome/browser/ui/web_applications/share_target_utils.cc
+++ b/chrome/browser/ui/web_applications/share_target_utils.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/ui/web_applications/share_target_utils.h"
+#include <algorithm>
#include <optional>
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
@@ -99,7 +99,7 @@
for (const apps::ShareTarget::Files& files : share_target.params.files) {
// Filter on MIME types. Chrome OS does not filter on file extensions.
// https://w3c.github.io/web-share-target/level-2/#dfn-accepted
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
files.accept, [&mime_type](const auto& criteria) {
return !base::StartsWith(criteria, ".") &&
net::MatchesMimeType(criteria, mime_type);
diff --git a/chrome/browser/ui/web_applications/sub_apps_service_impl.cc b/chrome/browser/ui/web_applications/sub_apps_service_impl.cc
index 44fd1cf..2797616e 100644
--- a/chrome/browser/ui/web_applications/sub_apps_service_impl.cc
+++ b/chrome/browser/ui/web_applications/sub_apps_service_impl.cc
@@ -591,7 +591,7 @@
void SubAppsServiceImpl::NotifyUninstall(
RemoveCallback result_callback,
std::vector<SubAppsServiceRemoveResultPtr> remove_results) {
- int num_successful_uninstalls = base::ranges::count(
+ int num_successful_uninstalls = std::ranges::count(
remove_results, SubAppsServiceResultCode::kSuccess,
[](const auto& result) { return result->result_code; });
diff --git a/chrome/browser/ui/web_applications/web_app_metrics.cc b/chrome/browser/ui/web_applications/web_app_metrics.cc
index 9140e066..c9471af 100644
--- a/chrome/browser/ui/web_applications/web_app_metrics.cc
+++ b/chrome/browser/ui/web_applications/web_app_metrics.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/web_applications/web_app_metrics.h"
+#include <algorithm>
#include <optional>
#include <string>
@@ -14,7 +15,6 @@
#include "base/observer_list.h"
#include "base/one_shot_event.h"
#include "base/power_monitor/power_monitor.h"
-#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#include "chrome/browser/after_startup_task_utils.h"
diff --git a/chrome/browser/ui/web_applications/web_app_run_on_os_login_notification.cc b/chrome/browser/ui/web_applications/web_app_run_on_os_login_notification.cc
index 8e7f12e..ebe6ebb 100644
--- a/chrome/browser/ui/web_applications/web_app_run_on_os_login_notification.cc
+++ b/chrome/browser/ui/web_applications/web_app_run_on_os_login_notification.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/web_applications/web_app_run_on_os_login_notification.h"
+#include <algorithm>
#include <memory>
#include <vector>
#include "base/functional/callback_forward.h"
#include "base/i18n/message_formatter.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/notifications/notification_display_service.h"
@@ -82,7 +82,7 @@
"NUM_ROOL_APPS", 1, "APP_NAME", truncated_app_name);
}
} else {
- if (base::ranges::any_of(apps, [](const auto& app) {
+ if (std::ranges::any_of(apps, [](const auto& app) {
return app.second.is_prevent_close_enabled;
})) {
message = base::i18n::MessageFormatter::FormatWithNamedArgs(
diff --git a/chrome/browser/ui/webauthn/sheet_models.cc b/chrome/browser/ui/webauthn/sheet_models.cc
index 71284363..144c8e2 100644
--- a/chrome/browser/ui/webauthn/sheet_models.cc
+++ b/chrome/browser/ui/webauthn/sheet_models.cc
@@ -18,7 +18,6 @@
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
@@ -1502,8 +1501,8 @@
webauthn::user_actions::RecordMultipleOptionsShown(
dialog_model->mechanisms, dialog_model->request_type);
- if (base::ranges::any_of(dialog_model->mechanisms,
- &IsLocalPasskeyOrEnclaveAuthenticator)) {
+ if (std::ranges::any_of(dialog_model->mechanisms,
+ &IsLocalPasskeyOrEnclaveAuthenticator)) {
primary_passkeys_label_ =
l10n_util::GetStringUTF16(IDS_WEBAUTHN_THIS_DEVICE_LABEL);
for (size_t i = 0; i < dialog_model->mechanisms.size(); ++i) {
@@ -1552,7 +1551,7 @@
using Mechanism = AuthenticatorRequestDialogModel::Mechanism;
// If any phones or passkeys from a phone are shown then also show a button
// that goes to the settings page to manage them.
- return base::ranges::any_of(
+ return std::ranges::any_of(
dialog_model()->mechanisms, [](const Mechanism& mech) {
return absl::holds_alternative<Mechanism::Phone>(mech.type) ||
(absl::holds_alternative<Mechanism::Credential>(mech.type) &&
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc
index 0ce0e1b1..b2b7cd0 100644
--- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc
+++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h"
+#include <algorithm>
#include <numeric>
#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_factory.h"
@@ -221,7 +221,7 @@
DCHECK(media_route_starter_) << "Must have a MediaRouteStarter to complete!";
// Verify that the sink is in QRM.
- if (base::ranges::none_of(cast_mode_set_, [this](MediaCastMode cast_mode) {
+ if (std::ranges::none_of(cast_mode_set_, [this](MediaCastMode cast_mode) {
return media_route_starter_->SinkSupportsCastMode(*sink_id_, cast_mode);
})) {
// sink hasn't been added to QRM yet.
diff --git a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc
index a83b4d6a..b3b001d 100644
--- a/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc
+++ b/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h"
+#include <algorithm>
+
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
@@ -293,7 +294,7 @@
// this to occur).
ON_CALL(*router(), UnregisterMediaSinksObserver(_))
.WillByDefault([this](MediaSinksObserver* observer) {
- auto it = base::ranges::find(media_sinks_observers_, observer);
+ auto it = std::ranges::find(media_sinks_observers_, observer);
if (it != media_sinks_observers_.end()) {
media_sinks_observers_.erase(it);
}
diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
index d74477f..ba97d3d 100644
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/accessibility/accessibility_ui.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <optional>
@@ -18,7 +19,6 @@
#include "base/json/json_writer.h"
#include "base/memory/raw_ref.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
@@ -429,7 +429,7 @@
saved_process_mode_ = process_accessibility_mode_->mode();
process_accessibility_mode_.reset();
- base::ranges::for_each(
+ std::ranges::for_each(
page_accessibility_modes_,
[](PageAccessibilityMode& page_mode) { page_mode.Save(); },
&std::map<void*, PageAccessibilityMode>::value_type::second);
@@ -445,7 +445,7 @@
browser_accessibility_state.CreateScopedModeForProcess(
std::exchange(saved_process_mode_, ui::AXMode()));
- base::ranges::for_each(
+ std::ranges::for_each(
page_accessibility_modes_,
[&browser_accessibility_state](PageAccessibilityMode& page_mode) {
page_mode.Restore(browser_accessibility_state);
diff --git a/chrome/browser/ui/webui/app_management/app_management_page_handler_base.cc b/chrome/browser/ui/webui/app_management/app_management_page_handler_base.cc
index fbfd4d9f..905b195 100644
--- a/chrome/browser/ui/webui/app_management/app_management_page_handler_base.cc
+++ b/chrome/browser/ui/webui/app_management/app_management_page_handler_base.cc
@@ -239,7 +239,7 @@
// Mime types are ignored.
std::set<std::string> mime_types;
for (auto& filter : filters) {
- bool is_potential_file_handler_action = base::ranges::any_of(
+ bool is_potential_file_handler_action = std::ranges::any_of(
filter->conditions.begin(), filter->conditions.end(),
[](const std::unique_ptr<apps::Condition>& condition) {
if (condition->condition_type != apps::ConditionType::kAction) {
diff --git a/chrome/browser/ui/webui/app_service_internals/app_service_internals_page_handler_impl.cc b/chrome/browser/ui/webui/app_service_internals/app_service_internals_page_handler_impl.cc
index 5594b13c..a5536023 100644
--- a/chrome/browser/ui/webui/app_service_internals/app_service_internals_page_handler_impl.cc
+++ b/chrome/browser/ui/webui/app_service_internals/app_service_internals_page_handler_impl.cc
@@ -12,7 +12,6 @@
#include <vector>
#include "base/containers/flat_map.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/ui/webui/app_service_internals/app_service_internals.mojom-forward.h"
@@ -45,8 +44,8 @@
debug_info.str());
});
- base::ranges::sort(apps, std::less<>(),
- [](const auto& app) { return app->name; });
+ std::ranges::sort(apps, std::less<>(),
+ [](const auto& app) { return app->name; });
return apps;
}
@@ -76,8 +75,8 @@
preferred_apps.push_back(std::move(ptr));
}
- base::ranges::sort(preferred_apps, std::less<>(),
- [](const auto& app) { return app->name; });
+ std::ranges::sort(preferred_apps, std::less<>(),
+ [](const auto& app) { return app->name; });
return preferred_apps;
}
@@ -100,7 +99,7 @@
debug_info.str());
}
- base::ranges::sort(promise_apps, std::less<>(), [](const auto& promise_app) {
+ std::ranges::sort(promise_apps, std::less<>(), [](const auto& promise_app) {
return promise_app->package_id;
});
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
index ea1ec02a..e547124 100644
--- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
+++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
@@ -322,8 +322,8 @@
bool HasFileWithExtensionFromSet(
const std::vector<storage::FileSystemURL>& file_urls,
const std::set<std::string>& extensions) {
- return base::ranges::any_of(file_urls, [&extensions](const auto& file_url) {
- return base::ranges::any_of(extensions, [&file_url](const auto& extension) {
+ return std::ranges::any_of(file_urls, [&extensions](const auto& file_url) {
+ return std::ranges::any_of(extensions, [&file_url](const auto& extension) {
return file_url.path().MatchesExtension(extension);
});
});
@@ -349,7 +349,7 @@
bool HaveExplicitFileHandlers(
Profile* profile,
const std::vector<storage::FileSystemURL>& file_urls) {
- return base::ranges::all_of(file_urls, [profile](const auto& url) {
+ return std::ranges::all_of(file_urls, [profile](const auto& url) {
return fm_tasks::HasExplicitDefaultFileHandler(profile,
url.path().FinalExtension());
});
@@ -359,7 +359,7 @@
// pre-existing preference for these file types.
bool HaveExplicitFileHandlers(Profile* profile,
const std::set<std::string>& extensions) {
- return base::ranges::all_of(extensions, [profile](const auto& extension) {
+ return std::ranges::all_of(extensions, [profile](const auto& extension) {
return fm_tasks::HasExplicitDefaultFileHandler(profile, extension);
});
}
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc
index 6dd5a80..d5c5176b 100644
--- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc
+++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h"
+#include <algorithm>
#include <optional>
#include "ash/constants/web_app_id_constants.h"
#include "ash/webui/system_apps/public/system_web_app_type.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/ash/file_manager/fileapi_util.h"
@@ -246,7 +246,7 @@
bool IsODFSInstalled(Profile* profile) {
auto* service = ash::file_system_provider::Service::Get(profile);
- return base::ranges::any_of(
+ return std::ranges::any_of(
service->GetProviders(), [](const auto& provider) {
return provider.first ==
ash::file_system_provider::ProviderId::CreateFromExtensionId(
diff --git a/chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_browsertest.cc b/chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_browsertest.cc
index ac401d83..652bd03 100644
--- a/chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_browsertest.cc
+++ b/chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_browsertest.cc
@@ -27,7 +27,7 @@
bool IsSettingsWindowOpened() {
auto* browser_list = BrowserList::GetInstance();
- return base::ranges::count_if(*browser_list, [](Browser* browser) {
+ return std::ranges::count_if(*browser_list, [](Browser* browser) {
return ash::IsBrowserForSystemWebApp(
browser, ash::SystemWebAppType::SETTINGS);
}) != 0;
diff --git a/chrome/browser/ui/webui/ash/login/l10n_util.cc b/chrome/browser/ui/webui/ash/login/l10n_util.cc
index cf7b8cb..93965fe 100644
--- a/chrome/browser/ui/webui/ash/login/l10n_util.cc
+++ b/chrome/browser/ui/webui/ash/login/l10n_util.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
@@ -20,7 +21,6 @@
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -260,7 +260,7 @@
out_display_names.push_back(divider16);
}
- base::ranges::copy(display_names, std::back_inserter(out_display_names));
+ std::ranges::copy(display_names, std::back_inserter(out_display_names));
// Build the language list from the language map.
base::Value::List language_list;
diff --git a/chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.cc b/chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.cc
index 10362f2..0f7383cc 100644
--- a/chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.cc
+++ b/chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.h"
+#include <algorithm>
#include <string_view>
#include <utility>
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
-#include "base/ranges/algorithm.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/drive/drive_integration_service.h"
@@ -52,7 +52,7 @@
}
child_folders.push_back(std::move(stripped_path));
}
- base::ranges::sort(child_folders);
+ std::ranges::sort(child_folders);
return child_folders;
}
diff --git a/chrome/browser/ui/webui/ash/settings/calculator/size_calculator.cc b/chrome/browser/ui/webui/ash/settings/calculator/size_calculator.cc
index 3a7d4f1f..7ccb611 100644
--- a/chrome/browser/ui/webui/ash/settings/calculator/size_calculator.cc
+++ b/chrome/browser/ui/webui/ash/settings/calculator/size_calculator.cc
@@ -444,8 +444,8 @@
UpdateAppsAndExtensionsSize();
return;
}
- auto image = base::ranges::find(response->images(), "borealis",
- &vm_tools::concierge::VmDiskInfo::name);
+ auto image = std::ranges::find(response->images(), "borealis",
+ &vm_tools::concierge::VmDiskInfo::name);
if (image == response->images().end()) {
LOG(ERROR) << "Couldn't find Borealis VM";
has_borealis_apps_size_ = true;
@@ -510,8 +510,8 @@
if (borealis::BorealisServiceFactory::GetForProfile(profile_)
->Features()
.IsEnabled()) {
- auto image = base::ranges::find(response->images(), "borealis",
- &vm_tools::concierge::VmDiskInfo::name);
+ auto image = std::ranges::find(response->images(), "borealis",
+ &vm_tools::concierge::VmDiskInfo::name);
if (image == response->images().end()) {
LOG(ERROR) << "Couldn't find Borealis VM";
} else {
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
index 87e439d9..2ac85bad8 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/accelerator_actions.h"
#include "ash/public/cpp/input_device_settings_controller.h"
@@ -15,7 +17,6 @@
#include "ash/system/keyboard_brightness_control_delegate.h"
#include "base/containers/flat_set.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/app_service_proxy_ash.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@@ -151,7 +152,7 @@
std::move(devices));
std::vector<T> devices_no_duplicates =
std::move(devices_no_duplicates_set).extract();
- base::ranges::sort(devices_no_duplicates, CompareDevices<T>);
+ std::ranges::sort(devices_no_duplicates, CompareDevices<T>);
return devices_no_duplicates;
}
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider_unittest.cc b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider_unittest.cc
index 801c815..e7625a7 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider_unittest.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.h"
+#include <algorithm>
#include <memory>
#include <vector>
@@ -16,7 +17,6 @@
#include "ash/system/keyboard_brightness_control_delegate.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
@@ -152,7 +152,7 @@
}
for (size_t i = 0; i < expected_list.size(); i++) {
- auto actual_iter = base::ranges::find(actual_list, expected_list[i]);
+ auto actual_iter = std::ranges::find(actual_list, expected_list[i]);
EXPECT_NE(actual_list.end(), actual_iter);
if (actual_iter != actual_list.end()) {
EXPECT_EQ(expected_list[i], *actual_iter);
@@ -478,7 +478,7 @@
}
void RemoveKeyboard(uint32_t device_id) {
auto iter =
- base::ranges::find_if(keyboards_, [device_id](const auto& keyboard) {
+ std::ranges::find_if(keyboards_, [device_id](const auto& keyboard) {
return keyboard->id == device_id;
});
if (iter == keyboards_.end()) {
@@ -501,7 +501,7 @@
observer_->OnMouseConnected(*mice_.back());
}
void RemoveMouse(uint32_t device_id) {
- auto iter = base::ranges::find_if(mice_, [device_id](const auto& mouse) {
+ auto iter = std::ranges::find_if(mice_, [device_id](const auto& mouse) {
return mouse->id == device_id;
});
if (iter == mice_.end()) {
@@ -517,7 +517,7 @@
}
void RemoveTouchpad(uint32_t device_id) {
auto iter =
- base::ranges::find_if(touchpads_, [device_id](const auto& touchpad) {
+ std::ranges::find_if(touchpads_, [device_id](const auto& touchpad) {
return touchpad->id == device_id;
});
if (iter == touchpads_.end()) {
@@ -532,10 +532,10 @@
observer_->OnPointingStickConnected(*pointing_sticks_.back());
}
void RemovePointingStick(uint32_t device_id) {
- auto iter = base::ranges::find_if(pointing_sticks_,
- [device_id](const auto& pointing_stick) {
- return pointing_stick->id == device_id;
- });
+ auto iter = std::ranges::find_if(pointing_sticks_,
+ [device_id](const auto& pointing_stick) {
+ return pointing_stick->id == device_id;
+ });
if (iter == pointing_sticks_.end()) {
return;
}
@@ -548,10 +548,10 @@
observer_->OnGraphicsTabletConnected(*graphics_tablets_.back());
}
void RemoveGraphicsTablet(uint32_t device_id) {
- auto iter = base::ranges::find_if(graphics_tablets_,
- [device_id](const auto& graphics_tablet) {
- return graphics_tablet->id == device_id;
- });
+ auto iter = std::ranges::find_if(graphics_tablets_,
+ [device_id](const auto& graphics_tablet) {
+ return graphics_tablet->id == device_id;
+ });
if (iter == graphics_tablets_.end()) {
return;
}
diff --git a/chrome/browser/ui/webui/ash/settings/pages/printing/cups_printers_handler.cc b/chrome/browser/ui/webui/ash/settings/pages/printing/cups_printers_handler.cc
index f7e2291..b7ab66b 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/printing/cups_printers_handler.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/printing/cups_printers_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/ash/settings/pages/printing/cups_printers_handler.h"
+#include <algorithm>
#include <optional>
#include <set>
#include <utility>
@@ -21,7 +22,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/thread_pool.h"
@@ -1400,9 +1400,8 @@
const PpdProvider::ResolvedPrintersList& printers_for_manufacturer =
resolved_printers_it->second;
- auto printer_it =
- base::ranges::find(printers_for_manufacturer, ppd_model,
- &PpdProvider::ResolvedPpdReference::name);
+ auto printer_it = std::ranges::find(printers_for_manufacturer, ppd_model,
+ &PpdProvider::ResolvedPpdReference::name);
if (printer_it == printers_for_manufacturer.end()) {
// Unable to find the PpdReference, resolve promise with empty string.
diff --git a/chrome/browser/ui/webui/ash/settings/pages/privacy/app_permission_handler.cc b/chrome/browser/ui/webui/ash/settings/pages/privacy/app_permission_handler.cc
index ea4ea451..51852ed5 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/privacy/app_permission_handler.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/privacy/app_permission_handler.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/ui/webui/ash/settings/pages/privacy/app_permission_handler.h"
+#include <algorithm>
+
#include "ash/constants/web_app_id_constants.h"
#include "ash/public/cpp/new_window_delegate.h"
#include "ash/webui/projector_app/public/cpp/projector_app_constants.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/ash/eche_app/app_id.h"
@@ -29,7 +30,7 @@
}
bool HasRelevantPermission(const apps::AppUpdate& update) {
- return base::ranges::any_of(update.Permissions(), &IsPermissionTypeRelevant);
+ return std::ranges::any_of(update.Permissions(), &IsPermissionTypeRelevant);
}
app_permission::mojom::AppPtr CreateAppPtr(const apps::AppUpdate& update) {
diff --git a/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_hub_handler_unittest.cc b/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_hub_handler_unittest.cc
index 3d231ed..bf7ce1de 100644
--- a/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_hub_handler_unittest.cc
+++ b/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_hub_handler_unittest.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_hub_handler.h"
+#include <algorithm>
+
#include "ash/constants/ash_features.h"
#include "base/containers/adapters.h"
-#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "chrome/browser/ash/privacy_hub/privacy_hub_util.h"
diff --git a/chrome/browser/ui/webui/ash/settings/search/search_handler.cc b/chrome/browser/ui/webui/ash/settings/search/search_handler.cc
index 46280d6..1f696677ab 100644
--- a/chrome/browser/ui/webui/ash/settings/search/search_handler.cc
+++ b/chrome/browser/ui/webui/ash/settings/search/search_handler.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/ui/webui/ash/settings/search/search_handler.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/ui/webui/ash/settings/pages/os_settings_sections.h"
#include "chrome/browser/ui/webui/ash/settings/search/hierarchy.h"
@@ -26,7 +27,7 @@
bool ContainsSectionResult(const std::vector<mojom::SearchResultPtr>& results,
mojom::Section section) {
- return base::ranges::any_of(results, [section](const auto& result) {
+ return std::ranges::any_of(results, [section](const auto& result) {
return result->type == mojom::SearchResultType::kSection &&
section == result->id->get_section();
});
@@ -34,7 +35,7 @@
bool ContainsSubpageResult(const std::vector<mojom::SearchResultPtr>& results,
mojom::Subpage subpage) {
- return base::ranges::any_of(results, [subpage](const auto& result) {
+ return std::ranges::any_of(results, [subpage](const auto& result) {
return result->type == mojom::SearchResultType::kSubpage &&
subpage == result->id->get_subpage();
});
diff --git a/chrome/browser/ui/webui/ash/system_web_dialog/system_web_dialog_delegate.cc b/chrome/browser/ui/webui/ash/system_web_dialog/system_web_dialog_delegate.cc
index 4ce3aedf..457e2f7 100644
--- a/chrome/browser/ui/webui/ash/system_web_dialog/system_web_dialog_delegate.cc
+++ b/chrome/browser/ui/webui/ash/system_web_dialog/system_web_dialog_delegate.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/webui/ash/system_web_dialog/system_web_dialog_delegate.h"
+#include <algorithm>
#include <list>
#include "ash/public/cpp/shell_window_ids.h"
#include "base/containers/contains.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/views/chrome_web_dialog_view.h"
#include "components/session_manager/core/session_manager.h"
@@ -87,7 +87,7 @@
SystemWebDialogDelegate* SystemWebDialogDelegate::FindInstance(
const std::string& id) {
auto* instances = GetInstances();
- auto iter = base::ranges::find(*instances, id, &SystemWebDialogDelegate::Id);
+ auto iter = std::ranges::find(*instances, id, &SystemWebDialogDelegate::Id);
return iter == instances->end() ? nullptr : *iter;
}
diff --git a/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc b/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc
index f0474b70..f3ac548 100644
--- a/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc
+++ b/chrome/browser/ui/webui/downloads/downloads_list_tracker.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/downloads/downloads_list_tracker.h"
+#include <algorithm>
#include <iterator>
#include <optional>
#include <string>
@@ -16,7 +17,6 @@
#include "base/i18n/rtl.h"
#include "base/i18n/unicodestring.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -251,7 +251,7 @@
auto sent_items_end_it = sorted_items_.begin();
std::advance(sent_items_end_it, sent_to_page_);
- return base::ranges::count_if(
+ return std::ranges::count_if(
sorted_items_.begin(), sent_items_end_it,
[](download::DownloadItem* item) { return item->IsDangerous(); });
}
@@ -260,7 +260,7 @@
auto sent_items_end_it = sorted_items_.begin();
std::advance(sent_items_end_it, sent_to_page_);
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
sorted_items_.begin(), sent_items_end_it,
[](download::DownloadItem* item) {
return item->GetState() != download::DownloadItem::CANCELLED &&
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
index 52b2271f..eada945b 100644
--- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
+++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
@@ -14,7 +14,6 @@
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -353,7 +352,7 @@
}
std::vector<history::VisitID> visit_ids;
- base::ranges::transform(
+ std::ranges::transform(
visits, std::back_inserter(visit_ids),
[](const auto& url_visit_ptr) { return url_visit_ptr->visit_id; });
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
index 191b8a6..7510f2c 100644
--- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
+++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -26,7 +26,6 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -872,11 +871,11 @@
}
// Second, append Finch order for modules _not_ ordered by drag&drop.
- base::ranges::copy_if(ntp_features::GetModulesOrder(),
- std::back_inserter(module_ids),
- [&module_ids](const std::string& id) {
- return !base::Contains(module_ids, id);
- });
+ std::ranges::copy_if(ntp_features::GetModulesOrder(),
+ std::back_inserter(module_ids),
+ [&module_ids](const std::string& id) {
+ return !base::Contains(module_ids, id);
+ });
std::move(callback).Run(std::move(module_ids));
}
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
index 4989341..d5533f32 100644
--- a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
+++ b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <string>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/base64.h"
#include "base/check.h"
#include "base/functional/bind.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -297,7 +297,7 @@
AutocompleteController::ExtendMatchSubtypes(input, &subtypes);
std::vector<std::string> subtypes_str;
subtypes_str.push_back(base::NumberToString(type));
- base::ranges::transform(
+ std::ranges::transform(
subtypes, std::back_inserter(subtypes_str),
[](int subtype) { return base::NumberToString(subtype); });
result->aqs_type_subtypes = base::JoinString(subtypes_str, ",");
diff --git a/chrome/browser/ui/webui/password_manager/promo_cards_handler.cc b/chrome/browser/ui/webui/password_manager/promo_cards_handler.cc
index 8d33175..b58c668b 100644
--- a/chrome/browser/ui/webui/password_manager/promo_cards_handler.cc
+++ b/chrome/browser/ui/webui/password_manager/promo_cards_handler.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/ui/webui/password_manager/promo_cards_handler.h"
+#include <algorithm>
#include <memory>
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h"
@@ -157,7 +157,7 @@
return nullptr;
}
// Sort based on last time shown.
- auto* promo_to_show = *base::ranges::min_element(
+ auto* promo_to_show = *std::ranges::min_element(
promo_card_to_show_candidates, [](auto* lhs, auto* rhs) {
return lhs->last_time_shown() < rhs->last_time_shown();
});
diff --git a/chrome/browser/ui/webui/settings/custom_home_pages_table_model.cc b/chrome/browser/ui/webui/settings/custom_home_pages_table_model.cc
index 7d28517a..96679f1 100644
--- a/chrome/browser/ui/webui/settings/custom_home_pages_table_model.cc
+++ b/chrome/browser/ui/webui/settings/custom_home_pages_table_model.cc
@@ -6,10 +6,11 @@
#include <stddef.h>
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/rtl.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/history/history_service_factory.h"
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
index 80bb5920..27a5c0f 100644
--- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
+#include <algorithm>
#include <vector>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "chrome/browser/browsing_data/browsing_data_important_sites_util.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h"
diff --git a/chrome/browser/ui/webui/settings/settings_security_key_handler.cc b/chrome/browser/ui/webui/settings/settings_security_key_handler.cc
index 1825baed..0c91077 100644
--- a/chrome/browser/ui/webui/settings/settings_security_key_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_security_key_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/settings/settings_security_key_handler.h"
+#include <algorithm>
#include <optional>
#include <string>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/platform_util.h"
@@ -75,7 +75,7 @@
return false;
}
- base::ranges::copy(bytes, out->begin());
+ std::ranges::copy(bytes, out->begin());
return true;
}
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc
index 8609c20..721bbc96 100644
--- a/chrome/browser/ui/webui/settings/site_settings_handler.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/settings/site_settings_handler.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <string_view>
@@ -26,7 +27,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -1786,7 +1786,7 @@
content::WebContents* web_contents = tab_strip->GetWebContentsAt(i);
GURL tab_url = web_contents->GetLastCommittedURL();
const bool tab_is_same_origin = url::IsSameOriginWith(origin, tab_url);
- const bool tab_might_embed_origin = base::ranges::any_of(
+ const bool tab_might_embed_origin = std::ranges::any_of(
additional_patterns_for_infobar, [&](const auto& additional_pattern) {
return additional_pattern.Matches(tab_url);
});
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc
index 962eab7..6c1c9d2 100644
--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
@@ -20,7 +20,6 @@
#include "base/json/values_util.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -1310,8 +1309,8 @@
}
}
// Sort exceptions by origin name, alphabetically.
- base::ranges::sort(*exceptions, [](const base::Value::Dict& lhs,
- const base::Value::Dict& rhs) {
+ std::ranges::sort(*exceptions, [](const base::Value::Dict& lhs,
+ const base::Value::Dict& rhs) {
return lhs.Find(kOrigin)->GetString() < rhs.Find(kOrigin)->GetString();
});
}
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_helper_unittest.cc
index d5078f5..4a599251 100644
--- a/chrome/browser/ui/webui/settings/site_settings_helper_unittest.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_helper_unittest.cc
@@ -1637,7 +1637,7 @@
EXPECT_EQ(CONTENT_SETTING_BLOCK, content_setting);
const auto types = GetVisiblePermissionCategories(
app_url_info.origin().GetURL().spec(), profile());
- EXPECT_TRUE(base::ranges::any_of(types, [](auto& t) { return t == type; }));
+ EXPECT_TRUE(std::ranges::any_of(types, [](auto& t) { return t == type; }));
}
} // namespace site_settings
diff --git a/chrome/browser/ui/webui/signin/profile_picker_handler.cc b/chrome/browser/ui/webui/signin/profile_picker_handler.cc
index 2d6b6671..b87173e 100644
--- a/chrome/browser/ui/webui/signin/profile_picker_handler.cc
+++ b/chrome/browser/ui/webui/signin/profile_picker_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/signin/profile_picker_handler.h"
+#include <algorithm>
#include <vector>
#include "base/check.h"
@@ -16,7 +17,6 @@
#include "base/json/values_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
diff --git a/chrome/browser/ui/webui/signin/profile_picker_handler_unittest.cc b/chrome/browser/ui/webui/signin/profile_picker_handler_unittest.cc
index b7f53b1..0860a225 100644
--- a/chrome/browser/ui/webui/signin/profile_picker_handler_unittest.cc
+++ b/chrome/browser/ui/webui/signin/profile_picker_handler_unittest.cc
@@ -104,7 +104,7 @@
}
void VerifyIfGuestModeUpdateWasCalled(bool expected_guest_mode) {
- auto it = base::ranges::find_if(web_ui()->call_data(), [](auto& data_ptr) {
+ auto it = std::ranges::find_if(web_ui()->call_data(), [](auto& data_ptr) {
return data_ptr->function_name() == "cr.webUIListenerCallback" &&
data_ptr->arg1()->GetString() == "guest-mode-availability-updated";
});
diff --git a/chrome/browser/ui/webui/support_tool/support_tool_ui.cc b/chrome/browser/ui/webui/support_tool/support_tool_ui.cc
index 40498a9..7e47dc3 100644
--- a/chrome/browser/ui/webui/support_tool/support_tool_ui.cc
+++ b/chrome/browser/ui/webui/support_tool/support_tool_ui.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/support_tool/support_tool_ui.h"
+#include <algorithm>
#include <optional>
#include <set>
#include <string>
@@ -15,7 +16,6 @@
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -449,8 +449,8 @@
data_path_ = path;
base::Value::Dict data_export_result;
const auto& export_error =
- base::ranges::find(errors, SupportToolErrorCode::kDataExportError,
- &SupportToolError::error_code);
+ std::ranges::find(errors, SupportToolErrorCode::kDataExportError,
+ &SupportToolError::error_code);
if (export_error == errors.end()) {
data_export_result.Set("success", true);
data_export_result.Set("path", path.BaseName().AsUTF8Unsafe());
diff --git a/chrome/browser/ui/webui/sync_internals/chrome_sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals/chrome_sync_internals_message_handler.cc
index e6da4695..70b668b 100644
--- a/chrome/browser/ui/webui/sync_internals/chrome_sync_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/sync_internals/chrome_sync_internals_message_handler.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/webui/sync_internals/chrome_sync_internals_message_handler.h"
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/span.h"
-#include "base/ranges/algorithm.h"
ChromeSyncInternalsMessageHandler::ChromeSyncInternalsMessageHandler(
signin::IdentityManager* identity_manager,
@@ -29,7 +29,7 @@
base::span<const base::ValueView> args) {
std::vector<base::ValueView> event_name_and_args;
event_name_and_args.push_back(event_name);
- base::ranges::copy(args, std::back_inserter(event_name_and_args));
+ std::ranges::copy(args, std::back_inserter(event_name_and_args));
base::span<base::ValueView> mutable_span(event_name_and_args);
// `mutable_span` will be implicitly converted to a const one. Declaring
// std::vector<const base::ValueView> above is not an option, because
diff --git a/chrome/browser/ui/webui/tab_search/tab_search_page_handler.cc b/chrome/browser/ui/webui/tab_search/tab_search_page_handler.cc
index f15e368a..e1d34ad 100644
--- a/chrome/browser/ui/webui/tab_search/tab_search_page_handler.cc
+++ b/chrome/browser/ui/webui/tab_search/tab_search_page_handler.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <iterator>
#include <memory>
#include <set>
@@ -17,7 +18,6 @@
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
@@ -543,7 +543,7 @@
CHECK(tab);
for (auto& [duplicate_url, duplicate_tab_list] : duplicate_tabs_) {
- auto found_it = base::ranges::find(duplicate_tab_list, tab);
+ auto found_it = std::ranges::find(duplicate_tab_list, tab);
if (found_it != duplicate_tab_list.end()) {
// Remove the specific tab from `duplicate_tabs_` and subscription maps.
duplicate_tab_list.erase(found_it);
@@ -1466,16 +1466,16 @@
std::vector<TabAlertState> alert_states =
GetTabAlertStatesForContents(contents);
// Currently, we only report media alert states.
- base::ranges::copy_if(alert_states.begin(), alert_states.end(),
- std::back_inserter(tab_data->alert_states),
- [](TabAlertState alert) {
- return alert == TabAlertState::MEDIA_RECORDING ||
- alert == TabAlertState::AUDIO_RECORDING ||
- alert == TabAlertState::VIDEO_RECORDING ||
- alert == TabAlertState::AUDIO_PLAYING ||
- alert == TabAlertState::AUDIO_MUTING ||
- alert == TabAlertState::GLIC_ACCESSING;
- });
+ std::ranges::copy_if(alert_states.begin(), alert_states.end(),
+ std::back_inserter(tab_data->alert_states),
+ [](TabAlertState alert) {
+ return alert == TabAlertState::MEDIA_RECORDING ||
+ alert == TabAlertState::AUDIO_RECORDING ||
+ alert == TabAlertState::VIDEO_RECORDING ||
+ alert == TabAlertState::AUDIO_PLAYING ||
+ alert == TabAlertState::AUDIO_MUTING ||
+ alert == TabAlertState::GLIC_ACCESSING;
+ });
return tab_data;
}
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc
index 5f6d0caf..539dfaf 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/ui/webui/theme_source.h"
+#include <algorithm>
#include <string_view>
#include "base/functional/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -295,7 +295,7 @@
std::string set_name, ui::ColorId start, ui::ColorId end,
ColorIdCSSCallback color_css_name) {
// Only return these mappings if specified in the query parameter.
- auto it = base::ranges::find(color_id_sets, set_name);
+ auto it = std::ranges::find(color_id_sets, set_name);
if (it == color_id_sets.end()) {
return std::string();
}
diff --git a/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.cc b/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.cc
index b8279a2..3db317f 100644
--- a/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.cc
+++ b/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.cc
@@ -209,9 +209,9 @@
content::WebContents* contents) {
// Persist regions to allow support transfer between hosts.
draggable_regions_.emplace();
- base::ranges::transform(regions,
- std::back_inserter(draggable_regions_.value()),
- &blink::mojom::DraggableRegionPtr::Clone);
+ std::ranges::transform(regions,
+ std::back_inserter(draggable_regions_.value()),
+ &blink::mojom::DraggableRegionPtr::Clone);
if (host_) {
host_->DraggableRegionsChanged(regions, contents);
}
diff --git a/chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.cc b/chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.cc
index 69aa2957..e5f7814 100644
--- a/chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.cc
+++ b/chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.h"
+#include <algorithm>
#include <string>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/files/file_util.h"
#include "base/functional/callback_helpers.h"
#include "base/functional/overloaded.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
diff --git a/chrome/browser/updater/browser_updater_client.cc b/chrome/browser/updater/browser_updater_client.cc
index 37b9872..699be52 100644
--- a/chrome/browser/updater/browser_updater_client.cc
+++ b/chrome/browser/updater/browser_updater_client.cc
@@ -15,7 +15,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/bind_post_task.h"
@@ -173,7 +172,7 @@
base::OnceCallback<void(bool)> callback,
const std::vector<updater::UpdateService::AppState>& apps) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- const auto updater = base::ranges::find_if(
+ const auto updater = std::ranges::find_if(
apps, [](const updater::UpdateService::AppState& state) {
return base::EqualsCaseInsensitiveASCII(state.app_id,
updater::kUpdaterAppId);
@@ -182,7 +181,7 @@
*GetLastKnownUpdaterRegistrationStorage() = *updater;
}
const auto app =
- base::ranges::find_if(apps, &BrowserUpdaterClient::AppMatches);
+ std::ranges::find_if(apps, &BrowserUpdaterClient::AppMatches);
if (app != apps.end()) {
*GetLastKnownBrowserRegistrationStorage() = *app;
}
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
index 21025d37..b55d36dd 100644
--- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
+++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
@@ -6,7 +6,9 @@
#include <stdint.h>
+#include <algorithm>
#include <array>
+#include <functional>
#include <optional>
#include <string>
@@ -17,8 +19,6 @@
#include "base/functional/bind.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
-#include "base/ranges/functional.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
@@ -319,8 +319,7 @@
} else {
// |stages_| must be sorted by decreasing TimeDelta.
std::array<base::TimeDelta, kNumStages>::iterator it =
- base::ranges::lower_bound(stages_, time_passed,
- base::ranges::greater());
+ std::ranges::lower_bound(stages_, time_passed, std::ranges::greater());
if (it != stages_.end())
new_stage = StageIndexToAnnoyanceLevel(it - stages_.begin());
if (it != stages_.begin())
diff --git a/chrome/browser/usb/usb_chooser_controller.cc b/chrome/browser/usb/usb_chooser_controller.cc
index fae7dec..86b8dc7 100644
--- a/chrome/browser/usb/usb_chooser_controller.cc
+++ b/chrome/browser/usb/usb_chooser_controller.cc
@@ -6,11 +6,11 @@
#include <stddef.h>
+#include <algorithm>
#include <utility>
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -270,7 +270,7 @@
return false;
}
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
options_->exclusion_filters, [&device_info](const auto& filter) {
return device::UsbDeviceFilterMatches(*filter, device_info);
})) {
diff --git a/chrome/browser/usb/usb_pinned_notification_unittest.cc b/chrome/browser/usb/usb_pinned_notification_unittest.cc
index 2529b65..3f4362f7 100644
--- a/chrome/browser/usb/usb_pinned_notification_unittest.cc
+++ b/chrome/browser/usb/usb_pinned_notification_unittest.cc
@@ -81,7 +81,7 @@
// Sort the |origin_items| by origin. This is necessary because the origin
// items for each profile in the pinned notification are created by
// iterating through a structure of flat_map<url::Origin, ...>.
- base::ranges::sort(sorted_origin_items);
+ std::ranges::sort(sorted_origin_items);
#if BUILDFLAG(ENABLE_EXTENSIONS)
std::vector<std::string> extension_names;
for (const auto& [origin, connection_count, name] : sorted_origin_items) {
diff --git a/chrome/browser/vr/elements/ui_element.cc b/chrome/browser/vr/elements/ui_element.cc
index c6c58cdf..9c6bd27 100644
--- a/chrome/browser/vr/elements/ui_element.cc
+++ b/chrome/browser/vr/elements/ui_element.cc
@@ -11,7 +11,6 @@
#include "base/containers/adapters.h"
#include "base/notreached.h"
#include "base/numerics/angle_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
@@ -449,8 +448,8 @@
to_remove->parent_ = nullptr;
size_t old_size = children_.size();
- auto it = base::ranges::find(children_, to_remove,
- &std::unique_ptr<UiElement>::get);
+ auto it =
+ std::ranges::find(children_, to_remove, &std::unique_ptr<UiElement>::get);
DCHECK(it != std::end(children_));
std::unique_ptr<UiElement> removed(it->release());
diff --git a/chrome/browser/vr/webxr_vr_indicators_browser_test.cc b/chrome/browser/vr/webxr_vr_indicators_browser_test.cc
index 0f9aaaee..b9caa94a 100644
--- a/chrome/browser/vr/webxr_vr_indicators_browser_test.cc
+++ b/chrome/browser/vr/webxr_vr_indicators_browser_test.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <vector>
#include "base/containers/to_vector.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/vr/test/multi_class_browser_test.h"
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc
index 83257868..a7c107e8 100644
--- a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc
+++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <algorithm>
#include <iterator>
#include <memory>
#include <ostream>
@@ -36,7 +37,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "base/one_shot_event.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -437,7 +437,7 @@
for (const auto& file_type : files_entry.accept) {
// Skip any file_type that is not a MIME type.
if (file_type.empty() || file_type[0] == '.' ||
- base::ranges::count(file_type, '/') != 1) {
+ std::ranges::count(file_type, '/') != 1) {
continue;
}
@@ -1730,8 +1730,8 @@
for (const auto& [source, external_config] :
web_app.management_to_external_config_map()) {
if (!external_config.additional_policy_ids.empty()) {
- base::ranges::copy(external_config.additional_policy_ids,
- std::back_inserter(policy_ids));
+ std::ranges::copy(external_config.additional_policy_ids,
+ std::back_inserter(policy_ids));
}
}
diff --git a/chrome/browser/web_applications/commands/fetch_install_info_from_install_url_command_unittest.cc b/chrome/browser/web_applications/commands/fetch_install_info_from_install_url_command_unittest.cc
index e48d682..19b943e 100644
--- a/chrome/browser/web_applications/commands/fetch_install_info_from_install_url_command_unittest.cc
+++ b/chrome/browser/web_applications/commands/fetch_install_info_from_install_url_command_unittest.cc
@@ -87,7 +87,7 @@
EXPECT_NE(command_logs, nullptr);
auto command_log_info =
- base::ranges::find_if(*command_logs, [](const base::Value& value) {
+ std::ranges::find_if(*command_logs, [](const base::Value& value) {
const base::Value::Dict* dict = value.GetIfDict();
return dict && dict->FindDict("!metadata") &&
dict->FindDict("!metadata")->FindString("name") &&
diff --git a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_browsertest.cc b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_browsertest.cc
index af8547e..498502e 100644
--- a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_browsertest.cc
+++ b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command_browsertest.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/web_applications/commands/fetch_manifest_and_install_command.h"
+#include <algorithm>
#include <cstdlib>
#include <memory>
#include <utility>
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
diff --git a/chrome/browser/web_applications/externally_managed_app_manager.cc b/chrome/browser/web_applications/externally_managed_app_manager.cc
index 5519b3a6..eae0eae 100644
--- a/chrome/browser/web_applications/externally_managed_app_manager.cc
+++ b/chrome/browser/web_applications/externally_managed_app_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/externally_managed_app_manager.h"
+#include <algorithm>
#include <map>
#include <memory>
#include <ostream>
@@ -15,7 +16,6 @@
#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
#include "base/not_fatal_until.h"
-#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/strings/to_string.h"
#include "base/task/sequenced_task_runner.h"
@@ -182,7 +182,7 @@
ExternalInstallSource install_source,
SynchronizeCallback callback) {
CHECK(callback);
- CHECK(base::ranges::all_of(
+ CHECK(std::ranges::all_of(
desired_apps_install_options,
[&install_source](const ExternalInstallOptions& install_options) {
return install_options.install_source == install_source;
diff --git a/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc b/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc
index 4da08fd..7a054447 100644
--- a/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc
+++ b/chrome/browser/web_applications/externally_managed_app_manager_unittest.cc
@@ -15,7 +15,6 @@
#include "base/containers/flat_set.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
@@ -139,7 +138,7 @@
ExternalInstallSource::kInternalDefault);
std::vector<GURL> urls;
for (const auto& it : apps) {
- base::ranges::copy(it.second, std::back_inserter(urls));
+ std::ranges::copy(it.second, std::back_inserter(urls));
}
std::sort(urls.begin(), urls.end());
@@ -301,7 +300,7 @@
ExternalInstallSource source,
std::optional<ExternalInstallOptions> template_options = std::nullopt) {
std::vector<ExternalInstallOptions> output;
- base::ranges::transform(
+ std::ranges::transform(
install_urls, std::back_inserter(output),
[source, &template_options](const GURL& install_url) {
ExternalInstallOptions options = template_options.value_or(
diff --git a/chrome/browser/web_applications/isolated_web_apps/commands/cleanup_orphaned_isolated_web_apps_command.cc b/chrome/browser/web_applications/isolated_web_apps/commands/cleanup_orphaned_isolated_web_apps_command.cc
index b7bb4c5..876d60e 100644
--- a/chrome/browser/web_applications/isolated_web_apps/commands/cleanup_orphaned_isolated_web_apps_command.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/commands/cleanup_orphaned_isolated_web_apps_command.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/commands/cleanup_orphaned_isolated_web_apps_command.h"
+#include <algorithm>
#include <iterator>
#include <optional>
#include <set>
@@ -15,7 +16,6 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback_helpers.h"
-#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "base/types/expected.h"
#include "chrome/browser/profiles/profile.h"
@@ -79,7 +79,7 @@
}
bool DeleteOrphanedIsolatedWebApps(std::vector<base::FilePath> paths) {
- return base::ranges::all_of(paths, [](const base::FilePath& path) {
+ return std::ranges::all_of(paths, [](const base::FilePath& path) {
return base::DeletePathRecursively(path);
});
}
@@ -210,9 +210,9 @@
RetrieveAllInstalledIsolatedWebAppsPaths(*lock_, *profile_);
std::vector<base::FilePath> directories_to_delete;
- base::ranges::set_difference(isolated_web_apps_directories,
- installed_isolated_web_apps_paths,
- std::back_inserter(directories_to_delete));
+ std::ranges::set_difference(isolated_web_apps_directories,
+ installed_isolated_web_apps_paths,
+ std::back_inserter(directories_to_delete));
number_of_deleted_directories_ = directories_to_delete.size();
base::ThreadPool::PostTaskAndReplyWithResult(
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.cc
index 172b91c..25134a3 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.cc
@@ -195,12 +195,12 @@
bool IsolatedWebAppIntegrityBlockData::HasPublicKey(
base::span<const uint8_t> public_key) const {
- return base::ranges::any_of(signatures(), [&](const auto& signature_info) {
+ return std::ranges::any_of(signatures(), [&](const auto& signature_info) {
return absl::visit(
base::Overloaded{
[&](const auto& signature_info) {
- return base::ranges::equal(signature_info.public_key().bytes(),
- public_key);
+ return std::ranges::equal(signature_info.public_key().bytes(),
+ public_key);
},
[](const web_package::SignedWebBundleSignatureInfoUnknown&) {
return false;
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc
index 1097797c..859ec53 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_reader_registry.h"
+#include <algorithm>
#include <memory>
#include <utility>
@@ -13,7 +14,6 @@
#include "base/functional/callback_helpers.h"
#include "base/functional/overloaded.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc
index 8819be82..b6a25f74 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.cc
@@ -4,12 +4,13 @@
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h"
+#include <algorithm>
+
#include "base/check_is_test.h"
#include "base/feature_list.h"
#include "base/functional/callback.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_features.h"
@@ -103,7 +104,7 @@
NOTREACHED();
}
- return base::ranges::any_of(
+ return std::ranges::any_of(
pref->GetValue()->GetList(),
[&web_bundle_id](const base::Value& force_install_entry) {
auto options =
@@ -116,8 +117,8 @@
void SetTrustedWebBundleIdsForTesting( // IN-TEST
base::flat_set<web_package::SignedWebBundleId> trusted_web_bundle_ids) {
DCHECK(
- base::ranges::none_of(trusted_web_bundle_ids,
- &web_package::SignedWebBundleId::is_for_proxy_mode))
+ std::ranges::none_of(trusted_web_bundle_ids,
+ &web_package::SignedWebBundleId::is_for_proxy_mode))
<< "Cannot trust Web Bundle IDs of type ProxyMode";
GetTrustedWebBundleIdsForTesting() = // IN-TEST
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.cc
index dd868e2..c480ef1 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <type_traits>
@@ -22,7 +23,6 @@
#include "base/memory/raw_ref.h"
#include "base/memory/weak_ptr.h"
#include "base/rand_util.h"
-#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
@@ -907,7 +907,7 @@
bool IsolatedWebAppUpdateManager::TaskQueue::
EnsureQueuedUpdateApplyTaskHasStarted(const webapps::AppId& app_id) {
auto task_it =
- base::ranges::find_if(update_apply_tasks_, [&app_id](const auto& task) {
+ std::ranges::find_if(update_apply_tasks_, [&app_id](const auto& task) {
return task->url_info().app_id() == app_id;
});
if (task_it == update_apply_tasks_.end()) {
@@ -950,7 +950,7 @@
bool IsolatedWebAppUpdateManager::TaskQueue::IsUpdateApplyTaskQueued(
const webapps::AppId& app_id) const {
- return base::ranges::any_of(update_apply_tasks_, [&app_id](const auto& task) {
+ return std::ranges::any_of(update_apply_tasks_, [&app_id](const auto& task) {
return task->url_info().app_id() == app_id;
});
}
@@ -972,10 +972,10 @@
}
bool IsolatedWebAppUpdateManager::TaskQueue::IsAnyTaskRunning() const {
- return base::ranges::any_of(
+ return std::ranges::any_of(
update_discovery_tasks_,
[](const auto& task) { return task->has_started(); }) ||
- base::ranges::any_of(update_apply_tasks_, [](const auto& task) {
+ std::ranges::any_of(update_apply_tasks_, [](const auto& task) {
return task->has_started();
});
}
@@ -983,8 +983,8 @@
void IsolatedWebAppUpdateManager::TaskQueue::OnUpdateDiscoveryTaskCompleted(
IsolatedWebAppUpdateDiscoveryTask* task_ptr,
IsolatedWebAppUpdateDiscoveryTask::CompletionStatus status) {
- auto task_it = base::ranges::find_if(update_discovery_tasks_,
- base::MatchesUniquePtr(task_ptr));
+ auto task_it = std::ranges::find_if(update_discovery_tasks_,
+ base::MatchesUniquePtr(task_ptr));
CHECK(task_it != update_discovery_tasks_.end());
std::unique_ptr<IsolatedWebAppUpdateDiscoveryTask> task = std::move(*task_it);
update_discovery_tasks_.erase(task_it);
@@ -1007,8 +1007,8 @@
void IsolatedWebAppUpdateManager::TaskQueue::OnUpdateApplyTaskCompleted(
IsolatedWebAppUpdateApplyTask* task_ptr,
IsolatedWebAppUpdateApplyTask::CompletionStatus status) {
- auto task_it = base::ranges::find_if(update_apply_tasks_,
- base::MatchesUniquePtr(task_ptr));
+ auto task_it = std::ranges::find_if(update_apply_tasks_,
+ base::MatchesUniquePtr(task_ptr));
CHECK(task_it != update_apply_tasks_.end());
std::unique_ptr<IsolatedWebAppUpdateApplyTask> task = std::move(*task_it);
update_apply_tasks_.erase(task_it);
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager_unittest.cc
index 4dd32e8..b343ac2 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager_unittest.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -19,7 +20,6 @@
#include "base/json/json_writer.h"
#include "base/json/values_util.h"
#include "base/memory/scoped_refptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -887,10 +887,10 @@
update_discovery_log[1].GetDict().Find("end_time"),
update_apply_log[1].GetDict().Find("start_time"),
update_apply_log[1].GetDict().Find("end_time")});
- EXPECT_THAT(base::ranges::is_sorted(times, {},
- [](base::Value* value) {
- return *base::ValueToTime(value);
- }),
+ EXPECT_THAT(std::ranges::is_sorted(times, {},
+ [](base::Value* value) {
+ return *base::ValueToTime(value);
+ }),
IsTrue())
<< base::JoinString(ToVector(times, &base::Value::DebugString), "");
}
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_version.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_version.cc
index 2482ccd8..e3a16df1 100644
--- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_version.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_version.cc
@@ -38,7 +38,7 @@
}
// Check that the component only consists of digits.
- if (!base::ranges::all_of(component_string, &base::IsAsciiDigit<char>)) {
+ if (!std::ranges::all_of(component_string, &base::IsAsciiDigit<char>)) {
return base::unexpected(IwaVersionParseError::kNonDigit);
}
diff --git a/chrome/browser/web_applications/isolated_web_apps/iwa_identity_validator.cc b/chrome/browser/web_applications/isolated_web_apps/iwa_identity_validator.cc
index 064d0042..f722aa9 100644
--- a/chrome/browser/web_applications/isolated_web_apps/iwa_identity_validator.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/iwa_identity_validator.cc
@@ -27,11 +27,11 @@
web_bundle_id.c_str()));
}
- if (!base::ranges::any_of(public_keys, [&](const auto& public_key) {
+ if (!std::ranges::any_of(public_keys, [&](const auto& public_key) {
return absl::visit(
[&](const auto& public_key) {
- return base::ranges::equal(public_key.bytes(),
- *kr_info.public_key);
+ return std::ranges::equal(public_key.bytes(),
+ *kr_info.public_key);
},
public_key);
})) {
diff --git a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.cc b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.cc
index ea3aa218..eb1f186a 100644
--- a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.h"
+#include <algorithm>
#include <functional>
#include <memory>
#include <optional>
@@ -30,7 +31,6 @@
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/to_string.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
@@ -383,7 +383,7 @@
}
const WebApp& installed_app = maybe_installed_app->get();
- static_assert(base::ranges::is_sorted(
+ static_assert(std::ranges::is_sorted(
std::vector{WebAppManagement::Type::kIwaShimlessRma,
// Add further higher priority IWA sources here and make
// sure that the `case` statements below are sorted
@@ -561,7 +561,7 @@
return;
}
- const bool any_task_failed = base::ranges::any_of(
+ const bool any_task_failed = std::ranges::any_of(
install_results, [](const IwaInstaller::Result& result) {
return result.type() != IwaInstallerResultType::kSuccess;
});
diff --git a/chrome/browser/web_applications/isolated_web_apps/test/policy_test_utils.cc b/chrome/browser/web_applications/isolated_web_apps/test/policy_test_utils.cc
index 2f38701..71e94d6e 100644
--- a/chrome/browser/web_applications/isolated_web_apps/test/policy_test_utils.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/test/policy_test_utils.cc
@@ -40,7 +40,7 @@
base::Value::Dict policy_entry) {
ScopedListPrefUpdate update{prefs, prefs::kIsolatedWebAppInstallForceList};
auto itr =
- base::ranges::find(*update, web_bundle_id.id(), [](const auto& entry) {
+ std::ranges::find(*update, web_bundle_id.id(), [](const auto& entry) {
return *entry.GetDict().FindString(kPolicyWebBundleIdKey);
});
CHECK(itr != update->end());
diff --git a/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.cc b/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.cc
index f0fa35a..f7669f8 100644
--- a/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.cc
+++ b/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h"
+#include <algorithm>
#include <optional>
#include <ostream>
#include <string>
@@ -14,7 +15,6 @@
#include "base/containers/flat_map.h"
#include "base/containers/map_util.h"
#include "base/containers/to_vector.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
diff --git a/chrome/browser/web_applications/os_integration/mac/icns_encoder.cc b/chrome/browser/web_applications/os_integration/mac/icns_encoder.cc
index 340bb5c..a34be9a 100644
--- a/chrome/browser/web_applications/os_integration/mac/icns_encoder.cc
+++ b/chrome/browser/web_applications/os_integration/mac/icns_encoder.cc
@@ -10,7 +10,6 @@
#include "base/notreached.h"
#include "base/numerics/byte_conversions.h"
#include "base/numerics/checked_math.h"
-#include "base/ranges/algorithm.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
@@ -95,8 +94,8 @@
bitmap.width() != bitmap.height())
return false;
- const IcnsBlockTypes* block_types = base::ranges::find(
- kIcnsBlockTypes, bitmap.width(), &IcnsBlockTypes::size);
+ const IcnsBlockTypes* block_types =
+ std::ranges::find(kIcnsBlockTypes, bitmap.width(), &IcnsBlockTypes::size);
if (block_types == std::end(kIcnsBlockTypes))
return false;
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager.cc b/chrome/browser/web_applications/policy/web_app_policy_manager.cc
index fcb5402d..848d2a1 100644
--- a/chrome/browser/web_applications/policy/web_app_policy_manager.cc
+++ b/chrome/browser/web_applications/policy/web_app_policy_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
+#include <algorithm>
#include <memory>
#include <optional>
#include <string>
@@ -21,7 +22,6 @@
#include "base/functional/callback_helpers.h"
#include "base/functional/concurrent_closures.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/syslog_logging.h"
#include "base/values.h"
@@ -157,7 +157,7 @@
pref_service_->GetList(prefs::kWebAppInstallForceList);
const auto& web_apps_list = web_apps;
- const auto it = base::ranges::find(
+ const auto it = std::ranges::find(
web_apps_list, url.spec(), [](const base::Value& entry) {
return CHECK_DEREF(entry.GetDict().FindString(kUrlKey));
});
@@ -372,8 +372,8 @@
default_settings_ = WebAppPolicyManager::WebAppSetting();
// Read default policy, if provided.
- const auto it = base::ranges::find(
- web_apps_list, kWildcard, [](const base::Value& entry) {
+ const auto it =
+ std::ranges::find(web_apps_list, kWildcard, [](const base::Value& entry) {
return CHECK_DEREF(entry.GetDict().FindString(kManifestId));
});
diff --git a/chrome/browser/web_applications/policy/web_app_settings_policy_handler.cc b/chrome/browser/web_applications/policy/web_app_settings_policy_handler.cc
index 6f3a6d1..78af67b 100644
--- a/chrome/browser/web_applications/policy/web_app_settings_policy_handler.cc
+++ b/chrome/browser/web_applications/policy/web_app_settings_policy_handler.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/web_applications/policy/web_app_settings_policy_handler.h"
+#include <algorithm>
+
#include "base/check_deref.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/web_applications/policy/web_app_policy_constants.h"
#include "chrome/common/pref_names.h"
#include "components/policy/core/browser/policy_error_map.h"
@@ -41,8 +42,8 @@
const auto& web_apps_list =
policy_entry->value(base::Value::Type::LIST)->GetList();
- const auto it = base::ranges::find(
- web_apps_list, kWildcard, [](const base::Value& entry) {
+ const auto it =
+ std::ranges::find(web_apps_list, kWildcard, [](const base::Value& entry) {
return CHECK_DEREF(entry.GetDict().FindString(kManifestId));
});
diff --git a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc
index b0c920b..9c34d4c3 100644
--- a/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc
+++ b/chrome/browser/web_applications/test/fake_externally_managed_app_manager.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/web_applications/test/fake_externally_managed_app_manager.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "base/task/sequenced_task_runner.h"
namespace web_app {
@@ -44,8 +45,8 @@
return;
}
- base::ranges::copy(install_options_list,
- std::back_inserter(install_requests_));
+ std::ranges::copy(install_options_list,
+ std::back_inserter(install_requests_));
if (!drop_requests_for_testing_) {
ExternallyManagedAppManager::InstallApps(install_options_list, callback);
}
@@ -55,7 +56,7 @@
std::vector<GURL> uninstall_urls,
ExternalInstallSource install_source,
const UninstallCallback& callback) {
- base::ranges::copy(uninstall_urls, std::back_inserter(uninstall_requests_));
+ std::ranges::copy(uninstall_urls, std::back_inserter(uninstall_requests_));
if (handle_uninstall_request_callback_) {
for (auto& app_url : uninstall_urls) {
base::SequencedTaskRunner::GetCurrentDefault()
diff --git a/chrome/browser/web_applications/test/web_app_icon_test_utils.cc b/chrome/browser/web_applications/test/web_app_icon_test_utils.cc
index 77b9202..2bb10bc 100644
--- a/chrome/browser/web_applications/test/web_app_icon_test_utils.cc
+++ b/chrome/browser/web_applications/test/web_app_icon_test_utils.cc
@@ -9,13 +9,13 @@
#include "chrome/browser/web_applications/test/web_app_icon_test_utils.h"
+#include <algorithm>
#include <utility>
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
@@ -136,7 +136,7 @@
bool ContainsOneIconOfEachSize(
const std::map<SquareSizePx, SkBitmap>& icon_bitmaps) {
for (int size_px : kIconSizes) {
- int num_icons_for_size = base::ranges::count(
+ int num_icons_for_size = std::ranges::count(
icon_bitmaps, size_px, &std::pair<const SquareSizePx, SkBitmap>::first);
if (num_icons_for_size != 1)
return false;
diff --git a/chrome/browser/web_applications/test/web_app_test_utils.cc b/chrome/browser/web_applications/test/web_app_test_utils.cc
index f1970b06..d74ed8e 100644
--- a/chrome/browser/web_applications/test/web_app_test_utils.cc
+++ b/chrome/browser/web_applications/test/web_app_test_utils.cc
@@ -32,7 +32,6 @@
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/clamped_math.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
@@ -567,7 +566,7 @@
auto signatures = CreateSignatures();
std::mt19937 rng(random.next_uint());
- base::ranges::shuffle(signatures, rng);
+ std::ranges::shuffle(signatures, rng);
size_t signatures_count = random.next_uint(signatures.size()) + 1;
signatures.erase(signatures.begin() + signatures_count, signatures.end());
@@ -869,12 +868,12 @@
CreateRandomScopeExtensions(random.next_uint(), random));
ScopeExtensions validated_scope_extensions;
- base::ranges::copy_if(app->scope_extensions(),
- std::inserter(validated_scope_extensions,
- validated_scope_extensions.begin()),
- [&random](const ScopeExtensionInfo& extension) {
- return random.next_bool();
- });
+ std::ranges::copy_if(app->scope_extensions(),
+ std::inserter(validated_scope_extensions,
+ validated_scope_extensions.begin()),
+ [&random](const ScopeExtensionInfo& extension) {
+ return random.next_bool();
+ });
app->SetValidatedScopeExtensions(validated_scope_extensions);
if (random.next_bool()) {
diff --git a/chrome/browser/web_applications/web_app_icon_manager.cc b/chrome/browser/web_applications/web_app_icon_manager.cc
index c9ce3ec5..d8373d6 100644
--- a/chrome/browser/web_applications/web_app_icon_manager.cc
+++ b/chrome/browser/web_applications/web_app_icon_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/web_app_icon_manager.h"
+#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
@@ -29,7 +30,6 @@
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -1034,8 +1034,8 @@
if (!web_app)
return false;
- return base::ranges::includes(web_app->downloaded_icon_sizes(purpose),
- icon_sizes);
+ return std::ranges::includes(web_app->downloaded_icon_sizes(purpose),
+ icon_sizes);
}
std::optional<WebAppIconManager::IconSizeAndPurpose>
diff --git a/chrome/browser/web_applications/web_app_install_utils.cc b/chrome/browser/web_applications/web_app_install_utils.cc
index 0567c91..2f18372 100644
--- a/chrome/browser/web_applications/web_app_install_utils.cc
+++ b/chrome/browser/web_applications/web_app_install_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/web_app_install_utils.h"
+#include <algorithm>
#include <array>
#include <iterator>
#include <map>
@@ -31,7 +32,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -174,7 +174,7 @@
// Filter out non-square or too large icons.
auto valid_size_it =
- base::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
+ std::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
return size.width() == size.height() &&
size.width() <= kMaxIconSize;
});
@@ -609,7 +609,7 @@
// Filter out non-square or too large icons.
auto valid_size =
- base::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
+ std::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
return size.width() == size.height() &&
size.width() <= kMaxIconSize;
});
@@ -684,7 +684,7 @@
}
// Filter out non-square or too large icons.
auto valid_size =
- base::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
+ std::ranges::find_if(icon.sizes, [](const gfx::Size& size) {
return size.width() == size.height() &&
size.width() <= kMaxIconSize;
});
diff --git a/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc b/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc
index d21ff2aa..aae8d9f 100644
--- a/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc
+++ b/chrome/browser/web_applications/web_app_link_capturing_parameterized_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <optional>
#include <ostream>
#include <string>
@@ -18,7 +19,6 @@
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/current_thread.h"
#include "base/test/bind.h"
diff --git a/chrome/browser/web_applications/web_app_registrar.cc b/chrome/browser/web_applications/web_app_registrar.cc
index 534d176e..ababe52 100644
--- a/chrome/browser/web_applications/web_app_registrar.cc
+++ b/chrome/browser/web_applications/web_app_registrar.cc
@@ -24,7 +24,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/observer_list.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -1293,7 +1292,7 @@
if (app_score == 0) {
return false;
}
- return base::ranges::none_of(GetAppIds(), [&](const webapps::AppId& app_id) {
+ return std::ranges::none_of(GetAppIds(), [&](const webapps::AppId& app_id) {
int other_score;
if (base::FeatureList::IsEnabled(
features::kPwaNavigationCapturingWithScopeExtensions)) {
@@ -1737,7 +1736,7 @@
for (const web_app::WebApp& web_app : GetAppsIncludingStubs()) {
web_apps.push_back(&web_app);
}
- base::ranges::sort(web_apps, {}, &web_app::WebApp::untranslated_name);
+ std::ranges::sort(web_apps, {}, &web_app::WebApp::untranslated_name);
// Prefix with a ! so this appears at the top when serialized.
base::Value::Dict& index = *root.EnsureDict("!Index");
diff --git a/chrome/browser/web_applications/web_app_utils.cc b/chrome/browser/web_applications/web_app_utils.cc
index f644414..e67f042 100644
--- a/chrome/browser/web_applications/web_app_utils.cc
+++ b/chrome/browser/web_applications/web_app_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/web_applications/web_app_utils.h"
+#include <algorithm>
#include <iterator>
#include <map>
#include <optional>
@@ -21,7 +22,6 @@
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -464,7 +464,7 @@
const std::set<std::string>& extensions) {
std::vector<std::u16string> extensions_for_display;
extensions_for_display.reserve(extensions.size());
- base::ranges::transform(
+ std::ranges::transform(
extensions, std::back_inserter(extensions_for_display),
[](const std::string& extension) {
return base::UTF8ToUTF16(base::ToUpperASCII(extension.substr(1)));
diff --git a/chrome/browser/webauthn/android/cable_module_android_unittest.cc b/chrome/browser/webauthn/android/cable_module_android_unittest.cc
index f6ca1cd..88a00f11 100644
--- a/chrome/browser/webauthn/android/cable_module_android_unittest.cc
+++ b/chrome/browser/webauthn/android/cable_module_android_unittest.cc
@@ -4,7 +4,8 @@
#include "chrome/browser/webauthn/android/cable_module_android.h"
-#include "base/ranges/algorithm.h"
+#include <algorithm>
+
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -77,9 +78,9 @@
EXPECT_EQ(result->tunnel_server_domain, 0);
EXPECT_EQ(result->id, 19508u);
EXPECT_TRUE(
- base::ranges::equal(result->peer_public_key_x962, kExpectedPublicKey));
- EXPECT_TRUE(base::ranges::equal(result->secret, kExpectedSecret));
- EXPECT_TRUE(base::ranges::equal(result->contact_id, kExpectedContactID));
+ std::ranges::equal(result->peer_public_key_x962, kExpectedPublicKey));
+ EXPECT_TRUE(std::ranges::equal(result->secret, kExpectedSecret));
+ EXPECT_TRUE(std::ranges::equal(result->contact_id, kExpectedContactID));
const std::vector<uint8_t> reserialized =
webauthn::authenticator::internal::CBORFromPaaskInfo(*result);
@@ -88,10 +89,10 @@
CHECK(result2);
EXPECT_EQ(result->tunnel_server_domain, result2->tunnel_server_domain);
EXPECT_EQ(result->id, result2->id);
- EXPECT_TRUE(base::ranges::equal(result->peer_public_key_x962,
- result2->peer_public_key_x962));
- EXPECT_TRUE(base::ranges::equal(result->secret, result2->secret));
- EXPECT_TRUE(base::ranges::equal(result->contact_id, result2->contact_id));
+ EXPECT_TRUE(std::ranges::equal(result->peer_public_key_x962,
+ result2->peer_public_key_x962));
+ EXPECT_TRUE(std::ranges::equal(result->secret, result2->secret));
+ EXPECT_TRUE(std::ranges::equal(result->contact_id, result2->contact_id));
}
TEST(CableModuleAndroidTest, Cache) {
diff --git a/chrome/browser/webauthn/android/webauthn_request_delegate_android.cc b/chrome/browser/webauthn/android/webauthn_request_delegate_android.cc
index cb9ddb9ef..2f1d278 100644
--- a/chrome/browser/webauthn/android/webauthn_request_delegate_android.cc
+++ b/chrome/browser/webauthn/android/webauthn_request_delegate_android.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/webauthn/android/webauthn_request_delegate_android.h"
+#include <algorithm>
#include <iterator>
#include <memory>
#include <vector>
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/password_manager/android/grouped_affiliations/acknowledge_grouped_credential_sheet_controller.h"
#include "chrome/browser/password_manager/chrome_webauthn_credentials_delegate.h"
#include "chrome/browser/password_manager/chrome_webauthn_credentials_delegate_factory.h"
@@ -68,7 +68,7 @@
hybrid_callback_ = std::move(hybrid_callback);
std::vector<PasskeyCredential> display_credentials;
- base::ranges::transform(
+ std::ranges::transform(
credentials, std::back_inserter(display_credentials),
[](const auto& credential) {
return PasskeyCredential(
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_controller.cc b/chrome/browser/webauthn/authenticator_request_dialog_controller.cc
index efb0403..1a87d5d 100644
--- a/chrome/browser/webauthn/authenticator_request_dialog_controller.cc
+++ b/chrome/browser/webauthn/authenticator_request_dialog_controller.cc
@@ -29,7 +29,6 @@
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -843,7 +842,7 @@
// API and local credentials, there is no point showing Chrome UI as an
// extra step. Jump to Windows instead.
if (transport_availability_.has_win_native_api_authenticator &&
- base::ranges::all_of(model_->mechanisms, [](const auto& mech) {
+ std::ranges::all_of(model_->mechanisms, [](const auto& mech) {
return absl::holds_alternative<Mechanism::WindowsAPI>(mech.type) ||
(absl::holds_alternative<Mechanism::Credential>(mech.type) &&
absl::get<Mechanism::Credential>(mech.type).value().source ==
@@ -858,11 +857,11 @@
transport_availability_.request_type !=
FidoRequestType::kGetAssertion ||
// If there were any matches, ignore a hint and show the user the list.
- base::ranges::any_of(model_->mechanisms,
- [](const auto& mech) {
- return absl::get_if<Mechanism::Credential>(
- &mech.type);
- }) ||
+ std::ranges::any_of(model_->mechanisms,
+ [](const auto& mech) {
+ return absl::get_if<Mechanism::Credential>(
+ &mech.type);
+ }) ||
!StartGuidedFlowForHint(*hints_.transport)) {
SetCurrentStep(Step::kMechanismSelection);
}
@@ -882,7 +881,7 @@
// The RP has given a hint about the expected transport for a create() call.
// See https://w3c.github.io/webauthn/#enum-hints
- const auto mech_it = base::ranges::find_if(
+ const auto mech_it = std::ranges::find_if(
model_->mechanisms,
[this, mechanism_is_transport, transport, profile](const auto& mech) {
switch (transport) {
@@ -938,7 +937,7 @@
#elif BUILDFLAG(IS_MAC)
// If there are multiple platform authenticators, one of them is the default.
if (!type.has_value()) {
- if (base::ranges::any_of(
+ if (std::ranges::any_of(
authenticators, [](const AuthenticatorReference& ref) {
return ref.type == AuthenticatorType::kOther &&
ref.transport == device::FidoTransportProtocol::kInternal;
@@ -952,7 +951,7 @@
}
#endif
- auto platform_authenticator_it = base::ranges::find_if(
+ auto platform_authenticator_it = std::ranges::find_if(
authenticators, [type](const AuthenticatorReference& ref) -> bool {
if (type && *type == AuthenticatorType::kEnclave) {
return ref.type == *type;
@@ -1275,12 +1274,12 @@
// dialog) then start the request over (once) if the user cancels the Windows
// UI and there are other options in Chrome's UI.
bool enclave_is_option =
- base::ranges::any_of(model_->mechanisms, [](const Mechanism& m) {
+ std::ranges::any_of(model_->mechanisms, [](const Mechanism& m) {
return absl::holds_alternative<Mechanism::Enclave>(m.type);
});
bool phone_is_option =
!WebAuthnApiSupportsHybrid() &&
- base::ranges::any_of(model_->mechanisms, [](const Mechanism& m) -> bool {
+ std::ranges::any_of(model_->mechanisms, [](const Mechanism& m) -> bool {
return absl::holds_alternative<Mechanism::Phone>(m.type) ||
absl::holds_alternative<Mechanism::AddPhone>(m.type);
});
@@ -1405,10 +1404,10 @@
// Run `account_preselected_callback_` to narrow the request to the selected
// credential and dispatch to the platform authenticator.
const auto cred =
- base::ranges::find_if(transport_availability_.recognized_credentials,
- [&credential_id](const auto& cred) {
- return cred.cred_id == credential_id;
- });
+ std::ranges::find_if(transport_availability_.recognized_credentials,
+ [&credential_id](const auto& cred) {
+ return cred.cred_id == credential_id;
+ });
CHECK(cred != transport_availability_.recognized_credentials.end())
<< "OnAccountPreselected() called with unknown credential_id "
<< base::HexEncode(credential_id);
@@ -1545,9 +1544,9 @@
model_->cable_qr_string = cable_qr_string;
model_->paired_phone_names.clear();
- base::ranges::transform(paired_phones_,
- std::back_inserter(model_->paired_phone_names),
- &device::cablev2::Pairing::name);
+ std::ranges::transform(paired_phones_,
+ std::back_inserter(model_->paired_phone_names),
+ &device::cablev2::Pairing::name);
model_->paired_phone_names.erase(
std::unique(model_->paired_phone_names.begin(),
model_->paired_phone_names.end()),
@@ -2033,8 +2032,8 @@
if (last_used_pairing) {
for (size_t i = 0; i < paired_phones_.size(); ++i) {
if (paired_phones_[i]->from_sync_deviceinfo &&
- base::ranges::equal(paired_phones_[i]->peer_public_key_x962,
- *last_used_pairing)) {
+ std::ranges::equal(paired_phones_[i]->peer_public_key_x962,
+ *last_used_pairing)) {
return i;
}
}
@@ -2060,8 +2059,8 @@
return std::tie(a.user.id, a.cred_id) < std::tie(b.user.id, b.cred_id);
}
} id_comparator;
- base::ranges::sort(transport_availability_.recognized_credentials,
- std::ref(id_comparator));
+ std::ranges::sort(transport_availability_.recognized_credentials,
+ std::ref(id_comparator));
struct UsernameComparator {
explicit UsernameComparator(const icu::Locale* locale) {
@@ -2080,8 +2079,8 @@
};
UsernameComparator user_name_comparator(&icu::Locale::getDefault());
- base::ranges::stable_sort(transport_availability_.recognized_credentials,
- std::ref(user_name_comparator));
+ std::ranges::stable_sort(transport_availability_.recognized_credentials,
+ std::ref(user_name_comparator));
}
void AuthenticatorRequestDialogController::PopulateMechanisms() {
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc
index 5e1c059c..5284ca9 100644
--- a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc
+++ b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/authenticator_request_dialog_model.h"
+#include <algorithm>
#include <cstdint>
#include <memory>
#include <optional>
@@ -28,7 +29,6 @@
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/string_util.h"
@@ -2515,7 +2515,7 @@
AuthenticatorTransport::kUsbHumanInterfaceDevice};
controller.StartFlow(std::move(transports_info));
- base::ranges::find_if(
+ std::ranges::find_if(
model->mechanisms,
[click_specific_phone](const auto& m) -> bool {
if (click_specific_phone) {
@@ -2735,7 +2735,7 @@
controller.StartFlow(std::move(transports_info));
auto hybrid_button_it =
- base::ranges::find_if(model->mechanisms, [](const auto& m) {
+ std::ranges::find_if(model->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::AddPhone>(m.type);
});
@@ -3150,7 +3150,7 @@
controller.StartFlow(std::move(transports_info));
auto win_button_it =
- base::ranges::find_if(model->mechanisms, [](const auto& m) {
+ std::ranges::find_if(model->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::WindowsAPI>(m.type);
});
@@ -3217,7 +3217,7 @@
controller.StartFlow(std::move(transports_info));
auto win_button_it =
- base::ranges::find_if(model->mechanisms, [](const auto& m) {
+ std::ranges::find_if(model->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::WindowsAPI>(m.type);
});
diff --git a/chrome/browser/webauthn/cablev2_devices.cc b/chrome/browser/webauthn/cablev2_devices.cc
index 43a6c55d..02636f4 100644
--- a/chrome/browser/webauthn/cablev2_devices.cc
+++ b/chrome/browser/webauthn/cablev2_devices.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/cablev2_devices.h"
+#include <algorithm>
#include <array>
#include <string>
#include <string_view>
@@ -13,7 +14,6 @@
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/i18n/time_formatting.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -50,7 +50,7 @@
return false;
}
- base::ranges::copy(bytes, out->begin());
+ std::ranges::copy(bytes, out->begin());
return true;
}
diff --git a/chrome/browser/webauthn/cablev2_devices_unittest.cc b/chrome/browser/webauthn/cablev2_devices_unittest.cc
index 6ed9157..e332c9b 100644
--- a/chrome/browser/webauthn/cablev2_devices_unittest.cc
+++ b/chrome/browser/webauthn/cablev2_devices_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/webauthn/cablev2_devices.h"
+#include <algorithm>
#include <memory>
#include <vector>
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
@@ -416,9 +416,9 @@
syncer::DeviceInfo TestDeviceInfo(const TestDeviceInfoConfig& config) {
syncer::DeviceInfo::PhoneAsASecurityKeyInfo paask_info;
paask_info.contact_id = std::vector<uint8_t>({1, 2, 3});
- base::ranges::fill(paask_info.peer_public_key_x962, 0);
+ std::ranges::fill(paask_info.peer_public_key_x962, 0);
paask_info.peer_public_key_x962[0] = 1;
- base::ranges::fill(paask_info.secret, 0);
+ std::ranges::fill(paask_info.secret, 0);
paask_info.secret[0] = 2;
paask_info.id = config.id;
paask_info.tunnel_server_domain = config.tunnel_server_domain;
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
index 03962c78..56079b2 100644
--- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
+++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h"
+#include <algorithm>
#include <array>
#include <cstdint>
#include <memory>
@@ -24,7 +25,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/time/default_tick_clock.h"
#include "base/values.h"
@@ -238,7 +238,7 @@
const std::vector<const syncer::DeviceInfo*> devices =
tracker->GetAllDeviceInfo();
- return base::ranges::any_of(devices, [](const auto* device) {
+ return std::ranges::any_of(devices, [](const auto* device) {
switch (device->os_type()) {
case syncer::DeviceInfo::OsType::kIOS:
case syncer::DeviceInfo::OsType::kMac:
@@ -1096,8 +1096,8 @@
device::FidoRequestHandlerBase::TransportAvailabilityInfo* tai) {
if (dialog_model()->relying_party_id == kGoogleRpId &&
tai->has_empty_allow_list &&
- base::ranges::any_of(tai->recognized_credentials,
- IsCredentialFromPlatformAuthenticator)) {
+ std::ranges::any_of(tai->recognized_credentials,
+ IsCredentialFromPlatformAuthenticator)) {
// Regrettably, Chrome will create webauthn credentials for things other
// than authentication (e.g. credit card autofill auth) under the rp id
// "google.com". To differentiate those credentials from actual passkeys you
@@ -1107,8 +1107,8 @@
if (tai->has_platform_authenticator_credential ==
device::FidoRequestHandlerBase::RecognizedCredential::
kHasRecognizedCredential &&
- base::ranges::none_of(tai->recognized_credentials,
- IsCredentialFromPlatformAuthenticator)) {
+ std::ranges::none_of(tai->recognized_credentials,
+ IsCredentialFromPlatformAuthenticator)) {
tai->has_platform_authenticator_credential = device::
FidoRequestHandlerBase::RecognizedCredential::kNoRecognizedCredential;
}
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate.cc b/chrome/browser/webauthn/chrome_web_authentication_delegate.cc
index 712f297a..61881c5 100644
--- a/chrome/browser/webauthn/chrome_web_authentication_delegate.cc
+++ b/chrome/browser/webauthn/chrome_web_authentication_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/chrome_web_authentication_delegate.h"
+#include <algorithm>
#include <cstdint>
#include <memory>
#include <optional>
@@ -22,7 +23,6 @@
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/task/task_traits.h"
@@ -103,7 +103,7 @@
webauthn::switches::kPermitEnterpriseAttestationOriginList);
std::vector<std::string_view> origin_strings = base::SplitStringPiece(
cmdline_origins, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
- return base::ranges::any_of(
+ return std::ranges::any_of(
origin_strings, [&caller_origin](std::string_view origin_string) {
return url::Origin::Create(GURL(origin_string)) == caller_origin;
});
diff --git a/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc b/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc
index 981bd46..13af30c1 100644
--- a/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc
+++ b/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc
@@ -126,9 +126,9 @@
syncer::DeviceInfo CreateDeviceInfo() {
syncer::DeviceInfo::PhoneAsASecurityKeyInfo paask_info;
paask_info.contact_id = std::vector<uint8_t>({1, 2, 3});
- base::ranges::fill(paask_info.peer_public_key_x962, 0);
+ std::ranges::fill(paask_info.peer_public_key_x962, 0);
paask_info.peer_public_key_x962[0] = 1;
- base::ranges::fill(paask_info.secret, 0);
+ std::ranges::fill(paask_info.secret, 0);
paask_info.secret[0] = 2;
paask_info.id = device::cablev2::sync::IDNow();
paask_info.tunnel_server_domain = 0;
diff --git a/chrome/browser/webauthn/enclave_authenticator_browsertest.cc b/chrome/browser/webauthn/enclave_authenticator_browsertest.cc
index c92b273..50a6c8b 100644
--- a/chrome/browser/webauthn/enclave_authenticator_browsertest.cc
+++ b/chrome/browser/webauthn/enclave_authenticator_browsertest.cc
@@ -2286,14 +2286,14 @@
// No credentials should be displayed since tapping on them won't work.
EXPECT_FALSE(
- base::ranges::any_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::any_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Credential>(m.type);
}));
// The button has text indicating the user they need to sign in.
const auto sign_in_again_mech =
- base::ranges::find_if(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::find_if(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::SignInAgain>(m.type);
});
@@ -2337,7 +2337,7 @@
ASSERT_EQ(browser()->tab_strip_model()->GetTabCount(), 1);
// The sign in button is not visible.
const auto sign_in_again_mech =
- base::ranges::find_if(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::find_if(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::SignInAgain>(m.type);
});
@@ -2765,7 +2765,7 @@
delegate_observer()->WaitForUI();
EXPECT_TRUE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -2795,7 +2795,7 @@
delegate_observer()->WaitForUI();
EXPECT_TRUE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -2824,7 +2824,7 @@
delegate_observer()->WaitForUI();
EXPECT_TRUE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -2930,7 +2930,7 @@
/*offsets=*/nullptr));
delegate_observer()->WaitForUI();
EXPECT_TRUE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -2954,7 +2954,7 @@
/*offsets=*/nullptr));
delegate_observer()->WaitForUI();
EXPECT_TRUE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -2984,7 +2984,7 @@
/*offsets=*/nullptr));
delegate_observer()->WaitForUI();
EXPECT_FALSE(
- base::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
+ std::ranges::none_of(dialog_model()->mechanisms, [](const auto& m) {
return absl::holds_alternative<
AuthenticatorRequestDialogModel::Mechanism::Enclave>(m.type);
}));
@@ -3654,7 +3654,7 @@
// ...and select it again from the mechanism list.
model_observer()->SetStepToObserve(
AuthenticatorRequestDialogModel::Step::kTrustThisComputerAssertion);
- EXPECT_TRUE(base::ranges::any_of(
+ EXPECT_TRUE(std::ranges::any_of(
dialog_model()->mechanisms,
[](const auto& m) { return IsMechanismEnclaveCredential(m); }));
for (auto& mechanism : request_delegate_->dialog_model()->mechanisms) {
@@ -3684,7 +3684,7 @@
// Passkeys from GPM should still be present, but they should not be the
// default.
- EXPECT_TRUE(base::ranges::any_of(
+ EXPECT_TRUE(std::ranges::any_of(
dialog_model()->mechanisms,
[](const auto& m) { return IsMechanismEnclaveCredential(m); }));
EXPECT_EQ(dialog_model()->step(),
diff --git a/chrome/browser/webauthn/enclave_manager.cc b/chrome/browser/webauthn/enclave_manager.cc
index e944fd70a..96f6fc29 100644
--- a/chrome/browser/webauthn/enclave_manager.cc
+++ b/chrome/browser/webauthn/enclave_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/enclave_manager.h"
+#include <algorithm>
#include <array>
#include <cstdint>
#include <deque>
@@ -36,7 +37,6 @@
#include "base/notreached.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/stl_util.h"
#include "base/strings/strcat.h"
@@ -239,7 +239,7 @@
template <size_t N>
std::array<uint8_t, N> ToArray(base::span<const uint8_t, N> in) {
std::array<uint8_t, N> ret;
- base::ranges::copy(in, ret.begin());
+ std::ranges::copy(in, ret.begin());
return ret;
}
@@ -991,7 +991,7 @@
// with this norm.
hashed->metadata.n = 16384;
hashed->metadata.is_six_digits =
- pin.size() == 6 && base::ranges::all_of(pin, [](char c) -> bool {
+ pin.size() == 6 && std::ranges::all_of(pin, [](char c) -> bool {
return c >= '0' && c <= '9';
});
CHECK(EVP_PBE_scrypt(pin.data(), pin.size(), hashed->metadata.salt.data(),
diff --git a/chrome/browser/webauthn/fake_magic_arch.cc b/chrome/browser/webauthn/fake_magic_arch.cc
index 285c22e1..9b9f61c 100644
--- a/chrome/browser/webauthn/fake_magic_arch.cc
+++ b/chrome/browser/webauthn/fake_magic_arch.cc
@@ -4,9 +4,10 @@
#include "chrome/browser/webauthn/fake_magic_arch.h"
+#include <algorithm>
+
#include "base/check.h"
#include "base/containers/span.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/webauthn/fake_recovery_key_store.h"
#include "chrome/browser/webauthn/fake_security_domain_service.h"
#include "components/trusted_vault/proto/recovery_key_store.pb.h"
@@ -93,7 +94,7 @@
CHECK_LE(security_domain_service.num_pin_members(), 1u);
// Find the security domain member.
- const auto member_it = base::ranges::find_if(
+ const auto member_it = std::ranges::find_if(
security_domain_service.members(), [](const auto& member) -> bool {
return member.member_type() ==
trusted_vault_pb::SecurityDomainMember::
@@ -105,7 +106,7 @@
const std::string_view public_key = member_it->public_key();
// Find the corresponding vault.
- const auto vault_it = base::ranges::find_if(
+ const auto vault_it = std::ranges::find_if(
recovery_key_store.vaults(), [&public_key](const auto& vault) -> bool {
return GetKeyPairWithPublicKey(vault, public_key) != nullptr;
});
diff --git a/chrome/browser/webauthn/fake_recovery_key_store.cc b/chrome/browser/webauthn/fake_recovery_key_store.cc
index 10a1f8f..9282dda4 100644
--- a/chrome/browser/webauthn/fake_recovery_key_store.cc
+++ b/chrome/browser/webauthn/fake_recovery_key_store.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/webauthn/fake_recovery_key_store.h"
+#include <algorithm>
+
#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -420,7 +421,7 @@
CHECK(request.ParseFromArray(body.data(), body.size()));
CHECK(!request.vault_parameters().vault_handle().empty());
CHECK_EQ(request.vault_parameters().vault_handle()[0], 3 /* GPM PIN */);
- auto existing = base::ranges::find_if(
+ auto existing = std::ranges::find_if(
vaults_, [&request](const auto& candidate) -> bool {
const auto& candidate_params = candidate.vault_parameters();
const auto& request_params = request.vault_parameters();
diff --git a/chrome/browser/webauthn/fake_security_domain_service.cc b/chrome/browser/webauthn/fake_security_domain_service.cc
index 100bd31..701a04ef 100644
--- a/chrome/browser/webauthn/fake_security_domain_service.cc
+++ b/chrome/browser/webauthn/fake_security_domain_service.cc
@@ -4,11 +4,12 @@
#include "chrome/browser/webauthn/fake_security_domain_service.h"
+#include <algorithm>
+
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "components/trusted_vault/proto/vault.pb.h"
#include "services/network/public/cpp/data_element.h"
@@ -66,7 +67,7 @@
size_t num_physical_members() const override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return base::ranges::count_if(members_, [](const auto& member) -> bool {
+ return std::ranges::count_if(members_, [](const auto& member) -> bool {
return member.member_type() == trusted_vault_pb::SecurityDomainMember::
MEMBER_TYPE_PHYSICAL_DEVICE;
});
@@ -75,7 +76,7 @@
size_t num_pin_members() const override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return base::ranges::count_if(members_, [](const auto& member) -> bool {
+ return std::ranges::count_if(members_, [](const auto& member) -> bool {
return member.member_type() ==
trusted_vault_pb::SecurityDomainMember::
MEMBER_TYPE_GOOGLE_PASSWORD_MANAGER_PIN;
@@ -156,7 +157,7 @@
.empty());
const auto existing_pin =
- base::ranges::find_if(members_, [](const auto& member) -> bool {
+ std::ranges::find_if(members_, [](const auto& member) -> bool {
return member.member_type() ==
trusted_vault_pb::SecurityDomainMember::
MEMBER_TYPE_GOOGLE_PASSWORD_MANAGER_PIN;
diff --git a/chrome/browser/webauthn/gpm_enclave_controller.cc b/chrome/browser/webauthn/gpm_enclave_controller.cc
index 5c6b3c2..4f74df5 100644
--- a/chrome/browser/webauthn/gpm_enclave_controller.cc
+++ b/chrome/browser/webauthn/gpm_enclave_controller.cc
@@ -29,7 +29,6 @@
#include "base/no_destructor.h"
#include "base/notimplemented.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -637,9 +636,9 @@
if (!device::kWebAuthnGpmPin.Get() &&
result.state == Result::State::kRecoverable &&
!result.lskf_expiries.empty() &&
- base::ranges::all_of(result.lskf_expiries, ExpiryTooSoon)) {
+ std::ranges::all_of(result.lskf_expiries, ExpiryTooSoon)) {
std::vector<std::string> expiries;
- base::ranges::transform(
+ std::ranges::transform(
result.lskf_expiries, std::back_inserter(expiries),
[](const auto& time) { return base::TimeFormatAsIso8601(time); });
FIDO_LOG(EVENT) << "Account considered irrecoverable because no LSKF has "
diff --git a/chrome/browser/webauthn/gpm_enclave_transaction.cc b/chrome/browser/webauthn/gpm_enclave_transaction.cc
index dfa2e0fd..ff1ce43b 100644
--- a/chrome/browser/webauthn/gpm_enclave_transaction.cc
+++ b/chrome/browser/webauthn/gpm_enclave_transaction.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/webauthn/gpm_enclave_transaction.h"
+#include <algorithm>
#include <tuple>
#include "base/check.h"
@@ -11,7 +12,6 @@
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/notreached.h"
-#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "build/buildflag.h"
@@ -195,7 +195,7 @@
base::BindOnce(&GPMEnclaveTransaction::OnPasskeyCreated,
weak_ptr_factory_.GetWeakPtr());
std::vector<std::vector<uint8_t>> existing_credential_ids;
- base::ranges::transform(
+ std::ranges::transform(
passkey_model_->GetPasskeysForRelyingPartyId(rp_id_),
std::back_inserter(existing_credential_ids),
[](const sync_pb::WebauthnCredentialSpecifics& cred) {
@@ -212,8 +212,8 @@
std::vector<sync_pb::WebauthnCredentialSpecifics> credentials =
passkey_model_->GetPasskeysForRelyingPartyId(rp_id_);
for (auto& cred : credentials) {
- if (base::ranges::equal(base::as_byte_span(cred.credential_id()),
- base::span(*selected_credential_id_))) {
+ if (std::ranges::equal(base::as_byte_span(cred.credential_id()),
+ base::span(*selected_credential_id_))) {
selected_credential =
std::make_unique<sync_pb::WebauthnCredentialSpecifics>(
std::move(cred));
diff --git a/chrome/browser/webauthn/local_credential_management_win.cc b/chrome/browser/webauthn/local_credential_management_win.cc
index fd94370..4ba13899 100644
--- a/chrome/browser/webauthn/local_credential_management_win.cc
+++ b/chrome/browser/webauthn/local_credential_management_win.cc
@@ -20,7 +20,7 @@
bool ContainsUserCreatedCredential(
const std::vector<device::DiscoverableCredentialMetadata>& credentials) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
credentials, [](const device::DiscoverableCredentialMetadata& cred) {
return !cred.system_created;
});
diff --git a/chrome/browser/webauthn/observable_authenticator_list.cc b/chrome/browser/webauthn/observable_authenticator_list.cc
index d9f12c1..e6f53d98 100644
--- a/chrome/browser/webauthn/observable_authenticator_list.cc
+++ b/chrome/browser/webauthn/observable_authenticator_list.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/webauthn/observable_authenticator_list.h"
+#include <algorithm>
#include <string_view>
#include <utility>
#include "base/check.h"
-#include "base/ranges/algorithm.h"
#include "chrome/browser/webauthn/authenticator_list_observer.h"
ObservableAuthenticatorList::ObservableAuthenticatorList() = default;
@@ -71,6 +71,6 @@
ObservableAuthenticatorList::AuthenticatorListIterator
ObservableAuthenticatorList::GetAuthenticatorIterator(
std::string_view authenticator_id) {
- return base::ranges::find(authenticator_list_, authenticator_id,
- &AuthenticatorReference::authenticator_id);
+ return std::ranges::find(authenticator_list_, authenticator_id,
+ &AuthenticatorReference::authenticator_id);
}
diff --git a/chrome/browser/webid/federated_identity_account_keyed_permission_context.cc b/chrome/browser/webid/federated_identity_account_keyed_permission_context.cc
index b35a0a2e..8e47a3d 100644
--- a/chrome/browser/webid/federated_identity_account_keyed_permission_context.cc
+++ b/chrome/browser/webid/federated_identity_account_keyed_permission_context.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/webid/federated_identity_account_keyed_permission_context.h"
+#include <algorithm>
#include <optional>
#include "base/functional/callback_helpers.h"
#include "base/json/values_util.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/default_clock.h"
@@ -115,7 +115,7 @@
bool FederatedIdentityAccountKeyedPermissionContext::HasPermission(
const net::SchemefulSite& relying_party_embedder,
const net::SchemefulSite& identity_provider) {
- return base::ranges::any_of(
+ return std::ranges::any_of(
GetAllGrantedObjects(),
[&](const std::unique_ptr<
permissions::ObjectPermissionContextBase::Object>& object) -> bool {
@@ -322,7 +322,7 @@
const url::Origin& relying_party,
base::OnceClosure callback) {
net::SchemefulSite relying_party_site(relying_party);
- if (base::ranges::none_of(
+ if (std::ranges::none_of(
storage_access_eligible_connections_, [&](const auto& pair) -> bool {
return net::SchemefulSite(pair.first) == relying_party_site;
})) {
diff --git a/chrome/browser/win/browser_util.cc b/chrome/browser/win/browser_util.cc
index 4a9ee456..612e2d1 100644
--- a/chrome/browser/win/browser_util.cc
+++ b/chrome/browser/win/browser_util.cc
@@ -7,9 +7,11 @@
#include <windows.h>
// sddl.h must come after windows.h.
-#include <sddl.h>
#include <winternl.h>
+#include <sddl.h>
+
+#include <algorithm>
#include <climits>
#include <memory>
#include <optional>
@@ -19,7 +21,6 @@
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
-#include "base/ranges/algorithm.h"
#include "base/win/scoped_handle.h"
#include "base/win/scoped_localalloc.h"
@@ -78,7 +79,7 @@
return false;
}
std::replace(nt_dir_name->begin(), nt_dir_name->end(), '\\', '!');
- base::ranges::transform(*nt_dir_name, nt_dir_name->begin(), tolower);
+ std::ranges::transform(*nt_dir_name, nt_dir_name->begin(), tolower);
nt_dir_name = L"Global\\" + nt_dir_name.value();
if (handle != NULL)
::CloseHandle(handle);
diff --git a/chrome/browser/win/conflicts/inspection_results_cache.cc b/chrome/browser/win/conflicts/inspection_results_cache.cc
index 057a34b..ed045c56 100644
--- a/chrome/browser/win/conflicts/inspection_results_cache.cc
+++ b/chrome/browser/win/conflicts/inspection_results_cache.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/win/conflicts/inspection_results_cache.h"
+#include <algorithm>
#include <string>
#include <string_view>
#include <utility>
@@ -14,7 +15,6 @@
#include "base/files/important_file_writer.h"
#include "base/hash/md5.h"
#include "base/pickle.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
namespace {
@@ -170,8 +170,9 @@
base::MD5Digest md5_digest;
base::span<const uint8_t> payload = pickle.payload_bytes();
base::MD5Sum(payload.first(payload.size() - sizeof(md5_digest)), &md5_digest);
- if (!base::ranges::equal(read_md5_digest->a, md5_digest.a))
+ if (!std::ranges::equal(read_md5_digest->a, md5_digest.a)) {
return ReadCacheResult::kFailInvalidMD5;
+ }
return ReadCacheResult::kSuccess;
}
diff --git a/chrome/browser/win/conflicts/installed_applications_unittest.cc b/chrome/browser/win/conflicts/installed_applications_unittest.cc
index eb487a9e..36aff48d 100644
--- a/chrome/browser/win/conflicts/installed_applications_unittest.cc
+++ b/chrome/browser/win/conflicts/installed_applications_unittest.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/win/conflicts/installed_applications.h"
+#include <algorithm>
#include <map>
#include "base/memory/raw_ref.h"
-#include "base/ranges/algorithm.h"
#include "base/test/test_reg_util_win.h"
#include "base/win/registry.h"
#include "chrome/browser/win/conflicts/msi_util.h"
@@ -396,7 +396,7 @@
auto applications = installed_applications().applications_;
std::sort(std::begin(applications), std::end(applications));
EXPECT_EQ(std::end(applications),
- base::ranges::adjacent_find(
+ std::ranges::adjacent_find(
applications, std::equal_to<>(), [](const auto& app) {
return std::tie(app.name, app.registry_root,
app.registry_key_path,
diff --git a/chrome/browser/win/conflicts/module_blocklist_cache_util.cc b/chrome/browser/win/conflicts/module_blocklist_cache_util.cc
index 503736b..e7c32ed 100644
--- a/chrome/browser/win/conflicts/module_blocklist_cache_util.cc
+++ b/chrome/browser/win/conflicts/module_blocklist_cache_util.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/win/conflicts/module_blocklist_cache_util.h"
+#include <algorithm>
#include <functional>
#include <iterator>
#include <string>
@@ -20,7 +21,6 @@
#include "base/files/file_util.h"
#include "base/files/important_file_writer.h"
#include "base/hash/md5.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/win/conflicts/module_list_filter.h"
#include "chrome/chrome_elf/third_party_dlls/packed_list_format.h"
@@ -46,7 +46,7 @@
// Returns true if the 2 digests are equal.
bool IsMD5DigestEqual(const base::MD5Digest& lhs, const base::MD5Digest& rhs) {
- return base::ranges::equal(lhs.a, rhs.a);
+ return std::ranges::equal(lhs.a, rhs.a);
}
// Returns MD5 hash of the cache data.
diff --git a/chrome/browser/win/conflicts/module_blocklist_cache_util_unittest.cc b/chrome/browser/win/conflicts/module_blocklist_cache_util_unittest.cc
index cfad4c8..951def2 100644
--- a/chrome/browser/win/conflicts/module_blocklist_cache_util_unittest.cc
+++ b/chrome/browser/win/conflicts/module_blocklist_cache_util_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/win/conflicts/module_blocklist_cache_util.h"
+#include <algorithm>
#include <memory>
#include <random>
#include <set>
@@ -16,7 +17,6 @@
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/hash/md5.h"
-#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/win/conflicts/module_list_filter.h"
#include "chrome/chrome_elf/sha1/sha1.h"
@@ -53,7 +53,7 @@
// Sort the entries and make sure each module is unique.
std::sort(entries.begin(), entries.end(), internal::ModuleLess());
- CHECK(base::ranges::adjacent_find(entries, internal::ModuleEqual()) ==
+ CHECK(std::ranges::adjacent_find(entries, internal::ModuleEqual()) ==
entries.end());
return entries;
@@ -244,7 +244,7 @@
EXPECT_EQ(kTestModuleCount - kAllowlistedModulesCount,
blocklisted_modules.size());
for (const auto& module : allowlisted_modules) {
- EXPECT_TRUE(base::ranges::none_of(
+ EXPECT_TRUE(std::ranges::none_of(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element);
}));
@@ -278,7 +278,7 @@
EXPECT_EQ(kTestModuleCount, blocklisted_modules.size());
// For each entires, make sure they were updated.
for (const auto& module : updated_modules) {
- auto iter = base::ranges::find_if(
+ auto iter = std::ranges::find_if(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element);
});
@@ -323,7 +323,7 @@
// The 5 elements were removed.
EXPECT_EQ(kTestModuleCount - kModulesToRemove, blocklisted_modules.size());
for (const auto& module : expired_modules) {
- EXPECT_TRUE(base::ranges::none_of(
+ EXPECT_TRUE(std::ranges::none_of(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element);
}));
@@ -362,7 +362,7 @@
EXPECT_EQ(kTestModuleCount - kNewlyBlocklistedModuleCount,
blocklisted_modules.size());
for (const auto& module : excess_modules) {
- EXPECT_TRUE(base::ranges::none_of(
+ EXPECT_TRUE(std::ranges::none_of(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element);
}));
@@ -402,7 +402,7 @@
// Enough elements were removed.
EXPECT_EQ(kMaxModuleBlocklistCacheSize, blocklisted_modules.size());
for (const auto& module : excess_modules) {
- EXPECT_TRUE(base::ranges::none_of(
+ EXPECT_TRUE(std::ranges::none_of(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element);
}));
@@ -444,7 +444,7 @@
EXPECT_EQ(kTestModuleCount, blocklisted_modules.size());
for (const auto& module : duplicated_modules) {
- EXPECT_TRUE(base::ranges::any_of(
+ EXPECT_TRUE(std::ranges::any_of(
blocklisted_modules, [&module](const auto& element) {
return internal::ModuleEqual()(module, element) &&
module.time_date_stamp == element.time_date_stamp;
diff --git a/chrome/browser/win/remove_app_compat_entries.cc b/chrome/browser/win/remove_app_compat_entries.cc
index 574b1760..9ac9e078 100644
--- a/chrome/browser/win/remove_app_compat_entries.cc
+++ b/chrome/browser/win/remove_app_compat_entries.cc
@@ -4,12 +4,12 @@
#include "chrome/browser/win/remove_app_compat_entries.h"
+#include <algorithm>
#include <string_view>
#include <vector>
#include "base/containers/fixed_flat_set.h"
#include "base/files/file_path.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/win/registry.h"
diff --git a/chrome/browser/win/ui_automation_util.cc b/chrome/browser/win/ui_automation_util.cc
index f168b99d..937e548 100644
--- a/chrome/browser/win/ui_automation_util.cc
+++ b/chrome/browser/win/ui_automation_util.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/win/ui_automation_util.h"
+#include <algorithm>
#include <iterator>
#include "base/logging.h"
-#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/win/scoped_safearray.h"
@@ -107,7 +107,7 @@
std::string IntArrayToString(const std::vector<int32_t>& values) {
#if DCHECK_IS_ON()
std::vector<std::string> value_strings;
- base::ranges::transform(
+ std::ranges::transform(
values, std::back_inserter(value_strings),
[](int32_t value) { return base::NumberToString(value); });
return base::JoinString(value_strings, ", ");