| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/component_updater/default_component_installer.h" | 5 #include "components/component_updater/default_component_installer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 if (installer_traits_->CanAutoUpdate()) { | 328 if (installer_traits_->CanAutoUpdate()) { |
| 329 CrxComponent crx; | 329 CrxComponent crx; |
| 330 installer_traits_->GetHash(&crx.pk_hash); | 330 installer_traits_->GetHash(&crx.pk_hash); |
| 331 crx.installer = this; | 331 crx.installer = this; |
| 332 crx.version = current_version_; | 332 crx.version = current_version_; |
| 333 crx.fingerprint = current_fingerprint_; | 333 crx.fingerprint = current_fingerprint_; |
| 334 crx.name = installer_traits_->GetName(); | 334 crx.name = installer_traits_->GetName(); |
| 335 crx.installer_attributes = installer_traits_->GetInstallerAttributes(); | 335 crx.installer_attributes = installer_traits_->GetInstallerAttributes(); |
| 336 crx.requires_network_encryption = | 336 crx.requires_network_encryption = |
| 337 installer_traits_->RequiresNetworkEncryption(); | 337 installer_traits_->RequiresNetworkEncryption(); |
| 338 crx.handled_mime_types = installer_traits_->GetMimeTypes(); |
| 338 if (!cus->RegisterComponent(crx)) { | 339 if (!cus->RegisterComponent(crx)) { |
| 339 LOG(ERROR) << "Component registration failed for " | 340 LOG(ERROR) << "Component registration failed for " |
| 340 << installer_traits_->GetName(); | 341 << installer_traits_->GetName(); |
| 341 return; | 342 return; |
| 342 } | 343 } |
| 343 | 344 |
| 344 if (!callback.is_null()) | 345 if (!callback.is_null()) |
| 345 callback.Run(); | 346 callback.Run(); |
| 346 } | 347 } |
| 347 | 348 |
| 348 if (!current_manifest_) { | 349 if (!current_manifest_) { |
| 349 DVLOG(1) << "No component found for " << installer_traits_->GetName(); | 350 DVLOG(1) << "No component found for " << installer_traits_->GetName(); |
| 350 return; | 351 return; |
| 351 } | 352 } |
| 352 | 353 |
| 353 std::unique_ptr<base::DictionaryValue> manifest_copy( | 354 std::unique_ptr<base::DictionaryValue> manifest_copy( |
| 354 current_manifest_->DeepCopy()); | 355 current_manifest_->DeepCopy()); |
| 355 ComponentReady(std::move(manifest_copy)); | 356 ComponentReady(std::move(manifest_copy)); |
| 356 } | 357 } |
| 357 | 358 |
| 358 void DefaultComponentInstaller::ComponentReady( | 359 void DefaultComponentInstaller::ComponentReady( |
| 359 std::unique_ptr<base::DictionaryValue> manifest) { | 360 std::unique_ptr<base::DictionaryValue> manifest) { |
| 360 VLOG(1) << "Component ready, version " << current_version_.GetString() | 361 VLOG(1) << "Component ready, version " << current_version_.GetString() |
| 361 << " in " << current_install_dir_.value(); | 362 << " in " << current_install_dir_.value(); |
| 362 installer_traits_->ComponentReady(current_version_, current_install_dir_, | 363 installer_traits_->ComponentReady(current_version_, current_install_dir_, |
| 363 std::move(manifest)); | 364 std::move(manifest)); |
| 364 } | 365 } |
| 365 | 366 |
| 366 } // namespace component_updater | 367 } // namespace component_updater |
| OLD | NEW |