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

Unified Diff: ios/chrome/browser/passwords/password_generation_agent.mm

Issue 2945803002: Use ContainsValue() instead of std::find() in ios/ (Closed)
Patch Set: Fixed compilation error. 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 | « ios/chrome/browser/bookmarks/bookmarks_utils.cc ('k') | ios/chrome/browser/payments/payment_request.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/passwords/password_generation_agent.mm
diff --git a/ios/chrome/browser/passwords/password_generation_agent.mm b/ios/chrome/browser/passwords/password_generation_agent.mm
index 67671677d07eeb5e1f7dfb59827b3b2c9ee849c7..bd82af31335b07f4a13b5ff4ce28bbdffca2f1cd 100644
--- a/ios/chrome/browser/passwords/password_generation_agent.mm
+++ b/ios/chrome/browser/passwords/password_generation_agent.mm
@@ -8,6 +8,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_block.h"
+#include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/password_generator.h"
@@ -42,11 +43,6 @@ const int kGeneratedPasswordLength = 20;
// an account creation form.
const size_t kMinimumTextFieldsForAccountCreation = 3;
-// Returns true if |urls| contains |url|.
-bool VectorContainsURL(const std::vector<GURL>& urls, const GURL& url) {
- return std::find(urls.begin(), urls.end(), url) != urls.end();
-}
-
// Returns whether |field| should be considered a text field. Implementation
// mirrors that of password_controller.js.
// TODO(crbug.com/433856): Figure out how to determine if |field| is visible.
@@ -292,7 +288,7 @@ passwordManagerDriver:(password_manager::PasswordManagerDriver*)driver
// password manager, wait.
GURL origin = _possibleAccountCreationForm->origin;
if (!experimental_flags::UseOnlyLocalHeuristicsForPasswordGeneration()) {
- if (!VectorContainsURL(_allowedGenerationFormOrigins, origin))
+ if (!base::ContainsValue(_allowedGenerationFormOrigins, origin))
return;
}
« no previous file with comments | « ios/chrome/browser/bookmarks/bookmarks_utils.cc ('k') | ios/chrome/browser/payments/payment_request.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698