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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 2947593005: Use ContainsValue() instead of std::find() in chrome/browser/ui/ (Closed)
Patch Set: 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
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
index 3b642be62082bcb5e89d808fe79df0af80deb443..e466f71f899c36be98d3c9c2a503ae1e28d0f63a 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h"
+#include "base/stl_util.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/cocoa/l10n_util.h"
@@ -18,9 +19,9 @@
#import "extensions/common/feature_switch.h"
#import "third_party/mozilla/NSPasteboard+Utils.h"
#import "ui/base/cocoa/appkit_utils.h"
-#import "ui/base/cocoa/tracking_area.h"
#import "ui/base/cocoa/nsview_additions.h"
#include "ui/base/cocoa/scoped_cg_context_smooth_fonts.h"
+#import "ui/base/cocoa/tracking_area.h"
#include "ui/base/material_design/material_design_controller.h"
using extensions::FeatureSwitch;
@@ -271,9 +272,7 @@ size_t CalculatePositionsInFrame(
std::vector<LocationBarDecoration*>& left_decorations =
cocoa_l10n_util::ShouldDoExperimentalRTLLayout() ? trailingDecorations_
: leadingDecorations_;
- *isLeftDecoration =
- std::find(left_decorations.begin(), left_decorations.end(), decoration) !=
- left_decorations.end();
+ *isLeftDecoration = base::ContainsValue(left_decorations, decoration);
return decoration->GetBackgroundFrame(decorationFrame);
}

Powered by Google App Engine
This is Rietveld 408576698