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

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: Fix destructor for compile 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e730594bfe0705cedfdec87f40b3efe52839a3c0
--- /dev/null
+++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h
@@ -0,0 +1,43 @@
+// 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_H_
+#define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/sync_file_system/sync_event_observer.h"
+
+class Profile;
+
+namespace extensions {
+
+// Observes changes in SyncFileSystem and relays events to JS Extension API.
+class ExtensionSyncEventObserver
+ : public sync_file_system::SyncEventObserver {
+ public:
+ explicit ExtensionSyncEventObserver(Profile* profile,
+ const std::string& service_name);
+ virtual ~ExtensionSyncEventObserver();
+
+ virtual void OnSyncStateUpdated(
+ const GURL& app_origin,
+ sync_file_system::SyncEventObserver::SyncServiceState state,
+ const std::string& description) OVERRIDE;
+
+ virtual void OnFileSynced(const fileapi::FileSystemURL& url,
+ fileapi::SyncOperationType operation) OVERRIDE;
+
+ private:
+ const std::string& GetExtensionId(const GURL& app_origin);
+
+ Profile* profile_;
+ const std::string service_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698