diff options
author | dharcourt@chromium.org <dharcourt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 12:02:07 +0000 |
---|---|---|
committer | dharcourt@chromium.org <dharcourt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 12:02:07 +0000 |
commit | 4958f0d2b68a5881f96d81fc722c915d270305e9 (patch) | |
tree | caab7d0fa6445190fdfeeffa9f484494fde7d387 /ui/message_center/base_format_view.cc | |
parent | 9d46a570df657ab2b5a58ac17f9dcd92d7761bdc (diff) | |
download | chromium_src-4958f0d2b68a5881f96d81fc722c915d270305e9.zip chromium_src-4958f0d2b68a5881f96d81fc722c915d270305e9.tar.gz chromium_src-4958f0d2b68a5881f96d81fc722c915d270305e9.tar.bz2 |
Added button support to image and list notifications.
BUG=168730
Review URL: https://chromiumcodereview.appspot.com/12016030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/base_format_view.cc')
-rw-r--r-- | ui/message_center/base_format_view.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/ui/message_center/base_format_view.cc b/ui/message_center/base_format_view.cc index 6f098a1..55a571d 100644 --- a/ui/message_center/base_format_view.cc +++ b/ui/message_center/base_format_view.cc @@ -73,15 +73,13 @@ void BaseFormatView::SetUpView() { // TODO(miket): unreadCount - if (notification().button_one_title.length() != 0) { - button_one_ = new views::LabelButton( - this, notification().button_one_title); + if (notification().button_titles.size() > 0) { + button_one_ = new views::LabelButton(this, notification().button_titles[0]); button_one_->SetHorizontalAlignment(gfx::ALIGN_CENTER); button_one_->SetNativeTheme(true); } - if (button_one_ && notification().button_two_title.length() != 0) { - button_two_ = new views::LabelButton( - this, notification().button_two_title); + if (notification().button_titles.size() > 1) { + button_two_ = new views::LabelButton(this, notification().button_titles[1]); button_two_->SetHorizontalAlignment(gfx::ALIGN_CENTER); button_two_->SetNativeTheme(true); } @@ -146,26 +144,31 @@ void BaseFormatView::SetUpView() { if (timestamp) layout->AddView(timestamp, 1, 1); else - layout->SkipColumns(2); + layout->SkipColumns(1); layout->AddView(close_button(), 1, 1); // Row 1: Big icon, title. layout->StartRow(0, 0); layout->AddView(icon, 1, 3); - layout->AddView(title, 6, 1); + layout->AddView(title, 3, 1); + layout->SkipColumns(1); // Row 2: Continuation of big icon, message. layout->StartRow(0, 0); layout->SkipColumns(1); - layout->AddView(message, 6, 1); + layout->AddView(message, 3, 1); + layout->SkipColumns(1); layout->AddPaddingRow(0, kBaseFormatPaddingBetweenItems); // Row 3: Continuation of big icon, two buttons, secondary icon. layout->StartRow(0,0); layout->SkipColumns(1); - if (button_one_) { + if (button_two_) { layout->AddView(button_one_, 1, 1); layout->AddView(button_two_, 1, 1); + } else if (button_one_) { + layout->AddView(button_one_, 1, 1); + layout->SkipColumns(1); } else { layout->SkipColumns(3); // two buttons plus padding } |