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

Unified Diff: ui/base/layout.cc

Issue 699283002: c++11: Allow lambdas, with some restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month 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 | « styleguide/c++/c++11.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index 0c3802b751b554527f0053af5f6f453b5ea797dc..01c5b00dc72253623016e89742d1384985195365 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -28,10 +28,6 @@ namespace ui {
namespace {
-bool ScaleFactorComparator(const ScaleFactor& lhs, const ScaleFactor& rhs){
- return GetScaleForScaleFactor(lhs) < GetScaleForScaleFactor(rhs);
-}
-
std::vector<ScaleFactor>* g_supported_scale_factors = NULL;
const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f,
@@ -49,7 +45,9 @@ void SetSupportedScaleFactors(
g_supported_scale_factors = new std::vector<ScaleFactor>(scale_factors);
std::sort(g_supported_scale_factors->begin(),
g_supported_scale_factors->end(),
- ScaleFactorComparator);
+ [](ScaleFactor lhs, ScaleFactor rhs) {
+ return GetScaleForScaleFactor(lhs) < GetScaleForScaleFactor(rhs);
+ });
// Set ImageSkia's supported scales.
std::vector<float> scales;
« no previous file with comments | « styleguide/c++/c++11.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698