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

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: Fixed test to match updated SyncEventObserver interface 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..1d25c906a162032576e3450c5b17ac97a654063d
--- /dev/null
+++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
@@ -0,0 +1,37 @@
+// 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 "base/compiler_specific.h"
+#include "chrome/browser/sync_file_system/sync_event_observer.h"
+
+class Profile;
+
+namespace extensions {
+
+// Handles sending JavaScript events to exactly one extension ID.
+class ExtensionSyncEventObserver
+ : public sync_file_system::SyncEventObserver {
+ public:
+ ExtensionSyncEventObserver(Profile* profile,
+ const std::string& service_name);
+ ~ExtensionSyncEventObserver();
+
+ virtual void OnSyncStateUpdated(
+ const std::string& extension_id,
+ sync_file_system::SyncEventObserver::SyncServiceState state,
+ const std::string& description) OVERRIDE;
kinuko 2012/11/28 07:41:13 You'll also need to have OnFileSynced() override h
calvinlo 2012/11/28 10:43:46 Ok I've added this now but just using a DOMString
+
+ private:
+ Profile* profile_;
+ const std::string service_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver);
+};
+
+} // namespace extensions
+
+#endif // #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_

Powered by Google App Engine
This is Rietveld 408576698