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

Unified Diff: chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h

Issue 11316133: Added implementation of SyncEventObserver to route events to Javascript Extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/sync_file_system/extension_sync_event_observer.h
diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..95554e07c5daf66851be383df0dda58eb860abe9
--- /dev/null
+++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
@@ -0,0 +1,34 @@
+// 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_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_
+#define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_
+
+
+#include "chrome/browser/extensions/event_router.h"
kinuko 2012/11/21 10:59:04 Not necessary (yet)?
calvinlo 2012/11/28 06:01:45 You're right. I've added a forward declaration of
+#include "chrome/browser/sync_file_system/sync_event_observer.h"
+
+namespace extensions {
+
+// Handles sending JavaScript events to exactly one extension ID
kinuko 2012/11/21 10:59:04 nit: '.' at the end of comment
calvinlo 2012/11/28 06:01:45 Done.
+class ExtensionSyncEventObserver
+ : public sync_file_system::SyncEventObserver {
+ public:
+ ExtensionSyncEventObserver(std::string extension_id, Profile* profile);
kinuko 2012/11/21 10:59:04 nit: use const reference for extension_id (to save
calvinlo 2012/11/28 06:01:45 Done.
+ ~ExtensionSyncEventObserver();
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver);
kinuko 2012/11/21 10:59:04 This needs to be placed in private: (Usually we wr
calvinlo 2012/11/28 06:01:45 Done.
+
+ virtual void OnSyncStateUpdated(
+ sync_file_system::SyncEventObserver::SyncServiceState state,
+ const std::string& description) OVERRIDE;
+
+ private:
+ std::string extension_id_;
+ Profile* profile_;
+};
+
+} // namespace extensions
kinuko 2012/11/21 10:59:04 nit: extra space after '//'?
calvinlo 2012/11/28 06:01:45 Done.
+
+#endif // #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_

Powered by Google App Engine
This is Rietveld 408576698