| 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 "chrome/browser/sync/test/integration/sync_extension_installer.h" | 5 #include "chrome/browser/sync/test/integration/sync_extension_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, type); | 33 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, type); |
| 34 | 34 |
| 35 // The extension system is trying to check for updates. In the real world, | 35 // The extension system is trying to check for updates. In the real world, |
| 36 // this would be where synced extensions are asynchronously downloaded from | 36 // this would be where synced extensions are asynchronously downloaded from |
| 37 // the web store and installed. In this test framework, we use this event as | 37 // the web store and installed. In this test framework, we use this event as |
| 38 // a signal that it's time to asynchronously fake the installation of these | 38 // a signal that it's time to asynchronously fake the installation of these |
| 39 // extensions. | 39 // extensions. |
| 40 | 40 |
| 41 base::ThreadTaskRunnerHandle::Get()->PostTask( | 41 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 42 FROM_HERE, | 42 FROM_HERE, |
| 43 base::Bind(&SyncedExtensionInstaller::DoInstallSyncedExtensions, | 43 base::BindOnce(&SyncedExtensionInstaller::DoInstallSyncedExtensions, |
| 44 weak_ptr_factory_.GetWeakPtr())); | 44 weak_ptr_factory_.GetWeakPtr())); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void SyncedExtensionInstaller::DoInstallSyncedExtensions() { | 47 void SyncedExtensionInstaller::DoInstallSyncedExtensions() { |
| 48 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile_); | 48 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile_); |
| 49 } | 49 } |
| OLD | NEW |