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

Side by Side Diff: chrome/browser/notifications/sync_notifier/synced_notification.h

Issue 19771013: Adapting the UI to bring it closer to the spec, and fixing image fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adapting the UI: fix unit tests Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 // This class represents the data for a single Synced Notification. 5 // This class represents the data for a single Synced Notification.
6 // It should map 1-1 to all the data in synced_notification_sepcifics.proto, 6 // It should map 1-1 to all the data in synced_notification_sepcifics.proto,
7 // and the data and render protobufs that the specifics protobuf contains. 7 // and the data and render protobufs that the specifics protobuf contains.
8 8
9 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_ 9 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_
10 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_ 10 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 static const int kUndefinedPriority = 65535; 46 static const int kUndefinedPriority = 65535;
47 47
48 void Update(const syncer::SyncData& sync_data); 48 void Update(const syncer::SyncData& sync_data);
49 49
50 // Here are some helper functions to get individual data parts out of a 50 // Here are some helper functions to get individual data parts out of a
51 // SyncedNotification. 51 // SyncedNotification.
52 std::string GetTitle() const; 52 std::string GetTitle() const;
53 std::string GetHeading() const; 53 std::string GetHeading() const;
54 std::string GetDescription() const; 54 std::string GetDescription() const;
55 std::string GetAnnotation() const;
55 std::string GetAppId() const; 56 std::string GetAppId() const;
56 std::string GetKey() const; 57 std::string GetKey() const;
57 GURL GetOriginUrl() const; 58 GURL GetOriginUrl() const;
58 GURL GetAppIconUrl() const; 59 GURL GetAppIconUrl() const;
59 GURL GetImageUrl() const; 60 GURL GetImageUrl() const;
60 std::string GetText() const; 61 std::string GetText() const;
61 ReadState GetReadState() const; 62 ReadState GetReadState() const;
62 uint64 GetCreationTime() const; 63 uint64 GetCreationTime() const;
63 int GetPriority() const; 64 int GetPriority() const;
64 std::string GetDefaultDestinationTitle() const; 65 std::string GetDefaultDestinationTitle() const;
65 GURL GetDefaultDestinationIconUrl() const; 66 GURL GetDefaultDestinationIconUrl() const;
66 GURL GetDefaultDestinationUrl() const; 67 GURL GetDefaultDestinationUrl() const;
67 std::string GetButtonTitle(unsigned int which_button) const; 68 std::string GetButtonTitle(unsigned int which_button) const;
68 GURL GetButtonIconUrl(unsigned int which_button) const; 69 GURL GetButtonIconUrl(unsigned int which_button) const;
69 GURL GetButtonUrl(unsigned int which_button) const; 70 GURL GetButtonUrl(unsigned int which_button) const;
71 GURL GetProfilePictureUrl(unsigned int which_url) const;
72 size_t GetProfilePictureCount() const;
70 size_t GetNotificationCount() const; 73 size_t GetNotificationCount() const;
71 size_t GetButtonCount() const; 74 size_t GetButtonCount() const;
72 std::string GetContainedNotificationTitle(int index) const; 75 std::string GetContainedNotificationTitle(int index) const;
73 std::string GetContainedNotificationMessage(int index) const; 76 std::string GetContainedNotificationMessage(int index) const;
74 77
75 78
76 bool EqualsIgnoringReadState(const SyncedNotification& other) const; 79 bool EqualsIgnoringReadState(const SyncedNotification& other) const;
77 80
78 void NotificationHasBeenDismissed(); 81 void NotificationHasBeenDismissed();
79 82
(...skipping 25 matching lines...) Expand all
105 // If this bitmap has a valid GURL, create a fetcher for it. 108 // If this bitmap has a valid GURL, create a fetcher for it.
106 void AddBitmapToFetchQueue(const GURL& gurl); 109 void AddBitmapToFetchQueue(const GURL& gurl);
107 110
108 sync_pb::SyncedNotificationSpecifics specifics_; 111 sync_pb::SyncedNotificationSpecifics specifics_;
109 NotificationUIManager* notification_manager_; 112 NotificationUIManager* notification_manager_;
110 ChromeNotifierService* notifier_service_; 113 ChromeNotifierService* notifier_service_;
111 Profile* profile_; 114 Profile* profile_;
112 ScopedVector<NotificationBitmapFetcher> fetchers_; 115 ScopedVector<NotificationBitmapFetcher> fetchers_;
113 int active_fetcher_count_; 116 int active_fetcher_count_;
114 gfx::Image app_icon_bitmap_; 117 gfx::Image app_icon_bitmap_;
118 gfx::Image sender_bitmap_;
115 gfx::Image image_bitmap_; 119 gfx::Image image_bitmap_;
116 std::vector<gfx::Image> button_bitmaps_; 120 std::vector<gfx::Image> button_bitmaps_;
117 121
118 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, AddBitmapToFetchQueueTest); 122 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, AddBitmapToFetchQueueTest);
119 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, OnFetchCompleteTest); 123 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, OnFetchCompleteTest);
120 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, QueueBitmapFetchJobsTest); 124 FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, QueueBitmapFetchJobsTest);
121 125
122 DISALLOW_COPY_AND_ASSIGN(SyncedNotification); 126 DISALLOW_COPY_AND_ASSIGN(SyncedNotification);
123 }; 127 };
124 128
125 } // namespace notifier 129 } // namespace notifier
126 130
127 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_ 131 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_SYNCED_NOTIFICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698