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

Side by Side Diff: chrome/browser/extensions/app_notification_storage.h

Issue 10830036: Moved the AppNotification system into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__
6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__ 6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "chrome/browser/extensions/app_notification.h" 10 #include "chrome/browser/extensions/app_notification.h"
11 11
12 class FilePath; 12 class FilePath;
13 13
14 namespace extensions {
15
14 // Represents storage for app notifications for a particular extension id. 16 // Represents storage for app notifications for a particular extension id.
15 // 17 //
16 // IMPORTANT NOTE: Instances of this class should only be used on the FILE 18 // IMPORTANT NOTE: Instances of this class should only be used on the FILE
17 // thread. 19 // thread.
18 class AppNotificationStorage { 20 class AppNotificationStorage {
19 public: 21 public:
20 // Must be called on the FILE thread. The storage will be created at |path|. 22 // Must be called on the FILE thread. The storage will be created at |path|.
21 static AppNotificationStorage* Create(const FilePath& path); 23 static AppNotificationStorage* Create(const FilePath& path);
22 24
23 virtual ~AppNotificationStorage(); 25 virtual ~AppNotificationStorage();
24 26
25 // Get the set of extension id's that have entries, putting them into 27 // Get the set of extension id's that have entries, putting them into
26 // |result|. 28 // |result|.
27 virtual bool GetExtensionIds(std::set<std::string>* result) = 0; 29 virtual bool GetExtensionIds(std::set<std::string>* result) = 0;
28 30
29 // Gets the list of stored notifications for extension_id. On success, writes 31 // Gets the list of stored notifications for extension_id. On success, writes
30 // results into |result|. On error, returns false. 32 // results into |result|. On error, returns false.
31 virtual bool Get(const std::string& extension_id, 33 virtual bool Get(const std::string& extension_id,
32 AppNotificationList* result) = 0; 34 AppNotificationList* result) = 0;
33 35
34 // Writes the |list| for |extension_id| into storage. 36 // Writes the |list| for |extension_id| into storage.
35 virtual bool Set(const std::string& extension_id, 37 virtual bool Set(const std::string& extension_id,
36 const AppNotificationList& list) = 0; 38 const AppNotificationList& list) = 0;
37 39
38 // Deletes all data for |extension_id|. 40 // Deletes all data for |extension_id|.
39 virtual bool Delete(const std::string& extension_id) = 0; 41 virtual bool Delete(const std::string& extension_id) = 0;
40 }; 42 };
41 43
44 } // namespace extensions
45
42 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__ 46 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_STORAGE_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_manager_unittest.cc ('k') | chrome/browser/extensions/app_notification_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698