| 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> |
| 10 |
| 9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 10 #include "base/debug/crash_logging.h" | 12 #include "base/debug/crash_logging.h" |
| 11 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 12 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
| 13 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
| 14 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 15 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 16 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 19 #include "base/strings/string_split.h" |
| 18 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 #include "content/public/common/content_constants.h" | 36 #include "content/public/common/content_constants.h" |
| 35 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 36 #include "content/public/common/url_constants.h" | 38 #include "content/public/common/url_constants.h" |
| 37 #include "content/public/common/user_agent.h" | 39 #include "content/public/common/user_agent.h" |
| 38 #include "extensions/common/constants.h" | 40 #include "extensions/common/constants.h" |
| 39 #include "gpu/config/gpu_info.h" | 41 #include "gpu/config/gpu_info.h" |
| 40 #include "net/http/http_util.h" | 42 #include "net/http/http_util.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
| 42 #include "ui/base/layout.h" | 44 #include "ui/base/layout.h" |
| 43 #include "ui/base/resource/resource_bundle.h" | 45 #include "ui/base/resource/resource_bundle.h" |
| 44 | |
| 45 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 46 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 46 | 47 |
| 47 #if defined(OS_LINUX) | 48 #if defined(OS_LINUX) |
| 48 #include <fcntl.h> | 49 #include <fcntl.h> |
| 49 #include "chrome/common/component_flash_hint_file_linux.h" | 50 #include "chrome/common/component_flash_hint_file_linux.h" |
| 50 #endif // defined(OS_LINUX) | 51 #endif // defined(OS_LINUX) |
| 51 | 52 |
| 52 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 53 #include "base/win/registry.h" | 54 #include "base/win/registry.h" |
| 54 #include "base/win/windows_version.h" | 55 #include "base/win/windows_version.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 364 |
| 364 if (!base::PathExists(flash_filename)) | 365 if (!base::PathExists(flash_filename)) |
| 365 return false; | 366 return false; |
| 366 | 367 |
| 367 base::FilePath manifest_path( | 368 base::FilePath manifest_path( |
| 368 flash_filename.DirName().AppendASCII("manifest.json")); | 369 flash_filename.DirName().AppendASCII("manifest.json")); |
| 369 | 370 |
| 370 std::string manifest_data; | 371 std::string manifest_data; |
| 371 if (!base::ReadFileToString(manifest_path, &manifest_data)) | 372 if (!base::ReadFileToString(manifest_path, &manifest_data)) |
| 372 return false; | 373 return false; |
| 373 scoped_ptr<base::Value> manifest_value( | 374 std::unique_ptr<base::Value> manifest_value( |
| 374 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS)); | 375 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS)); |
| 375 if (!manifest_value.get()) | 376 if (!manifest_value.get()) |
| 376 return false; | 377 return false; |
| 377 base::DictionaryValue* manifest = NULL; | 378 base::DictionaryValue* manifest = NULL; |
| 378 if (!manifest_value->GetAsDictionary(&manifest)) | 379 if (!manifest_value->GetAsDictionary(&manifest)) |
| 379 return false; | 380 return false; |
| 380 | 381 |
| 381 Version version; | 382 Version version; |
| 382 if (!chrome::CheckPepperFlashManifest(*manifest, &version)) | 383 if (!chrome::CheckPepperFlashManifest(*manifest, &version)) |
| 383 return false; | 384 return false; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 // flash plugin. The flash player, if any, preloaded before the sandbox | 490 // flash plugin. The flash player, if any, preloaded before the sandbox |
| 490 // initialization will continue to be used. | 491 // initialization will continue to be used. |
| 491 if (!IsUserDataDirAvailable()) { | 492 if (!IsUserDataDirAvailable()) { |
| 492 return; | 493 return; |
| 493 } | 494 } |
| 494 #endif // defined(OS_LINUX) | 495 #endif // defined(OS_LINUX) |
| 495 | 496 |
| 496 ScopedVector<content::PepperPluginInfo> flash_versions; | 497 ScopedVector<content::PepperPluginInfo> flash_versions; |
| 497 | 498 |
| 498 #if defined(OS_LINUX) | 499 #if defined(OS_LINUX) |
| 499 scoped_ptr<content::PepperPluginInfo> component_flash( | 500 std::unique_ptr<content::PepperPluginInfo> component_flash( |
| 500 new content::PepperPluginInfo); | 501 new content::PepperPluginInfo); |
| 501 if (GetComponentUpdatedPepperFlash(component_flash.get())) | 502 if (GetComponentUpdatedPepperFlash(component_flash.get())) |
| 502 flash_versions.push_back(component_flash.release()); | 503 flash_versions.push_back(component_flash.release()); |
| 503 #endif // defined(OS_LINUX) | 504 #endif // defined(OS_LINUX) |
| 504 | 505 |
| 505 scoped_ptr<content::PepperPluginInfo> bundled_flash( | 506 std::unique_ptr<content::PepperPluginInfo> bundled_flash( |
| 506 new content::PepperPluginInfo); | 507 new content::PepperPluginInfo); |
| 507 if (GetBundledPepperFlash(bundled_flash.get())) | 508 if (GetBundledPepperFlash(bundled_flash.get())) |
| 508 flash_versions.push_back(bundled_flash.release()); | 509 flash_versions.push_back(bundled_flash.release()); |
| 509 | 510 |
| 510 scoped_ptr<content::PepperPluginInfo> system_flash( | 511 std::unique_ptr<content::PepperPluginInfo> system_flash( |
| 511 new content::PepperPluginInfo); | 512 new content::PepperPluginInfo); |
| 512 if (GetSystemPepperFlash(system_flash.get())) | 513 if (GetSystemPepperFlash(system_flash.get())) |
| 513 flash_versions.push_back(system_flash.release()); | 514 flash_versions.push_back(system_flash.release()); |
| 514 | 515 |
| 515 // This function will return only the most recent version of the flash plugin. | 516 // This function will return only the most recent version of the flash plugin. |
| 516 content::PepperPluginInfo* max_flash = | 517 content::PepperPluginInfo* max_flash = |
| 517 FindMostRecentPlugin(flash_versions.get()); | 518 FindMostRecentPlugin(flash_versions.get()); |
| 518 if (max_flash) | 519 if (max_flash) |
| 519 plugins->push_back(*max_flash); | 520 plugins->push_back(*max_flash); |
| 520 #endif // defined(ENABLE_PLUGINS) | 521 #endif // defined(ENABLE_PLUGINS) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 #if defined(ENABLE_EXTENSIONS) | 640 #if defined(ENABLE_EXTENSIONS) |
| 640 return extensions::IsIsolateExtensionsEnabled(); | 641 return extensions::IsIsolateExtensionsEnabled(); |
| 641 #else | 642 #else |
| 642 return false; | 643 return false; |
| 643 #endif | 644 #endif |
| 644 } | 645 } |
| 645 | 646 |
| 646 base::StringPiece ChromeContentClient::GetOriginTrialPublicKey() { | 647 base::StringPiece ChromeContentClient::GetOriginTrialPublicKey() { |
| 647 return origin_trial_key_manager_.GetPublicKey(); | 648 return origin_trial_key_manager_.GetPublicKey(); |
| 648 } | 649 } |
| OLD | NEW |