summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/sync_notifier/synced_notification.h
diff options
context:
space:
mode:
authorpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 19:58:05 +0000
committerpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-11 19:58:05 +0000
commit3a585276f38d07d23f84d7664791c58d58c60b29 (patch)
tree5d52a67ca0bb582af6143abffaa60ac7a8ea2ab9 /chrome/browser/notifications/sync_notifier/synced_notification.h
parent0e01c0207a24c425287dee4bf77dbf7478140a41 (diff)
downloadchromium_src-3a585276f38d07d23f84d7664791c58d58c60b29.zip
chromium_src-3a585276f38d07d23f84d7664791c58d58c60b29.tar.gz
chromium_src-3a585276f38d07d23f84d7664791c58d58c60b29.tar.bz2
Add implementation and tests for clicking on a notification.
To round out the feature of clicking on the body of a notification or on a text button, we should navigate to the appropriate URL for the background or button. This change adds code to do that, and the proper browser tests. This change also refactors the button code to be able to accept an arbitrary number of buttons from the synced notification. Note that Rich Notifications is still limited to two buttons, though, so only two buttons are passed to Rich Notifications. This change also includes a refactoring to return GURL everywhere we have a URL instead of returning a string. BUG=247564 Review URL: https://chromiumcodereview.appspot.com/17450021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/sync_notifier/synced_notification.h')
-rw-r--r--chrome/browser/notifications/sync_notifier/synced_notification.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/chrome/browser/notifications/sync_notifier/synced_notification.h b/chrome/browser/notifications/sync_notifier/synced_notification.h
index 52f37ee..fd3ee55 100644
--- a/chrome/browser/notifications/sync_notifier/synced_notification.h
+++ b/chrome/browser/notifications/sync_notifier/synced_notification.h
@@ -62,16 +62,13 @@ class SyncedNotification : public NotificationBitmapFetcherDelegate {
uint64 GetCreationTime() const;
int GetPriority() const;
std::string GetDefaultDestinationTitle() const;
- std::string GetDefaultDestinationIconUrl() const;
- std::string GetDefaultDestinationUrl() const;
- std::string GetButtonOneTitle() const;
- std::string GetButtonOneIconUrl() const;
- std::string GetButtonOneUrl() const;
- std::string GetButtonTwoTitle() const;
- std::string GetButtonTwoIconUrl() const;
- std::string GetButtonTwoUrl() const;
- int GetNotificationCount() const;
- int GetButtonCount() const;
+ GURL GetDefaultDestinationIconUrl() const;
+ GURL GetDefaultDestinationUrl() const;
+ std::string GetButtonTitle(unsigned int which_button) const;
+ GURL GetButtonIconUrl(unsigned int which_button) const;
+ GURL GetButtonUrl(unsigned int which_button) const;
+ size_t GetNotificationCount() const;
+ size_t GetButtonCount() const;
std::string GetContainedNotificationTitle(int index) const;
std::string GetContainedNotificationMessage(int index) const;
@@ -116,8 +113,7 @@ class SyncedNotification : public NotificationBitmapFetcherDelegate {
int active_fetcher_count_;
gfx::Image app_icon_bitmap_;
gfx::Image image_bitmap_;
- gfx::Image button_one_bitmap_;
- gfx::Image button_two_bitmap_;
+ std::vector<gfx::Image> button_bitmaps_;
FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, AddBitmapToFetchQueueTest);
FRIEND_TEST_ALL_PREFIXES(SyncedNotificationTest, OnFetchCompleteTest);