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 d2039485c345d60a6be018aa7485c5f268dc69de..b0240da91c4fa069926c3eaf01a467acfb5f16d3 100644 |
--- a/chrome/browser/extensions/api/system_info/system_info_api.cc |
+++ b/chrome/browser/extensions/api/system_info/system_info_api.cc |
@@ -14,13 +14,13 @@ |
#include "base/strings/string_util.h" |
#include "base/values.h" |
#include "chrome/browser/browser_process.h" |
-#include "chrome/browser/extensions/api/system_info_storage/storage_info_provider.h" |
+#include "chrome/browser/extensions/api/system_storage/storage_info_provider.h" |
#include "chrome/browser/extensions/event_names.h" |
#include "chrome/browser/extensions/event_router_forwarder.h" |
#include "chrome/browser/storage_monitor/removable_storage_observer.h" |
#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_storage.h" |
#include "ui/gfx/display_observer.h" |
#if defined(USE_ASH) |
@@ -30,9 +30,9 @@ |
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_storage::StorageFreeSpaceChangeInfo; |
+using api::system_storage::StorageUnitInfo; |
+using api::system_storage::StorageUnitType; |
using content::BrowserThread; |
namespace { |
@@ -85,8 +85,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. |
@@ -217,29 +216,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); |
not at google - send to devlin
2013/07/18 17:06:18
it looks like this patch is more than just a renam
Haojian Wu
2013/07/19 08:47:12
Actually this patch also update the storage APIs d
not at google - send to devlin
2013/07/22 15:55:57
Yes that is my point. The CL description says it's
|
} |
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()); |