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

Side by Side Diff: chrome/browser/notifications/notification_ui_manager_android.h

Issue 1127013008: Beginnings of synchronizing notifications in the notification database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void Add(const Notification& notification, Profile* profile) override; 47 void Add(const Notification& notification, Profile* profile) override;
48 bool Update(const Notification& notification, 48 bool Update(const Notification& notification,
49 Profile* profile) override; 49 Profile* profile) override;
50 const Notification* FindById(const std::string& delegate_id, 50 const Notification* FindById(const std::string& delegate_id,
51 ProfileID profile_id) const override; 51 ProfileID profile_id) const override;
52 bool CancelById(const std::string& delegate_id, 52 bool CancelById(const std::string& delegate_id,
53 ProfileID profile_id) override; 53 ProfileID profile_id) override;
54 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(Profile* profile, 54 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(Profile* profile,
55 const GURL& source) 55 const GURL& source)
56 override; 56 override;
57 std::set<std::string> GetAllIdsByProfile(Profile* profile) override;
57 bool CancelAllBySourceOrigin(const GURL& source_origin) override; 58 bool CancelAllBySourceOrigin(const GURL& source_origin) override;
58 bool CancelAllByProfile(ProfileID profile_id) override; 59 bool CancelAllByProfile(ProfileID profile_id) override;
59 void CancelAll() override; 60 void CancelAll() override;
60 61
61 static bool RegisterNotificationUIManager(JNIEnv* env); 62 static bool RegisterNotificationUIManager(JNIEnv* env);
62 63
63 private: 64 private:
64 // Pair containing the information necessary in order to enable closing 65 // Pair containing the information necessary in order to enable closing
65 // notifications that were not created by this instance of the manager: the 66 // notifications that were not created by this instance of the manager: the
66 // notification's origin and tag. This list may not contain the notifications 67 // notification's origin and tag. This list may not contain the notifications
67 // that have not been interacted with since the last restart of Chrome. 68 // that have not been interacted with since the last restart of Chrome.
68 using RegeneratedNotificationInfo = std::pair<std::string, std::string>; 69 using RegeneratedNotificationInfo = std::pair<std::string, std::string>;
69 70
70 // Mapping of a persistent notification id to renegerated notification info. 71 // Mapping of a persistent notification id to renegerated notification info.
71 // TODO(peter): Remove this map once notification delegate ids for Web 72 // TODO(peter): Remove this map once notification delegate ids for Web
72 // notifications are created by the content/ layer. 73 // notifications are created by the content/ layer.
73 std::map<int64_t, RegeneratedNotificationInfo> 74 std::map<int64_t, RegeneratedNotificationInfo>
74 regenerated_notification_infos_; 75 regenerated_notification_infos_;
75 76
76 base::android::ScopedJavaGlobalRef<jobject> java_object_; 77 base::android::ScopedJavaGlobalRef<jobject> java_object_;
77 78
78 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); 79 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid);
79 }; 80 };
80 81
81 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ 82 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698