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

Unified Diff: chrome/browser/extensions/api/system_info/system_info_api.cc

Issue 18290002: [SystemInfo API] Finish TODOs in SystemInfoProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dev_rewrite_storage_info_api
Patch Set: Pass chromeos unit_tests 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_info/system_info_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d2039485c345d60a6be018aa7485c5f268dc69de 100644
--- a/chrome/browser/extensions/api/system_info/system_info_api.cc
+++ b/chrome/browser/extensions/api/system_info/system_info_api.cc
@@ -95,8 +95,8 @@ class SystemInfoEventRouter : public gfx::DisplayObserver,
// The callbacks of querying storage info to start and stop watching the
// storages. Called from UI thread.
- void StartWatchingStorages(const StorageInfo& info, bool success);
- void StopWatchingStorages(const StorageInfo& info, bool success);
+ void StartWatchingStorages(bool success);
+ void StopWatchingStorages(bool success);
// Called to dispatch the systemInfo.display.onDisplayChanged event.
void OnDisplayChanged();
@@ -127,26 +127,20 @@ SystemInfoEventRouter::~SystemInfoEventRouter() {
storage_monitor->RemoveObserver(this);
}
-void SystemInfoEventRouter::StartWatchingStorages(
- const StorageInfo& info, bool success) {
+void SystemInfoEventRouter::StartWatchingStorages(bool success) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!success)
return;
- for (StorageInfo::const_iterator it = info.begin(); it != info.end(); ++it) {
- StorageInfoProvider::Get()->StartWatching((*it)->id);
- }
+ StorageInfoProvider::Get()->StartWatchingAllStorages();
}
-void SystemInfoEventRouter::StopWatchingStorages(
- const StorageInfo& info, bool success) {
+void SystemInfoEventRouter::StopWatchingStorages(bool success) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!success)
return;
- for (StorageInfo::const_iterator it = info.begin(); it != info.end(); ++it) {
- StorageInfoProvider::Get()->StopWatching((*it)->id);
- }
+ StorageInfoProvider::Get()->StopWatchingAllStorages();
}
void SystemInfoEventRouter::AddEventListener(const std::string& event_name) {
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_info/system_info_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698