explicit MockNotificationView(MessageCenterController* controller,
const Notification& notification,
Test* test);
- virtual ~MockNotificationView();
+ ~MockNotificationView() override;
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual int GetHeightForWidth(int w) OVERRIDE;
- virtual void Layout() OVERRIDE;
+ gfx::Size GetPreferredSize() const override;
+ int GetHeightForWidth(int w) const override;
+ void Layout() override;
private:
Test* test_;
MockNotificationView::MockNotificationView(MessageCenterController* controller,
const Notification& notification,
Test* test)
- : NotificationView(controller, notification, true),
+ : NotificationView(controller, notification),
test_(test) {
}
MockNotificationView::~MockNotificationView() {
}
-gfx::Size MockNotificationView::GetPreferredSize() {
+gfx::Size MockNotificationView::GetPreferredSize() const {
test_->RegisterCall(GET_PREFERRED_SIZE);
DCHECK(child_count() > 0);
return NotificationView::GetPreferredSize();
}
-int MockNotificationView::GetHeightForWidth(int width) {
+int MockNotificationView::GetHeightForWidth(int width) const {
test_->RegisterCall(GET_HEIGHT_FOR_WIDTH);
DCHECK(child_count() > 0);
return NotificationView::GetHeightForWidth(width);
public MessageCenterController {
public:
MessageCenterViewTest();
- virtual ~MessageCenterViewTest();
+ ~MessageCenterViewTest() override;
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ void SetUp() override;
+ void TearDown() override;
MessageCenterView* GetMessageCenterView();
int GetNotificationCount();
int GetCallCount(CallType type);
// Overridden from MessageCenterController:
- virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE;
- virtual void RemoveNotification(const std::string& notification_id,
- bool by_user) OVERRIDE;
- virtual scoped_ptr<ui::MenuModel> CreateMenuModel(
+ void ClickOnNotification(const std::string& notification_id) override;
+ void RemoveNotification(const std::string& notification_id,
+ bool by_user) override;
+ scoped_ptr<ui::MenuModel> CreateMenuModel(
const NotifierId& notifier_id,
- const base::string16& display_source) OVERRIDE;
- virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE;
- virtual void ClickOnNotificationButton(const std::string& notification_id,
- int button_index) OVERRIDE;
- virtual void ExpandNotification(const std::string& notification_id) OVERRIDE;
+ const base::string16& display_source) override;
+ bool HasClickedListener(const std::string& notification_id) override;
+ void ClickOnNotificationButton(const std::string& notification_id,
+ int button_index) override;
// Overridden from MockNotificationView::Test
- virtual void RegisterCall(CallType type) OVERRIDE;
+ void RegisterCall(CallType type) override;
void LogBounds(int depth, views::View* view);
notifications.insert(¬ification);
// Then create a new MessageCenterView with that single notification.
+ base::string16 title;
message_center_view_.reset(new MessageCenterView(
- &message_center_, NULL, 100, false, /*top_down =*/false));
+ &message_center_, NULL, 100, false, /*top_down =*/false, title));
message_center_view_->SetNotifications(notifications);
// Remove and delete the NotificationView now owned by the MessageCenterView's
NOTREACHED();
}
-void MessageCenterViewTest::ExpandNotification(
- const std::string& notification_id) {
- // For this test, this method should not be invoked.
- NOTREACHED();
-}
-
void MessageCenterViewTest::RegisterCall(CallType type) {
callCounts_[type] += 1;
}