| Index: chrome/browser/extensions/api/system_info/system_info_api.cc
|
| diff --git a/chrome/browser/extensions/api/system_info/system_info_api.cc b/chrome/browser/extensions/api/system_info/system_info_api.cc
|
| index 465bc77347478b7255d4e9bdbd2a6b0b1e2bd600..af1ffd2ea7a034145f464a0f0194f597192e958c 100644
|
| --- a/chrome/browser/extensions/api/system_info/system_info_api.cc
|
| +++ b/chrome/browser/extensions/api/system_info/system_info_api.cc
|
| @@ -21,6 +21,7 @@
|
| #include "chrome/browser/storage_monitor/storage_info.h"
|
| #include "chrome/browser/storage_monitor/storage_monitor.h"
|
| #include "chrome/common/extensions/api/experimental_system_info_storage.h"
|
| +#include "chrome/common/extensions/api/system_info_storage.h"
|
| #include "ui/gfx/display_observer.h"
|
|
|
| #if defined(USE_ASH)
|
| @@ -31,8 +32,8 @@
|
| namespace extensions {
|
|
|
| using api::experimental_system_info_storage::StorageFreeSpaceChangeInfo;
|
| -using api::experimental_system_info_storage::StorageUnitInfo;
|
| -using api::experimental_system_info_storage::StorageUnitType;
|
| +using api::system_info_storage::StorageUnitInfo;
|
| +using api::system_info_storage::StorageUnitType;
|
| using content::BrowserThread;
|
|
|
| namespace {
|
| @@ -85,8 +86,7 @@ class SystemInfoEventRouter : public gfx::DisplayObserver,
|
| virtual void OnRemovableStorageDetached(
|
| const chrome::StorageInfo& info) OVERRIDE;
|
|
|
| - void DispatchStorageAttachedEvent(const chrome::StorageInfo& info,
|
| - int64 avail_bytes);
|
| + void DispatchStorageAttachedEvent(const chrome::StorageInfo& info);
|
|
|
| // Called from any thread to dispatch the systemInfo event to all extension
|
| // processes cross multiple profiles.
|
| @@ -223,29 +223,14 @@ void SystemInfoEventRouter::OnFreeSpaceChanged(
|
|
|
| void SystemInfoEventRouter::OnRemovableStorageAttached(
|
| const chrome::StorageInfo& info) {
|
| - base::PostTaskAndReplyWithResult(
|
| - BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
|
| - base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN),
|
| - FROM_HERE,
|
| - base::Bind(&StorageInfoProvider::GetStorageFreeSpaceFromTransientId,
|
| - StorageInfoProvider::Get(),
|
| - StorageInfoProvider::Get()->GetTransientIdForDeviceId(
|
| - info.device_id())),
|
| - base::Bind(&SystemInfoEventRouter::DispatchStorageAttachedEvent,
|
| - // Since SystemInfoEventRouter is a global lazy instance, this
|
| - // pointer will be alive when the reply comes back.
|
| - base::Unretained(this),
|
| - info));
|
| + DispatchStorageAttachedEvent(info);
|
| }
|
|
|
| void SystemInfoEventRouter::DispatchStorageAttachedEvent(
|
| - const chrome::StorageInfo& info, int64 avail_bytes) {
|
| + const chrome::StorageInfo& info) {
|
| StorageUnitInfo unit;
|
| systeminfo::BuildStorageUnitInfo(info, &unit);
|
|
|
| - unit.available_capacity =
|
| - avail_bytes > 0 ? static_cast<double>(avail_bytes) : 0;
|
| -
|
| scoped_ptr<base::ListValue> args(new base::ListValue);
|
| args->Append(unit.ToValue().release());
|
| DispatchEvent(event_names::kOnStorageAttached, args.Pass());
|
|
|