| Index: chrome/browser/notifications/sync_notifier/synced_notification.h
|
| diff --git a/chrome/browser/notifications/sync_notifier/synced_notification.h b/chrome/browser/notifications/sync_notifier/synced_notification.h
|
| index 429ecc66e850647f8752e0ee80d46ca183de8b78..746953899d4f0975368d864322063d721bbfc3ec 100644
|
| --- a/chrome/browser/notifications/sync_notifier/synced_notification.h
|
| +++ b/chrome/browser/notifications/sync_notifier/synced_notification.h
|
| @@ -74,7 +74,6 @@ class SyncedNotification : public chrome::BitmapFetcherDelegate {
|
| size_t GetButtonCount() const;
|
| std::string GetContainedNotificationTitle(int index) const;
|
| std::string GetContainedNotificationMessage(int index) const;
|
| - std::string GetSendingServiceId() const;
|
| const gfx::Image& GetAppIcon() const;
|
|
|
| // Use this to prevent toasting a notification.
|
| @@ -86,18 +85,30 @@ class SyncedNotification : public chrome::BitmapFetcherDelegate {
|
| void NotificationHasBeenDismissed();
|
|
|
| // Fill up the queue of bitmaps to fetch.
|
| - void QueueBitmapFetchJobs(NotificationUIManager* notification_manager,
|
| - ChromeNotifierService* notifier_service,
|
| + void QueueBitmapFetchJobs(ChromeNotifierService* notifier_service,
|
| Profile* profile);
|
|
|
| + void set_notification_manager(NotificationUIManager* notification_manager) {
|
| + notification_manager_ = notification_manager;
|
| + }
|
| +
|
| + void set_notifier_service(ChromeNotifierService* notifier) {
|
| + notifier_service_ = notifier;
|
| + }
|
| +
|
| // Start the bitmap fetching. When it is complete, the callback
|
| // will call Show().
|
| void StartBitmapFetch();
|
|
|
| // Display the notification in the notification center
|
| - void Show(NotificationUIManager* notification_manager,
|
| - ChromeNotifierService* notifier_service,
|
| - Profile* profile);
|
| + void Show(Profile* profile);
|
| +
|
| + // Display the notification if it has the specified app_id_name.
|
| + void ShowAllForAppId(Profile* profile,
|
| + std::string app_id_name);
|
| +
|
| + // Remove the notification if it has the specified app_id_name.
|
| + void HideAllForAppId(std::string app_id_name);
|
|
|
| // This gets a pointer to the SyncedNotificationSpecifics part
|
| // of the sync data.
|
| @@ -114,7 +125,7 @@ class SyncedNotification : public chrome::BitmapFetcherDelegate {
|
| virtual void OnFetchComplete(const GURL url, const SkBitmap* bitmap) OVERRIDE;
|
|
|
| // If this bitmap has a valid GURL, create a fetcher for it.
|
| - void AddBitmapToFetchQueue(const GURL& gurl);
|
| + void CreateBitmapFetcher(const GURL& gurl);
|
|
|
| // Check to see if we have responses for all the bitmaps we need.
|
| bool AreAllBitmapsFetched();
|
| @@ -134,13 +145,14 @@ class SyncedNotification : public chrome::BitmapFetcherDelegate {
|
| bool image_bitmap_fetch_pending_;
|
| std::vector<bool> button_bitmaps_fetch_pending_;
|
|
|
| -
|
| friend class SyncedNotificationTest;
|
|
|
| - FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, AddBitmapToFetchQueueTest);
|
| + FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, CreateBitmapFetcherTest);
|
| FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, OnFetchCompleteTest);
|
| FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, QueueBitmapFetchJobsTest);
|
| FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, EmptyBitmapTest);
|
| + FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, ShowIfNewlyEnabledTest);
|
| + FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, HideIfNewlyRemovedTest);
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SyncedNotification);
|
| };
|
|
|