OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/message_center/views/message_center_view.h" | 5 #include "ui/message_center/views/message_center_view.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 message_center::RichNotificationData(), nullptr); | 208 message_center::RichNotificationData(), nullptr); |
209 | 209 |
210 // ...and a list for it. | 210 // ...and a list for it. |
211 notifications_[std::string(kNotificationId1)] = std::move(notification1); | 211 notifications_[std::string(kNotificationId1)] = std::move(notification1); |
212 notifications_[std::string(kNotificationId2)] = std::move(notification2); | 212 notifications_[std::string(kNotificationId2)] = std::move(notification2); |
213 NotificationList::Notifications notifications = Notifications(); | 213 NotificationList::Notifications notifications = Notifications(); |
214 message_center_->SetVisibleNotifications(notifications); | 214 message_center_->SetVisibleNotifications(notifications); |
215 | 215 |
216 // Then create a new MessageCenterView with that single notification. | 216 // Then create a new MessageCenterView with that single notification. |
217 message_center_view_.reset(new MessageCenterView( | 217 message_center_view_.reset(new MessageCenterView( |
218 message_center_.get(), NULL, 100, false, /*top_down =*/false)); | 218 message_center_.get(), NULL, 100, false)); |
219 GetMessageListView()->quit_message_loop_after_animation_for_test_ = true; | 219 GetMessageListView()->quit_message_loop_after_animation_for_test_ = true; |
220 GetMessageCenterView()->SetBounds(0, 0, 380, 600); | 220 GetMessageCenterView()->SetBounds(0, 0, 380, 600); |
221 message_center_view_->SetNotifications(notifications); | 221 message_center_view_->SetNotifications(notifications); |
222 message_center_view_->set_owned_by_client(); | 222 message_center_view_->set_owned_by_client(); |
223 | 223 |
224 widget_.reset(new views::Widget()); | 224 widget_.reset(new views::Widget()); |
225 views::Widget::InitParams params = | 225 views::Widget::InitParams params = |
226 CreateParams(views::Widget::InitParams::TYPE_POPUP); | 226 CreateParams(views::Widget::InitParams::TYPE_POPUP); |
227 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 227 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
228 params.bounds = gfx::Rect(50, 50, 650, 650); | 228 params.bounds = gfx::Rect(50, 50, 650, 650); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 base::UTF8ToUTF16("title1"), base::UTF8ToUTF16("message"), gfx::Image(), | 819 base::UTF8ToUTF16("title1"), base::UTF8ToUTF16("message"), gfx::Image(), |
820 base::UTF8ToUTF16("display source"), GURL(), | 820 base::UTF8ToUTF16("display source"), GURL(), |
821 NotifierId(NotifierId::APPLICATION, "extension_id"), | 821 NotifierId(NotifierId::APPLICATION, "extension_id"), |
822 message_center::RichNotificationData(), nullptr)); | 822 message_center::RichNotificationData(), nullptr)); |
823 | 823 |
824 GetMessageCenterView()->SizeToPreferredSize(); | 824 GetMessageCenterView()->SizeToPreferredSize(); |
825 EXPECT_NE(kEmptyMessageCenterViewHeight, GetMessageCenterView()->height()); | 825 EXPECT_NE(kEmptyMessageCenterViewHeight, GetMessageCenterView()->height()); |
826 } | 826 } |
827 | 827 |
828 } // namespace message_center | 828 } // namespace message_center |
OLD | NEW |