Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/component_updater/pepper_flash_component_installer.h" | 5 #include "chrome/browser/component_updater/pepper_flash_component_installer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 #include "components/component_updater/default_component_installer.h" | 37 #include "components/component_updater/default_component_installer.h" |
| 38 #include "components/update_client/update_client.h" | 38 #include "components/update_client/update_client.h" |
| 39 #include "components/update_client/update_client_errors.h" | 39 #include "components/update_client/update_client_errors.h" |
| 40 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 41 #include "content/public/browser/plugin_service.h" | 41 #include "content/public/browser/plugin_service.h" |
| 42 #include "content/public/common/content_constants.h" | 42 #include "content/public/common/content_constants.h" |
| 43 #include "content/public/common/pepper_plugin_info.h" | 43 #include "content/public/common/pepper_plugin_info.h" |
| 44 #include "ppapi/shared_impl/ppapi_permissions.h" | 44 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 45 | 45 |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 47 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | |
| 47 #include "chromeos/dbus/dbus_method_call_status.h" | 48 #include "chromeos/dbus/dbus_method_call_status.h" |
| 48 #include "chromeos/dbus/dbus_thread_manager.h" | 49 #include "chromeos/dbus/dbus_thread_manager.h" |
| 49 #include "chromeos/dbus/image_loader_client.h" | 50 #include "chromeos/dbus/image_loader_client.h" |
| 50 #include "content/public/browser/browser_thread.h" | 51 #include "content/public/browser/browser_thread.h" |
| 51 #elif defined(OS_LINUX) | 52 #elif defined(OS_LINUX) |
| 52 #include "chrome/common/component_flash_hint_file_linux.h" | 53 #include "chrome/common/component_flash_hint_file_linux.h" |
| 53 #endif // defined(OS_CHROMEOS) | 54 #endif // defined(OS_CHROMEOS) |
| 54 | 55 |
| 55 using content::BrowserThread; | 56 using content::BrowserThread; |
| 56 using content::PluginService; | 57 using content::PluginService; |
| 57 | 58 |
| 58 namespace component_updater { | 59 namespace component_updater { |
| 59 | 60 |
| 60 namespace { | 61 namespace { |
| 61 | 62 |
| 62 #if defined(GOOGLE_CHROME_BUILD) | 63 #if defined(GOOGLE_CHROME_BUILD) |
| 63 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. | 64 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. |
| 64 const uint8_t kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, | 65 const uint8_t kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, |
| 65 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, | 66 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, |
| 66 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, | 67 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, |
| 67 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; | 68 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; |
| 68 | 69 |
| 69 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
| 70 void LogRegistrationResult(chromeos::DBusMethodCallStatus call_status, | 71 void LogRegistrationResult(chromeos::DBusMethodCallStatus call_status, |
| 71 bool result) { | 72 bool result) { |
|
waffles
2016/11/17 00:39:56
Maybe it's time to add a DCHECK_CURRENTLY_ON(conte
Greg K
2016/11/30 19:30:29
Done.
| |
| 72 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { | 73 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { |
| 73 LOG(ERROR) << "Call to imageloader service failed."; | 74 LOG(ERROR) << "Call to imageloader service failed."; |
| 74 return; | 75 return; |
| 75 } | 76 } |
| 76 if (!result) | 77 if (!result) { |
| 77 LOG(ERROR) << "Component flash registration failed"; | 78 LOG(ERROR) << "Component flash registration failed"; |
| 79 return; | |
| 80 } | |
| 81 chromeos::SystemTrayDelegateChromeOS* tray = | |
| 82 chromeos::SystemTrayDelegateChromeOS::Get(); | |
| 83 if (tray) { | |
| 84 tray->SetFlashUpdateAvailable(); | |
|
waffles
2016/11/17 00:39:56
As an FYI, the updater uses a lot of CONTINUE_ON_S
Greg K
2016/11/30 19:30:29
Acknowledged.
| |
| 85 } | |
| 78 } | 86 } |
| 79 | 87 |
| 80 void ImageLoaderRegistration(const std::string& version, | 88 void ImageLoaderRegistration(const std::string& version, |
| 81 const base::FilePath& install_dir) { | 89 const base::FilePath& install_dir) { |
| 82 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 90 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 83 chromeos::ImageLoaderClient* loader = | 91 chromeos::ImageLoaderClient* loader = |
| 84 chromeos::DBusThreadManager::Get()->GetImageLoaderClient(); | 92 chromeos::DBusThreadManager::Get()->GetImageLoaderClient(); |
| 85 | 93 |
| 86 if (loader) { | 94 if (loader) { |
| 87 loader->RegisterComponent("PepperFlashPlayer", version, install_dir.value(), | 95 loader->RegisterComponent("PepperFlashPlayer", version, install_dir.value(), |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 std::unique_ptr<ComponentInstallerTraits> traits( | 317 std::unique_ptr<ComponentInstallerTraits> traits( |
| 310 new FlashComponentInstallerTraits); | 318 new FlashComponentInstallerTraits); |
| 311 // |cus| will take ownership of |installer| during installer->Register(cus). | 319 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 312 DefaultComponentInstaller* installer = | 320 DefaultComponentInstaller* installer = |
| 313 new DefaultComponentInstaller(std::move(traits)); | 321 new DefaultComponentInstaller(std::move(traits)); |
| 314 installer->Register(cus, base::Closure()); | 322 installer->Register(cus, base::Closure()); |
| 315 #endif // defined(GOOGLE_CHROME_BUILD) | 323 #endif // defined(GOOGLE_CHROME_BUILD) |
| 316 } | 324 } |
| 317 | 325 |
| 318 } // namespace component_updater | 326 } // namespace component_updater |
| OLD | NEW |