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

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

Issue 1155453002: Passing ProfileID instead of Profile* to clarify that profile should not be used for making any cal… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 6 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 jstring java_tag); 44 jstring java_tag);
45 45
46 // NotificationUIManager implementation. 46 // NotificationUIManager implementation.
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(
55 const GURL& source) 55 ProfileID profile_id,
56 override; 56 const GURL& source) override;
57 std::set<std::string> GetAllIdsByProfile(Profile* profile) override; 57 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override;
58 bool CancelAllBySourceOrigin(const GURL& source_origin) override; 58 bool CancelAllBySourceOrigin(const GURL& source_origin) override;
59 bool CancelAllByProfile(ProfileID profile_id) override; 59 bool CancelAllByProfile(ProfileID profile_id) override;
60 void CancelAll() override; 60 void CancelAll() override;
61 61
62 static bool RegisterNotificationUIManager(JNIEnv* env); 62 static bool RegisterNotificationUIManager(JNIEnv* env);
63 63
64 private: 64 private:
65 // Pair containing the information necessary in order to enable closing 65 // Pair containing the information necessary in order to enable closing
66 // 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
67 // 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
68 // 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.
69 using RegeneratedNotificationInfo = std::pair<std::string, std::string>; 69 using RegeneratedNotificationInfo = std::pair<std::string, std::string>;
70 70
71 // Mapping of a persistent notification id to renegerated notification info. 71 // Mapping of a persistent notification id to renegerated notification info.
72 // TODO(peter): Remove this map once notification delegate ids for Web 72 // TODO(peter): Remove this map once notification delegate ids for Web
73 // notifications are created by the content/ layer. 73 // notifications are created by the content/ layer.
74 std::map<int64_t, RegeneratedNotificationInfo> 74 std::map<int64_t, RegeneratedNotificationInfo>
75 regenerated_notification_infos_; 75 regenerated_notification_infos_;
76 76
77 base::android::ScopedJavaGlobalRef<jobject> java_object_; 77 base::android::ScopedJavaGlobalRef<jobject> java_object_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); 79 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid);
80 }; 80 };
81 81
82 #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