Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: chrome/browser/extensions/api/system_storage/system_storage_api.cc

Issue 18578008: [SystemInfo API] Move Storage API out of experimental namespace and rename to the "system" namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PermissionTest unittest. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/system_storage/system_storage_api.cc
diff --git a/chrome/browser/extensions/api/system_info_storage/system_info_storage_api.cc b/chrome/browser/extensions/api/system_storage/system_storage_api.cc
similarity index 39%
rename from chrome/browser/extensions/api/system_info_storage/system_info_storage_api.cc
rename to chrome/browser/extensions/api/system_storage/system_storage_api.cc
index 8249eaa8b566533a638bcd9eb3e856b09f2a7329..4f36caaa41b6df71460b810290ecedc68c368260 100644
--- a/chrome/browser/extensions/api/system_info_storage/system_info_storage_api.cc
+++ b/chrome/browser/extensions/api/system_storage/system_storage_api.cc
@@ -1,31 +1,31 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/api/system_info_storage/system_info_storage_api.h"
+
+#include "chrome/browser/extensions/api/system_storage/system_storage_api.h"
namespace extensions {
-using api::experimental_system_info_storage::StorageUnitInfo;
-namespace EjectDevice = api::experimental_system_info_storage::EjectDevice;
+using api::system_storage::StorageUnitInfo;
+namespace EjectDevice = api::system_storage::EjectDevice;
-SystemInfoStorageGetFunction::SystemInfoStorageGetFunction() {
+SystemStorageGetInfoFunction::SystemStorageGetInfoFunction() {
}
-SystemInfoStorageGetFunction::~SystemInfoStorageGetFunction() {
+SystemStorageGetInfoFunction::~SystemStorageGetInfoFunction() {
}
-bool SystemInfoStorageGetFunction::RunImpl() {
+bool SystemStorageGetInfoFunction::RunImpl() {
StorageInfoProvider::Get()->StartQueryInfo(
- base::Bind(&SystemInfoStorageGetFunction::OnGetStorageInfoCompleted,
+ base::Bind(&SystemStorageGetInfoFunction::OnGetStorageInfoCompleted,
this));
return true;
}
-void SystemInfoStorageGetFunction::OnGetStorageInfoCompleted(bool success) {
+void SystemStorageGetInfoFunction::OnGetStorageInfoCompleted(bool success) {
if (success) {
- results_ =
- api::experimental_system_info_storage::Get::Results::Create(
- StorageInfoProvider::Get()->storage_unit_info_list());
+ results_ = api::system_storage::GetInfo::Results::Create(
+ StorageInfoProvider::Get()->storage_unit_info_list());
} else {
SetError("Error occurred when querying storage information.");
}
@@ -33,23 +33,23 @@ void SystemInfoStorageGetFunction::OnGetStorageInfoCompleted(bool success) {
SendResponse(success);
}
-SystemInfoStorageEjectDeviceFunction::~SystemInfoStorageEjectDeviceFunction() {
+SystemStorageEjectDeviceFunction::~SystemStorageEjectDeviceFunction() {
}
-bool SystemInfoStorageEjectDeviceFunction::RunImpl() {
+bool SystemStorageEjectDeviceFunction::RunImpl() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
scoped_ptr<EjectDevice::Params> params(EjectDevice::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind(
- &SystemInfoStorageEjectDeviceFunction::OnStorageMonitorInit,
+ &SystemStorageEjectDeviceFunction::OnStorageMonitorInit,
this,
params->id));
return true;
}
-void SystemInfoStorageEjectDeviceFunction::OnStorageMonitorInit(
+void SystemStorageEjectDeviceFunction::OnStorageMonitorInit(
const std::string& transient_device_id) {
DCHECK(chrome::StorageMonitor::GetInstance()->IsInitialized());
chrome::StorageMonitor* monitor = chrome::StorageMonitor::GetInstance();
@@ -64,80 +64,83 @@ void SystemInfoStorageEjectDeviceFunction::OnStorageMonitorInit(
monitor->EjectDevice(
device_id_str,
- base::Bind(&SystemInfoStorageEjectDeviceFunction::HandleResponse,
+ base::Bind(&SystemStorageEjectDeviceFunction::HandleResponse,
this));
}
-void SystemInfoStorageEjectDeviceFunction::HandleResponse(
+void SystemStorageEjectDeviceFunction::HandleResponse(
chrome::StorageMonitor::EjectStatus status) {
- api::experimental_system_info_storage:: EjectDeviceResultCode result =
- api::experimental_system_info_storage::EJECT_DEVICE_RESULT_CODE_FAILURE;
+ api::system_storage:: EjectDeviceResultCode result =
+ api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE;
switch (status) {
case chrome::StorageMonitor::EJECT_OK:
- result = api::experimental_system_info_storage::
- EJECT_DEVICE_RESULT_CODE_SUCCESS;
+ result = api::system_storage::EJECT_DEVICE_RESULT_CODE_SUCCESS;
break;
case chrome::StorageMonitor::EJECT_IN_USE:
- result = api::experimental_system_info_storage::
- EJECT_DEVICE_RESULT_CODE_IN_USE;
+ result = api::system_storage::EJECT_DEVICE_RESULT_CODE_IN_USE;
break;
case chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE:
- result = api::experimental_system_info_storage::
+ result = api::system_storage::
EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE;
break;
case chrome::StorageMonitor::EJECT_FAILURE:
- result = api::experimental_system_info_storage::
- EJECT_DEVICE_RESULT_CODE_FAILURE;
+ result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE;
}
SetResult(base::StringValue::CreateStringValue(
- api::experimental_system_info_storage::ToString(result)));
+ api::system_storage::ToString(result)));
SendResponse(true);
}
-SystemInfoStorageAddWatchFunction::SystemInfoStorageAddWatchFunction() {
+SystemStorageAddAvailableCapacityWatchFunction::
+ SystemStorageAddAvailableCapacityWatchFunction() {
}
-SystemInfoStorageAddWatchFunction::~SystemInfoStorageAddWatchFunction() {
+SystemStorageAddAvailableCapacityWatchFunction::
+ ~SystemStorageAddAvailableCapacityWatchFunction() {
}
-bool SystemInfoStorageAddWatchFunction::RunImpl() {
- // TODO(Haojian): Implement the addWatch api.
+bool SystemStorageAddAvailableCapacityWatchFunction::RunImpl() {
+ // TODO(Haojian): Implement the addAvailableCapacityWatch API.
return false;
}
-SystemInfoStorageRemoveWatchFunction::SystemInfoStorageRemoveWatchFunction() {
+SystemStorageRemoveAvailableCapacityWatchFunction::
+ SystemStorageRemoveAvailableCapacityWatchFunction() {
}
-SystemInfoStorageRemoveWatchFunction::~SystemInfoStorageRemoveWatchFunction() {
+SystemStorageRemoveAvailableCapacityWatchFunction::
+ ~SystemStorageRemoveAvailableCapacityWatchFunction() {
}
-bool SystemInfoStorageRemoveWatchFunction::RunImpl() {
- // TODO(Haojian): Implement the removeWatch api.
+bool SystemStorageRemoveAvailableCapacityWatchFunction::RunImpl() {
+ // TODO(Haojian): Implement the removeAvailableCapacityWatch API.
return false;
}
-SystemInfoStorageGetAllWatchFunction::SystemInfoStorageGetAllWatchFunction() {
+SystemStorageGetAllAvailableCapacityWatchesFunction
+ ::SystemStorageGetAllAvailableCapacityWatchesFunction() {
}
-SystemInfoStorageGetAllWatchFunction::~SystemInfoStorageGetAllWatchFunction() {
+SystemStorageGetAllAvailableCapacityWatchesFunction
+ ::~SystemStorageGetAllAvailableCapacityWatchesFunction() {
}
-bool SystemInfoStorageGetAllWatchFunction::RunImpl() {
- // TODO(Haojian): Implement the getAllWatch api.
+bool SystemStorageGetAllAvailableCapacityWatchesFunction::RunImpl() {
+ // TODO(Haojian): Implement the getAllAvailableCapacityWatches API.
return false;
}
-SystemInfoStorageRemoveAllWatchFunction::
-SystemInfoStorageRemoveAllWatchFunction() {
+SystemStorageRemoveAllAvailableCapacityWatchesFunction::
+ SystemStorageRemoveAllAvailableCapacityWatchesFunction() {
}
-SystemInfoStorageRemoveAllWatchFunction::
-~SystemInfoStorageRemoveAllWatchFunction() {
+SystemStorageRemoveAllAvailableCapacityWatchesFunction::
+ ~SystemStorageRemoveAllAvailableCapacityWatchesFunction() {
}
-bool SystemInfoStorageRemoveAllWatchFunction::RunImpl() {
- // TODO(Haojian): Implement the removeAllWatch api.
+bool SystemStorageRemoveAllAvailableCapacityWatchesFunction::RunImpl() {
+ // TODO(Haojian): Implement the removeAllAvailableCapacityWatches api.
return false;
}

Powered by Google App Engine
This is Rietveld 408576698