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

Side by Side 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: Kinuko Review #4 Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE RVER_
6 #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSE RVER_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/sync_file_system/sync_event_observer.h"
11
12 class Profile;
13
14 namespace extensions {
15
16 // Observes changes in SyncFileSystem and relays events to JS Extension API.
17 class ExtensionSyncEventObserver
18 : public sync_file_system::SyncEventObserver {
19 public:
20 ExtensionSyncEventObserver(Profile* profile,
21 const std::string& service_name);
22 ~ExtensionSyncEventObserver();
23
24 virtual void OnSyncStateUpdated(
25 const GURL& app_origin,
26 sync_file_system::SyncEventObserver::SyncServiceState state,
27 const std::string& description) OVERRIDE;
28
29 virtual void OnFileSynced(fileapi::SyncOperationType operation,
30 const fileapi::FileSystemURL& url) OVERRIDE;
31
32 private:
33 Profile* profile_;
benwells 2012/11/29 04:37:58 Nit: Fields should go after functions.
calvinlo 2012/11/29 05:01:22 Done.
34 const std::string service_name_;
35
36 const std::string& GetExtensionId(const GURL& app_origin);
37
38 DISALLOW_COPY_AND_ASSIGN(ExtensionSyncEventObserver);
39 };
40
41 } // namespace extensions
42
43 #endif // #ifndef CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC _EVENT_OBSERVER_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698