| OLD | NEW |
| 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 Loading... |
| 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) |
| 474 return !x->is_debug && y->is_debug; | 474 return !x->is_debug && y->is_debug; |
| 475 return version_x.IsOlderThan(y->version); | 475 return version_x < version_y; |
| 476 }); | 476 }); |
| 477 return it != plugins.end() ? *it : nullptr; | 477 return it != plugins.end() ? *it : nullptr; |
| 478 } | 478 } |
| 479 #endif // defined(ENABLE_PLUGINS) | 479 #endif // defined(ENABLE_PLUGINS) |
| 480 | 480 |
| 481 void ChromeContentClient::AddPepperPlugins( | 481 void ChromeContentClient::AddPepperPlugins( |
| 482 std::vector<content::PepperPluginInfo>* plugins) { | 482 std::vector<content::PepperPluginInfo>* plugins) { |
| 483 #if defined(ENABLE_PLUGINS) | 483 #if defined(ENABLE_PLUGINS) |
| 484 ComputeBuiltInPlugins(plugins); | 484 ComputeBuiltInPlugins(plugins); |
| 485 AddPepperFlashFromCommandLine(plugins); | 485 AddPepperFlashFromCommandLine(plugins); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 #endif | 630 #endif |
| 631 } | 631 } |
| 632 | 632 |
| 633 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() { | 633 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() { |
| 634 #if defined(ENABLE_EXTENSIONS) | 634 #if defined(ENABLE_EXTENSIONS) |
| 635 return extensions::IsIsolateExtensionsEnabled(); | 635 return extensions::IsIsolateExtensionsEnabled(); |
| 636 #else | 636 #else |
| 637 return false; | 637 return false; |
| 638 #endif | 638 #endif |
| 639 } | 639 } |
| OLD | NEW |