| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 if (!base::ReadFileToString(manifest_path, &manifest_data)) | 394 if (!base::ReadFileToString(manifest_path, &manifest_data)) |
| 395 return false; | 395 return false; |
| 396 std::unique_ptr<base::Value> manifest_value( | 396 std::unique_ptr<base::Value> manifest_value( |
| 397 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS)); | 397 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS)); |
| 398 if (!manifest_value.get()) | 398 if (!manifest_value.get()) |
| 399 return false; | 399 return false; |
| 400 base::DictionaryValue* manifest = NULL; | 400 base::DictionaryValue* manifest = NULL; |
| 401 if (!manifest_value->GetAsDictionary(&manifest)) | 401 if (!manifest_value->GetAsDictionary(&manifest)) |
| 402 return false; | 402 return false; |
| 403 | 403 |
| 404 Version version; | 404 base::Version version; |
| 405 if (!chrome::CheckPepperFlashManifest(*manifest, &version)) | 405 if (!chrome::CheckPepperFlashManifest(*manifest, &version)) |
| 406 return false; | 406 return false; |
| 407 | 407 |
| 408 *plugin = CreatePepperFlashInfo(flash_filename, | 408 *plugin = CreatePepperFlashInfo(flash_filename, |
| 409 version.GetString(), | 409 version.GetString(), |
| 410 chrome::IsSystemFlashScriptDebuggerPresent(), | 410 chrome::IsSystemFlashScriptDebuggerPresent(), |
| 411 true, | 411 true, |
| 412 false); | 412 false); |
| 413 return true; | 413 return true; |
| 414 } | 414 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (auto* plugin : plugins) { | 505 for (auto* plugin : plugins) { |
| 506 Version version(plugin->version); | 506 base::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) |
| 516 | 516 |
| (...skipping 201 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 |