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

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

Issue 10836341: Add the basic code skeleton for system info event router (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add mock implementation for onAdded and onRemoved events Created 8 years, 4 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/mock_system_info_watcher.h
diff --git a/chrome/browser/extensions/mock_system_info_watcher.h b/chrome/browser/extensions/mock_system_info_watcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..440da5354fdf24a1e21d1443f217dc4269a35be9
--- /dev/null
+++ b/chrome/browser/extensions/mock_system_info_watcher.h
@@ -0,0 +1,33 @@
+// 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.
+#ifndef CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_
+#define CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_
+
+#include "chrome/browser/extensions/system_info_watcher.h"
+
+#include "base/timer.h"
+
+namespace extensions {
+
+class MockSystemInfoWatcher : public SystemInfoWatcher {
+ public:
+ MockSystemInfoWatcher();
+ virtual ~MockSystemInfoWatcher();
+
+ private:
+ // SystemInfoWatcher implementation.
+ virtual bool PlatformStartWatching(const std::string& event_name) OVERRIDE;
+ virtual bool PlatformStopWatching(const std::string& event_name) OVERRIDE;
+
+ // Called when the timer gets expired. It is used to emulate the random
+ // system event.
+ void OnTimeoutEvent();
+
+ base::RepeatingTimer<MockSystemInfoWatcher> timer_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_
+

Powered by Google App Engine
This is Rietveld 408576698