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

Unified Diff: chrome/browser/extensions/system_info_event_router.h

Issue 11419279: Implement systemInfo.storage.onChanged event (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: refine browser test and code comments Created 8 years 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/system_info_event_router.h
diff --git a/chrome/browser/extensions/system_info_event_router.h b/chrome/browser/extensions/system_info_event_router.h
index 2fd8b4f1afd5d7ebbaa4b35a95d4b58e65850c47..ef12002a47394a09c94b8e6cf9cecb4f969356df 100644
--- a/chrome/browser/extensions/system_info_event_router.h
+++ b/chrome/browser/extensions/system_info_event_router.h
@@ -10,6 +10,7 @@
#include "base/file_path.h"
#include "base/memory/singleton.h"
#include "base/values.h"
+#include "chrome/browser/extensions/storage_info_observer.h"
namespace extensions {
@@ -29,7 +30,7 @@ struct CpuUpdateInfo;
// Since the system_monitor will be refactored along with media_gallery, once
// http://crbug.com/145400 is fixed, we need to update SystemInfoEventRouter
// accordingly.
-class SystemInfoEventRouter {
+class SystemInfoEventRouter : public StorageInfoObserver {
public:
static SystemInfoEventRouter* GetInstance();
@@ -40,11 +41,6 @@ class SystemInfoEventRouter {
// Return true if the |event_name| is an event from systemInfo namespace.
static bool IsSystemInfoEvent(const std::string& event_name);
- // TODO(hongbo): The following methods should be likely overriden from
- // SystemMonitor::DevicesChangedObserver once the http://crbug.com/145400
- // is fixed.
- void OnStorageAvailableCapacityChanged(const std::string& id,
- int64 available_capacity);
void OnRemovableStorageAttached(const std::string& id,
const string16& name,
const FilePath::StringType& location);
@@ -56,15 +52,21 @@ class SystemInfoEventRouter {
SystemInfoEventRouter();
virtual ~SystemInfoEventRouter();
- // Called from any thread to dispatch the systemInfo event to all extension
- // processes cross multiple profiles.
- void DispatchEvent(const std::string& event_name,
- scoped_ptr<base::ListValue> args);
+ // Overriden from StorageInfoObserver:
+ void OnStorageFreeSpaceChanged(const std::string& id,
+ double old_value,
+ double new_value,
+ int threshold);
// The callback for CPU sampling cycle. Called from FILE thread.
void OnNextCpuSampling(
scoped_ptr<api::experimental_system_info_cpu::CpuUpdateInfo> info);
+ // Called from any thread to dispatch the systemInfo event to all extension
+ // processes cross multiple profiles.
+ void DispatchEvent(const std::string& event_name,
+ scoped_ptr<base::ListValue> args);
+
// Used to record the event names being watched.
std::multiset<std::string> watching_event_set_;

Powered by Google App Engine
This is Rietveld 408576698