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 <memory> | 9 #include <memory> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // static | 495 // static |
496 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( | 496 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( |
497 const std::vector<content::PepperPluginInfo*>& plugins) { | 497 const std::vector<content::PepperPluginInfo*>& plugins) { |
498 if (plugins.empty()) | 498 if (plugins.empty()) |
499 return nullptr; | 499 return nullptr; |
500 | 500 |
501 using PluginSortKey = std::tuple<base::Version, bool, bool, bool, bool>; | 501 using PluginSortKey = std::tuple<base::Version, bool, bool, bool, bool>; |
502 | 502 |
503 std::map<PluginSortKey, content::PepperPluginInfo*> plugin_map; | 503 std::map<PluginSortKey, content::PepperPluginInfo*> plugin_map; |
504 | 504 |
505 for (const auto& plugin : plugins) { | 505 for (auto* plugin : plugins) { |
506 Version version(plugin->version); | 506 Version version(plugin->version); |
507 DCHECK(version.IsValid()); | 507 DCHECK(version.IsValid()); |
508 plugin_map[PluginSortKey(version, plugin->is_debug, | 508 plugin_map[PluginSortKey(version, plugin->is_debug, |
509 plugin->is_bundled, plugin->is_on_local_drive, | 509 plugin->is_bundled, plugin->is_on_local_drive, |
510 !plugin->is_external)] = plugin; | 510 !plugin->is_external)] = plugin; |
511 } | 511 } |
512 | 512 |
513 return plugin_map.rbegin()->second; | 513 return plugin_map.rbegin()->second; |
514 } | 514 } |
515 #endif // defined(ENABLE_PLUGINS) | 515 #endif // defined(ENABLE_PLUGINS) |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); | 718 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); |
719 } | 719 } |
720 return origin_trial_policy_.get(); | 720 return origin_trial_policy_.get(); |
721 } | 721 } |
722 | 722 |
723 #if defined(OS_ANDROID) | 723 #if defined(OS_ANDROID) |
724 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 724 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
725 return new ChromeMediaClientAndroid(); | 725 return new ChromeMediaClientAndroid(); |
726 } | 726 } |
727 #endif // OS_ANDROID | 727 #endif // OS_ANDROID |
OLD | NEW |