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

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry.cc

Issue 2958223002: Use ContainsValue() instead of std::find() in chrome/browser and chrome/common (Closed)
Patch Set: Rebase patch. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.cc ('k') | chrome/browser/internal_auth.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/custom_handlers/protocol_handler_registry.cc
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc
index e081dcc910adfcd2a82812ad16787dde14a01890..820a794c40f2e846daa04c55a350cbf7a0400671 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
+#include "base/stl_util.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile_io_data.h"
@@ -476,8 +477,7 @@ bool ProtocolHandlerRegistry::IsRegistered(
if (!handlers) {
return false;
}
- return std::find(handlers->begin(), handlers->end(), handler) !=
- handlers->end();
+ return base::ContainsValue(*handlers, handler);
}
bool ProtocolHandlerRegistry::IsRegisteredByUser(
@@ -863,7 +863,7 @@ bool ProtocolHandlerRegistry::HandlerExists(const ProtocolHandler& handler,
bool ProtocolHandlerRegistry::HandlerExists(const ProtocolHandler& handler,
const ProtocolHandlerList& list) {
- return std::find(list.begin(), list.end(), handler) != list.end();
+ return base::ContainsValue(list, handler);
}
void ProtocolHandlerRegistry::EraseHandler(const ProtocolHandler& handler,
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.cc ('k') | chrome/browser/internal_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698