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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 1575523002: Comparison and streaming operators for base::Version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/crash_logging.h" 10 #include "base/debug/crash_logging.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 #if defined(ENABLE_PLUGINS) 463 #if defined(ENABLE_PLUGINS)
464 // static 464 // static
465 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( 465 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin(
466 const std::vector<content::PepperPluginInfo*>& plugins) { 466 const std::vector<content::PepperPluginInfo*>& plugins) {
467 auto it = std::max_element( 467 auto it = std::max_element(
468 plugins.begin(), plugins.end(), 468 plugins.begin(), plugins.end(),
469 [](content::PepperPluginInfo* x, content::PepperPluginInfo* y) { 469 [](content::PepperPluginInfo* x, content::PepperPluginInfo* y) {
470 Version version_x(x->version); 470 Version version_x(x->version);
471 Version version_y(y->version); 471 Version version_y(y->version);
472 DCHECK(version_x.IsValid() && version_y.IsValid()); 472 DCHECK(version_x.IsValid() && version_y.IsValid());
473 if (version_x.Equals(version_y)) 473 if (version_x == version_y) {
brettw 2016/01/08 19:31:16 There's no need to add {} here: generally we would
Rob Percival 2016/01/09 23:54:03 Done. I'm in the habit of putting braces in since
474 return !x->is_debug && y->is_debug; 474 return !x->is_debug && y->is_debug;
475 }
475 return version_x.IsOlderThan(y->version); 476 return version_x.IsOlderThan(y->version);
brettw 2016/01/08 19:31:16 Can you update this to: return version_x < versi
Rob Percival 2016/01/09 23:54:03 Done.
476 }); 477 });
477 return it != plugins.end() ? *it : nullptr; 478 return it != plugins.end() ? *it : nullptr;
478 } 479 }
479 #endif // defined(ENABLE_PLUGINS) 480 #endif // defined(ENABLE_PLUGINS)
480 481
481 void ChromeContentClient::AddPepperPlugins( 482 void ChromeContentClient::AddPepperPlugins(
482 std::vector<content::PepperPluginInfo>* plugins) { 483 std::vector<content::PepperPluginInfo>* plugins) {
483 #if defined(ENABLE_PLUGINS) 484 #if defined(ENABLE_PLUGINS)
484 ComputeBuiltInPlugins(plugins); 485 ComputeBuiltInPlugins(plugins);
485 AddPepperFlashFromCommandLine(plugins); 486 AddPepperFlashFromCommandLine(plugins);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 #endif 631 #endif
631 } 632 }
632 633
633 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() { 634 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() {
634 #if defined(ENABLE_EXTENSIONS) 635 #if defined(ENABLE_EXTENSIONS)
635 return extensions::IsIsolateExtensionsEnabled(); 636 return extensions::IsIsolateExtensionsEnabled();
636 #else 637 #else
637 return false; 638 return false;
638 #endif 639 #endif
639 } 640 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698