| 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_;
|
|
|
|
|