summaryrefslogtreecommitdiffstats
path: root/ui/message_center
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-04 03:48:33 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-04 03:48:33 +0000
commita29d4377079bb015f6bd3a3a84422ccbc825f115 (patch)
tree3ef2550a0e13509db6fb827b3ff2d1e2f3339e9e /ui/message_center
parentfd405e4810785547fba4ea48d4a186e9e609bd08 (diff)
downloadchromium_src-a29d4377079bb015f6bd3a3a84422ccbc825f115.zip
chromium_src-a29d4377079bb015f6bd3a3a84422ccbc825f115.tar.gz
chromium_src-a29d4377079bb015f6bd3a3a84422ccbc825f115.tar.bz2
Remove experimental code fro grouping notifications from the same source.
BUG=320827 Review URL: https://codereview.chromium.org/117513006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r--ui/message_center/message_center.gyp2
-rw-r--r--ui/message_center/views/group_view.cc253
-rw-r--r--ui/message_center/views/group_view.h73
-rw-r--r--ui/message_center/views/message_center_controller.h3
-rw-r--r--ui/message_center/views/message_center_view.cc119
-rw-r--r--ui/message_center/views/message_center_view.h15
-rw-r--r--ui/message_center/views/message_center_view_unittest.cc20
-rw-r--r--ui/message_center/views/message_popup_collection.cc18
-rw-r--r--ui/message_center/views/message_popup_collection.h4
-rw-r--r--ui/message_center/views/toast_contents_view.cc18
-rw-r--r--ui/message_center/views/toast_contents_view.h4
11 files changed, 7 insertions, 522 deletions
diff --git a/ui/message_center/message_center.gyp b/ui/message_center/message_center.gyp
index 9b894cf..208aefb 100644
--- a/ui/message_center/message_center.gyp
+++ b/ui/message_center/message_center.gyp
@@ -73,8 +73,6 @@
'notifier_settings.h',
'views/bounded_label.cc',
'views/bounded_label.h',
- 'views/group_view.cc',
- 'views/group_view.h',
'views/constants.h',
'views/message_bubble_base.cc',
'views/message_bubble_base.h',
diff --git a/ui/message_center/views/group_view.cc b/ui/message_center/views/group_view.cc
deleted file mode 100644
index 3f56e56..0000000
--- a/ui/message_center/views/group_view.cc
+++ /dev/null
@@ -1,253 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/message_center/views/group_view.h"
-
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "grit/ui_resources.h"
-#include "grit/ui_strings.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/size.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/gfx/text_elider.h"
-#include "ui/message_center/message_center.h"
-#include "ui/message_center/message_center_style.h"
-#include "ui/message_center/message_center_tray.h"
-#include "ui/message_center/message_center_util.h"
-#include "ui/message_center/notification.h"
-#include "ui/message_center/views/bounded_label.h"
-#include "ui/message_center/views/constants.h"
-#include "ui/message_center/views/notification_button.h"
-#include "ui/message_center/views/proportional_image_view.h"
-#include "ui/native_theme/native_theme.h"
-#include "ui/views/background.h"
-#include "ui/views/border.h"
-#include "ui/views/controls/button/image_button.h"
-#include "ui/views/controls/image_view.h"
-#include "ui/views/controls/label.h"
-#include "ui/views/layout/box_layout.h"
-#include "ui/views/layout/fill_layout.h"
-#include "ui/views/widget/widget.h"
-
-#if defined(USE_AURA)
-#include "ui/base/cursor/cursor.h"
-#endif
-
-namespace {
-
-// static
-views::Border* MakeTextBorder(int padding, int top, int bottom) {
- // Split the padding between the top and the bottom, then add the extra space.
- return views::Border::CreateEmptyBorder(padding / 2 + top,
- message_center::kTextLeftPadding,
- (padding + 1) / 2 + bottom,
- message_center::kTextRightPadding);
-}
-
-} // namespace
-
-namespace message_center {
-
-// GroupView ////////////////////////////////////////////////////////////
-
-GroupView::GroupView(MessageCenterController* controller,
- const NotifierId& notifier_id,
- const Notification& last_notification,
- const gfx::ImageSkia& group_icon,
- int group_size)
- : MessageView(this,
- last_notification.id(),
- notifier_id,
- last_notification.display_source()),
- controller_(controller),
- notifier_id_(notifier_id),
- display_source_(last_notification.display_source()),
- group_icon_(group_icon),
- group_size_(group_size),
- last_notification_id_(last_notification.id()),
- top_view_(NULL),
- bottom_view_(NULL),
- title_view_(NULL),
- message_view_(NULL),
- context_message_view_(NULL),
- icon_view_(NULL)
-{
- std::vector<base::string16> accessible_lines;
- // Create the top_view_, which collects into a vertical box all content
- // at the top of the notification (to the right of the icon) except for the
- // close button.
- top_view_ = new views::View();
- top_view_->SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
- top_view_->set_border(views::Border::CreateEmptyBorder(
- kTextTopPadding - 8, 0, kTextBottomPadding - 5, 0));
-
- const gfx::FontList default_label_font_list = views::Label().font_list();
-
- // Create the title view if appropriate.
- const gfx::FontList& font_list =
- default_label_font_list.DeriveFontListWithSizeDelta(2);
- int padding = kTitleLineHeight - font_list.GetHeight();
-
- title_view_ = new BoundedLabel(
- gfx::TruncateString(base::string16(last_notification.title()),
- kTitleCharacterLimit),
- font_list);
- accessible_lines.push_back(last_notification.title());
- title_view_->SetLineHeight(kTitleLineHeight);
- title_view_->SetLineLimit(message_center::kTitleLineLimit);
- title_view_->SetColors(message_center::kRegularTextColor,
- kRegularTextBackgroundColor);
- title_view_->set_border(MakeTextBorder(padding, 3, 0));
- top_view_->AddChildView(title_view_);
-
- // Create the message view if appropriate.
- if (!last_notification.message().empty()) {
- int padding = kMessageLineHeight - default_label_font_list.GetHeight();
- message_view_ = new BoundedLabel(
- gfx::TruncateString(last_notification.message(),
- kMessageCharacterLimit));
- message_view_->SetLineHeight(kMessageLineHeight);
- message_view_->SetColors(message_center::kRegularTextColor,
- kDimTextBackgroundColor);
- message_view_->set_border(MakeTextBorder(padding, 4, 0));
- top_view_->AddChildView(message_view_);
- accessible_lines.push_back(last_notification.message());
- }
-
- // Create the context message view if appropriate.
- if (!last_notification.context_message().empty()) {
- int padding = kMessageLineHeight - default_label_font_list.GetHeight();
- context_message_view_ = new BoundedLabel(gfx::TruncateString(
- last_notification.context_message(), kContextMessageCharacterLimit),
- default_label_font_list);
- context_message_view_->SetLineLimit(
- message_center::kContextMessageLineLimit);
- context_message_view_->SetLineHeight(kMessageLineHeight);
- context_message_view_->SetColors(message_center::kDimTextColor,
- kContextTextBackgroundColor);
- context_message_view_->set_border(MakeTextBorder(padding, 4, 0));
- top_view_->AddChildView(context_message_view_);
- accessible_lines.push_back(last_notification.context_message());
- }
-
- // Create the notification icon view.
- icon_view_ = new ProportionalImageView(last_notification.icon().AsImageSkia(),
- gfx::Size(kIconSize, kIconSize));
- icon_view_->set_background(views::Background::CreateSolidBackground(
- kIconBackgroundColor));
-
- // Create the bottom_view_, which collects into a vertical box all content
- // below the notification icon except for the expandGroup button.
- bottom_view_ = new views::View();
- bottom_view_->SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
-
- // Create "N more.." action button
- views::View* separator = new views::ImageView();
- separator->set_border(views::Border::CreateSolidSidedBorder(
- 1, 0, 0, 0, kButtonSeparatorColor));
- bottom_view_->AddChildView(separator);
- more_button_ = new NotificationButton(this);
- base::string16 button_title =
- l10n_util::GetStringFUTF16(IDS_MESSAGE_CENTER_MORE_FROM,
- base::IntToString16(group_size_),
- display_source_);
- more_button_->SetTitle(button_title);
- more_button_->SetIcon(group_icon_);
- bottom_view_->AddChildView(more_button_);
-
- // Put together the different content and control views. Layering those allows
- // for proper layout logic and it also allows the close button to
- // overlap the content as needed to provide large enough click and touch area.
- AddChildView(top_view_);
- AddChildView(icon_view_);
- AddChildView(bottom_view_);
- AddChildView(close_button());
- set_accessible_name(JoinString(accessible_lines, '\n'));
-}
-
-GroupView::~GroupView() {
-}
-
-gfx::Size GroupView::GetPreferredSize() {
- int top_width = top_view_->GetPreferredSize().width();
- int bottom_width = bottom_view_->GetPreferredSize().width();
- int preferred_width = std::max(top_width, bottom_width) + GetInsets().width();
- return gfx::Size(preferred_width, GetHeightForWidth(preferred_width));
-}
-
-int GroupView::GetHeightForWidth(int width) {
- int content_width = width - GetInsets().width();
- int top_height = top_view_->GetHeightForWidth(content_width);
- int bottom_height = bottom_view_->GetHeightForWidth(content_width);
- int content_height = std::max(top_height, kIconSize) + bottom_height;
-
- // Adjust the height to make sure there is at least 16px of space below the
- // icon if there is any space there (<http://crbug.com/232966>).
- if (content_height > kIconSize)
- content_height = std::max(content_height,
- kIconSize + message_center::kIconBottomPadding);
-
- return content_height + GetInsets().height();
-}
-
-void GroupView::Layout() {
- MessageView::Layout();
- gfx::Insets insets = GetInsets();
- int content_width = width() - insets.width();
-
- // Top views.
- int top_height = top_view_->GetHeightForWidth(content_width);
- top_view_->SetBounds(insets.left(), insets.top(), content_width, top_height);
-
- // Icon.
- icon_view_->SetBounds(insets.left(), insets.top(), kIconSize, kIconSize);
-
- // Bottom views.
- int bottom_y = insets.top() + std::max(top_height, kIconSize);
- int bottom_height = bottom_view_->GetHeightForWidth(content_width);
- bottom_view_->SetBounds(insets.left(), bottom_y,
- content_width, bottom_height);
-}
-
-void GroupView::OnFocus() {
- MessageView::OnFocus();
- ScrollRectToVisible(GetLocalBounds());
-}
-
-gfx::NativeCursor GroupView::GetCursor(const ui::MouseEvent& event) {
-// If we ever have non-Aura views environment, this will fail compilation.
-#if defined(USE_AURA)
- return ui::kCursorHand;
-#endif
-}
-
-void GroupView::ButtonPressed(views::Button* sender,
- const ui::Event& event) {
- if (sender == more_button_) {
- controller_->ExpandGroup(notifier_id_);
- return;
- }
- // Let the superclass handle anything other than action buttons.
- // Warning: This may cause the GroupView itself to be deleted,
- // so don't do anything afterwards.
- MessageView::ButtonPressed(sender, event);
-}
-
-void GroupView::ClickOnNotification(const std::string& notification_id) {
- controller_->GroupBodyClicked(notification_id);
-}
-
-void GroupView::RemoveNotification(const std::string& notification_id,
- bool by_user) {
- controller_->RemoveGroup(notifier_id_);
-}
-
-} // namespace message_center
diff --git a/ui/message_center/views/group_view.h b/ui/message_center/views/group_view.h
deleted file mode 100644
index 020f7d1..0000000
--- a/ui/message_center/views/group_view.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_MESSAGE_CENTER_VIEWS_GROUP_VIEW_H_
-#define UI_MESSAGE_CENTER_VIEWS_GROUP_VIEW_H_
-
-#include "ui/gfx/image/image_skia.h"
-#include "ui/message_center/views/message_center_controller.h"
-#include "ui/message_center/views/message_center_view.h"
-#include "ui/message_center/views/message_view.h"
-
-namespace message_center {
-
-class BoundedLabel;
-class MessageCenter;
-class NotificationButton;
-
-// View that displays a placeholder representing several notifications and a
-// button to expand it into a set of individual notifications.
-class GroupView : public MessageView, public MessageViewController {
- public:
- // The group view currently shows the latest notificaiton w/o buttons
- // and a single button like "N more from XYZ".
- // Each GroupView has a notifier_id which it uses to report clicks and other
- // user actions to Client.
- GroupView(MessageCenterController* controller,
- const NotifierId& notifier_id,
- const Notification& last_notification,
- const gfx::ImageSkia& group_icon,
- int group_size);
-
- virtual ~GroupView();
-
- // Overridden from views::View:
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual int GetHeightForWidth(int width) OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
-
- // Overridden from MessageView:
- virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
-
- // Overridden from MessageViewController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
- virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
-
- private:
- MessageCenterController* controller_; // Weak, controls lifetime of views.
- NotifierId notifier_id_;
- base::string16 display_source_;
- gfx::ImageSkia group_icon_;
- int group_size_;
- std::string last_notification_id_;
-
- // Weak references to GroupView descendants owned by their parents.
- views::View* top_view_;
- views::View* bottom_view_;
- BoundedLabel* title_view_;
- BoundedLabel* message_view_;
- BoundedLabel* context_message_view_;
- views::View* icon_view_;
- NotificationButton* more_button_;
-
- DISALLOW_COPY_AND_ASSIGN(GroupView);
-};
-
-} // namespace message_center
-
-#endif // UI_MESSAGE_CENTER_VIEWS_GROUP_VIEW_H_
diff --git a/ui/message_center/views/message_center_controller.h b/ui/message_center/views/message_center_controller.h
index 96b76f0..b770f46 100644
--- a/ui/message_center/views/message_center_controller.h
+++ b/ui/message_center/views/message_center_controller.h
@@ -30,9 +30,6 @@ class MessageCenterController {
virtual void ClickOnNotificationButton(const std::string& notification_id,
int button_index) = 0;
virtual void ExpandNotification(const std::string& notification_id) = 0;
- virtual void GroupBodyClicked(const std::string& last_notification_id) = 0;
- virtual void ExpandGroup(const NotifierId& notifier_id) = 0;
- virtual void RemoveGroup(const NotifierId& notifier_id) = 0;
};
} // namespace message_center
diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc
index 6008b8f..8054a3d 100644
--- a/ui/message_center/views/message_center_view.cc
+++ b/ui/message_center/views/message_center_view.cc
@@ -25,7 +25,6 @@
#include "ui/message_center/message_center_tray.h"
#include "ui/message_center/message_center_types.h"
#include "ui/message_center/message_center_util.h"
-#include "ui/message_center/views/group_view.h"
#include "ui/message_center/views/message_center_button_bar.h"
#include "ui/message_center/views/message_view.h"
#include "ui/message_center/views/message_view_context_menu_controller.h"
@@ -56,9 +55,6 @@ const int kMinScrollViewHeight = 100;
const int kDefaultAnimationDurationMs = 120;
const int kDefaultFrameRateHz = 60;
-
-const int kMaxNotificationCountFromSingleDisplaySource = 1;
-
} // namespace
// BoundedScrollView ///////////////////////////////////////////////////////////
@@ -672,65 +668,14 @@ void MessageCenterView::SetNotifications(
notification_views_.clear();
- // Count how many times each Notifier is encountered. We group Notifications
- // by NotifierId.
- std::map<NotifierId, int> groups;
int index = 0;
+ for (NotificationList::Notifications::const_iterator iter =
+ notifications.begin(); iter != notifications.end(); ++iter) {
+ AddNotificationAt(*(*iter), index++);
- if (IsExperimentalNotificationUIEnabled()) {
- for (NotificationList::Notifications::const_iterator iter =
- notifications.begin(); iter != notifications.end(); ++iter) {
- NotifierId group_id = (*iter)->notifier_id();
- std::map<NotifierId, int>::iterator group_iter = groups.find(group_id);
- if (group_iter != groups.end())
- group_iter->second++;
- else
- groups[group_id] = 1;
- }
-
- // TODO(dimich): Find a better group icon. Preferably associated with
- // the group (notifier icon?).
- gfx::ImageSkia* group_icon = ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_FOLDER_CLOSED);
-
- for (NotificationList::Notifications::const_iterator iter =
- notifications.begin(); iter != notifications.end(); ++iter) {
- // See if the notification's NotifierId is encountered too many
- // times - in this case replace all notifications from this source with
- // a synthetic placeholder that says "N more". Mark the NotifierId
- // as "seen" by setting count to 0 so the subsequent notificaitons from
- // the same source are ignored.
- std::map<NotifierId, int>::iterator group_iter =
- groups.find((*iter)->notifier_id());
- // We should have collected all groups in the loop above.
- DCHECK(group_iter != groups.end());
-
- if (group_iter->second > kMaxNotificationCountFromSingleDisplaySource) {
- AddGroupPlaceholder(group_iter->first,
- *(*iter),
- group_icon ? *group_icon : gfx::ImageSkia(),
- group_iter->second,
- index++);
- group_iter->second = 0; // Mark.
- } else if (group_iter->second == 0) { // Marked, skip.
- continue;
- } else { // Ungrouped notifications
- AddNotificationAt(*(*iter), index++);
- }
-
- message_center_->DisplayedNotification((*iter)->id());
- if (notification_views_.size() >= kMaxVisibleMessageCenterNotifications)
- break;
- }
- } else {
- for (NotificationList::Notifications::const_iterator iter =
- notifications.begin(); iter != notifications.end(); ++iter) {
- AddNotificationAt(*(*iter), index++);
-
- message_center_->DisplayedNotification((*iter)->id());
- if (notification_views_.size() >= kMaxVisibleMessageCenterNotifications)
- break;
- }
+ message_center_->DisplayedNotification((*iter)->id());
+ if (notification_views_.size() >= kMaxVisibleMessageCenterNotifications)
+ break;
}
NotificationsChanged();
@@ -929,7 +874,6 @@ void MessageCenterView::OnMouseExited(const ui::MouseEvent& event) {
NotificationsChanged();
}
-// TODO(dimich): update for GROUP_VIEW
void MessageCenterView::OnNotificationAdded(const std::string& id) {
int index = 0;
const NotificationList::Notifications& notifications =
@@ -947,7 +891,6 @@ void MessageCenterView::OnNotificationAdded(const std::string& id) {
NotificationsChanged();
}
-// TODO(dimich): update for GROUP_VIEW
void MessageCenterView::OnNotificationRemoved(const std::string& id,
bool by_user) {
NotificationViewsMap::iterator view_iter = notification_views_.find(id);
@@ -983,7 +926,6 @@ void MessageCenterView::OnNotificationRemoved(const std::string& id,
NotificationsChanged();
}
-// TODO(dimich): update for GROUP_VIEW
void MessageCenterView::OnNotificationUpdated(const std::string& id) {
NotificationViewsMap::const_iterator view_iter = notification_views_.find(id);
if (view_iter == notification_views_.end())
@@ -1046,37 +988,6 @@ void MessageCenterView::ExpandNotification(const std::string& notification_id) {
message_center_->ExpandNotification(notification_id);
}
-void MessageCenterView::GroupBodyClicked(
- const std::string& last_notification_id) {
- message_center_->ClickOnNotification(last_notification_id);
-}
-
-// When clicked on the "N more" button, perform some reasonable action.
-// TODO(dimich): find out what the reasonable action could be.
-void MessageCenterView::ExpandGroup(const NotifierId& notifier_id) {
- NOTIMPLEMENTED();
-}
-
-// Click on Close button on a GroupView should remove all notifications
-// represented by this GroupView.
-void MessageCenterView::RemoveGroup(const NotifierId& notifier_id) {
- std::vector<std::string> notifications_to_remove;
-
- // Can not remove notifications while iterating the list. Collect the ids
- // and then run separate loop to remove notifications.
- const NotificationList::Notifications& notifications =
- message_center_->GetVisibleNotifications();
- for (NotificationList::Notifications::const_iterator iter =
- notifications.begin(); iter != notifications.end(); ++iter) {
- if ((*iter)->notifier_id() == notifier_id)
- notifications_to_remove.push_back((*iter)->id());
- }
-
- for (size_t i = 0; i < notifications_to_remove.size(); ++i)
- // "by_user" = true
- message_center_->RemoveNotification(notifications_to_remove[i], true);
-}
-
void MessageCenterView::AnimationEnded(const gfx::Animation* animation) {
DCHECK_EQ(animation, settings_transition_animation_.get());
@@ -1123,22 +1034,6 @@ void MessageCenterView::AddMessageViewAt(MessageView* view, int index) {
message_list_view_->AddNotificationAt(view, index);
}
-void MessageCenterView::AddGroupPlaceholder(
- const NotifierId& group_id,
- const Notification& last_notification,
- const gfx::ImageSkia& group_icon,
- int group_size,
- int index) {
- GroupView* view = new GroupView(this,
- group_id,
- last_notification,
- group_icon,
- group_size);
- view->set_context_menu_controller(context_menu_controller_.get());
- group_views_.push_back(view);
- AddMessageViewAt(view, index);
-}
-
void MessageCenterView::AddNotificationAt(const Notification& notification,
int index) {
// NotificationViews are expanded by default here until
@@ -1158,7 +1053,7 @@ void MessageCenterView::AddNotificationAt(const Notification& notification,
}
void MessageCenterView::NotificationsChanged() {
- bool no_message_views = notification_views_.empty() && group_views_.empty();
+ bool no_message_views = notification_views_.empty();
// When the child view is removed from the hierarchy, its focus is cleared.
// In this case we want to save which view has focus so that the user can
diff --git a/ui/message_center/views/message_center_view.h b/ui/message_center/views/message_center_view.h
index 2733607..1b441721 100644
--- a/ui/message_center/views/message_center_view.h
+++ b/ui/message_center/views/message_center_view.h
@@ -25,7 +25,6 @@ class Button;
namespace message_center {
-class GroupView;
class MessageCenter;
class MessageCenterBubble;
class NotificationCenterButton;
@@ -90,10 +89,6 @@ class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View,
virtual void ClickOnNotificationButton(const std::string& notification_id,
int button_index) OVERRIDE;
virtual void ExpandNotification(const std::string& notification_id) OVERRIDE;
- virtual void GroupBodyClicked(const std::string& last_notification_id)
- OVERRIDE;
- virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE;
- virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE;
// Overridden from gfx::AnimationDelegate:
virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
@@ -104,11 +99,6 @@ class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View,
friend class MessageCenterViewTest;
void AddMessageViewAt(MessageView* view, int index);
- void AddGroupPlaceholder(const NotifierId& group_id,
- const Notification& notification,
- const gfx::ImageSkia& group_icon,
- int group_size,
- int index);
void AddNotificationAt(const Notification& notification, int index);
void NotificationsChanged();
void SetNotificationViewForTest(MessageView* view);
@@ -121,11 +111,6 @@ class MESSAGE_CENTER_EXPORT MessageCenterView : public views::View,
typedef std::map<std::string, NotificationView*> NotificationViewsMap;
NotificationViewsMap notification_views_; // Weak.
- // List of all GroupViews. GroupView is responsible for multiple Notifications
- // from the same source.
- typedef std::list<GroupView*> GroupViews;
- GroupViews group_views_; // Weak.
-
// Child views.
views::ScrollView* scroller_;
scoped_ptr<MessageListView> message_list_view_;
diff --git a/ui/message_center/views/message_center_view_unittest.cc b/ui/message_center/views/message_center_view_unittest.cc
index 502b62d..5155ddf 100644
--- a/ui/message_center/views/message_center_view_unittest.cc
+++ b/ui/message_center/views/message_center_view_unittest.cc
@@ -105,10 +105,6 @@ class MessageCenterViewTest : public testing::Test,
virtual void ClickOnNotificationButton(const std::string& notification_id,
int button_index) OVERRIDE;
virtual void ExpandNotification(const std::string& notification_id) OVERRIDE;
- virtual void GroupBodyClicked(const std::string& last_notification_id)
- OVERRIDE;
- virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE;
- virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE;
// Overridden from MockNotificationView::Test
virtual void RegisterCall(CallType type) OVERRIDE;
@@ -217,22 +213,6 @@ void MessageCenterViewTest::ExpandNotification(
NOTREACHED();
}
-void MessageCenterViewTest::GroupBodyClicked(
- const std::string& last_notification_id) {
- // For this test, this method should not be invoked.
- NOTREACHED();
-}
-
-void MessageCenterViewTest::ExpandGroup(const NotifierId& notifier_id) {
- // For this test, this method should not be invoked.
- NOTREACHED();
-}
-
-void MessageCenterViewTest::RemoveGroup(const NotifierId& notifier_id) {
- // For this test, this method should not be invoked.
- NOTREACHED();
-}
-
void MessageCenterViewTest::RegisterCall(CallType type) {
callCounts_[type] += 1;
}
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index f7134c4..6615d3a 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -140,24 +140,6 @@ void MessagePopupCollection::ExpandNotification(
message_center_->ExpandNotification(notification_id);
}
-void MessagePopupCollection::GroupBodyClicked(
- const std::string& last_notification_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
-// When clicked on the "N more" button, perform some reasonable action.
-// TODO(dimich): find out what the reasonable action could be.
-void MessagePopupCollection::ExpandGroup(const NotifierId& notifier_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
-void MessagePopupCollection::RemoveGroup(const NotifierId& notifier_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
void MessagePopupCollection::MarkAllPopupsShown() {
std::set<std::string> closed_ids = CloseAllWidgets();
for (std::set<std::string>::iterator iter = closed_ids.begin();
diff --git a/ui/message_center/views/message_popup_collection.h b/ui/message_center/views/message_popup_collection.h
index 5aee25c..1ae2e8f 100644
--- a/ui/message_center/views/message_popup_collection.h
+++ b/ui/message_center/views/message_popup_collection.h
@@ -82,10 +82,6 @@ class MESSAGE_CENTER_EXPORT MessagePopupCollection
virtual void ClickOnNotificationButton(const std::string& notification_id,
int button_index) OVERRIDE;
virtual void ExpandNotification(const std::string& notification_id) OVERRIDE;
- virtual void GroupBodyClicked(const std::string& last_notification_id)
- OVERRIDE;
- virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE;
- virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE;
void MarkAllPopupsShown();
diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc
index a1bc249..0b3ff31 100644
--- a/ui/message_center/views/toast_contents_view.cc
+++ b/ui/message_center/views/toast_contents_view.cc
@@ -329,24 +329,6 @@ void ToastContentsView::ExpandNotification(
collection_->ExpandNotification(notification_id);
}
-void ToastContentsView::GroupBodyClicked(
- const std::string& last_notification_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
-// When clicked on the "N more" button, perform some reasonable action.
-// TODO(dimich): find out what the reasonable action could be.
-void ToastContentsView::ExpandGroup(const NotifierId& notifier_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
-void ToastContentsView::RemoveGroup(const NotifierId& notifier_id) {
- // No group views in popup collection.
- NOTREACHED();
-}
-
void ToastContentsView::CreateWidget(gfx::NativeView parent) {
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.keep_on_top = true;
diff --git a/ui/message_center/views/toast_contents_view.h b/ui/message_center/views/toast_contents_view.h
index 8e0a81c..a970daa 100644
--- a/ui/message_center/views/toast_contents_view.h
+++ b/ui/message_center/views/toast_contents_view.h
@@ -86,10 +86,6 @@ class ToastContentsView : public views::WidgetDelegateView,
virtual void ClickOnNotificationButton(const std::string& notification_id,
int button_index) OVERRIDE;
virtual void ExpandNotification(const std::string& notification_id) OVERRIDE;
- virtual void GroupBodyClicked(const std::string& last_notification_id)
- OVERRIDE;
- virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE;
- virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE;
// Overridden from gfx::AnimationDelegate:
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;