diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 13:07:11 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 13:07:11 +0000 |
commit | e77cfe45dc7dae8d35f9d1de9a4a27df547a368f (patch) | |
tree | 2ce650c3bb8b52c484e0903e0c33b02ced018382 /ui/notifications | |
parent | 5288b8ea4bdac51d7bc4298af6cb7e1d27e924aa (diff) | |
download | chromium_src-e77cfe45dc7dae8d35f9d1de9a4a27df547a368f.zip chromium_src-e77cfe45dc7dae8d35f9d1de9a4a27df547a368f.tar.gz chromium_src-e77cfe45dc7dae8d35f9d1de9a4a27df547a368f.tar.bz2 |
Revert 167589 - Continuing TODO items from a previous CL, remove the "extra_field" and "second_extra_field" keys from the API and replace with real keys from the Base Format View spec. Implement a rough layout that resembles the expanded mode of the view.
Breaks win_aura, I guess you need to add a dependency on base.gyp:base_i18n
Outstanding items:
- As stated above, the layout is still ugly.
- We don't gracefully handle empty buttons. We don't crash, either, but it looks even uglier when the buttons are missing.
- The buttons don't do anything when the user clicks on them.
- The second icon is just a redraw of the first.
- The timestamp is hardcoded to "10:43 AM" for layout purposes. I need to do more research on the appropriate date-formatting facilities available to us, and from that back out the timestamp field format in the API itself.
Review URL: https://chromiumcodereview.appspot.com/11358144
TBR=miket@chromium.org
Review URL: https://codereview.chromium.org/11377156
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/notifications')
-rw-r--r-- | ui/notifications/notification_types.cc | 26 | ||||
-rw-r--r-- | ui/notifications/notification_types.h | 22 |
2 files changed, 8 insertions, 40 deletions
diff --git a/ui/notifications/notification_types.cc b/ui/notifications/notification_types.cc index 9ec43c8..b4f0c83 100644 --- a/ui/notifications/notification_types.cc +++ b/ui/notifications/notification_types.cc @@ -8,30 +8,8 @@ namespace ui { namespace notifications { -const char kMessageIntentKey[] = "message_intent"; -const char kPriorityKey[] = "priority"; -const char kTimestampKey[] = "timestamp"; -const char kSecondIconUrlKey[] = "second_icon_url"; -const char kUnreadCountKey[] = "unread_count"; -const char kButtonOneTitleKey[] = "button_one_title"; -const char kButtonOneIntentKey[] = "button_one_intent"; -const char kButtonTwoTitleKey[] = "button_two_title"; -const char kButtonTwoIntentKey[] = "button_two_intent"; -const char kExpandedMessageKey[] = "expanded_message"; -const char kImageUrlKey[] = "image_url"; - -const char kSimpleType[] = "simple"; -const char kBaseFormatType[] = "base"; - -NotificationType StringToNotificationType(std::string& string_type) { - if (string_type == kSimpleType) - return NOTIFICATION_TYPE_SIMPLE; - if (string_type == kBaseFormatType) - return NOTIFICATION_TYPE_BASE_FORMAT; - - // In case of unrecognized string, fall back to most common type. - return NOTIFICATION_TYPE_SIMPLE; -} +const char kExtraFieldKey[] = "extra_field"; +const char kSecondExtraFieldKey[] = "second_extra_field"; } // namespace notifications diff --git a/ui/notifications/notification_types.h b/ui/notifications/notification_types.h index 049628f..d1c9725 100644 --- a/ui/notifications/notification_types.h +++ b/ui/notifications/notification_types.h @@ -5,34 +5,24 @@ #ifndef UI_NOTIFICATIONS_NOTIFICATION_TYPES_H_ #define UI_NOTIFICATIONS_NOTIFICATION_TYPES_H_ -#include <string> - #include "ui/base/ui_export.h" namespace ui { namespace notifications { -// Keys for optional fields in Notification. -UI_EXPORT extern const char kMessageIntentKey[]; -UI_EXPORT extern const char kPriorityKey[]; -UI_EXPORT extern const char kTimestampKey[]; -UI_EXPORT extern const char kSecondIconUrlKey[]; -UI_EXPORT extern const char kUnreadCountKey[]; -UI_EXPORT extern const char kButtonOneTitleKey[]; -UI_EXPORT extern const char kButtonOneIntentKey[]; -UI_EXPORT extern const char kButtonTwoTitleKey[]; -UI_EXPORT extern const char kButtonTwoIntentKey[]; -UI_EXPORT extern const char kExpandedMessageKey[]; -UI_EXPORT extern const char kImageUrlKey[]; +// TODO(miket): these are temporary field names that will be replaced very +// shortly with real names. See +// chrome/browser/extensions/api/notification/notification_api.cc for more +// context. +UI_EXPORT extern const char kExtraFieldKey[]; +UI_EXPORT extern const char kSecondExtraFieldKey[]; enum NotificationType { NOTIFICATION_TYPE_SIMPLE, NOTIFICATION_TYPE_BASE_FORMAT, }; -UI_EXPORT NotificationType StringToNotificationType(std::string& string_type); - } // namespace notifications } // namespace ui |