| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/notification_view.h" | 5 #include "ui/message_center/views/notification_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 notification_.reset(new Notification( | 221 notification_.reset(new Notification( |
| 222 NOTIFICATION_TYPE_BASE_FORMAT, std::string("notification id"), | 222 NOTIFICATION_TYPE_BASE_FORMAT, std::string("notification id"), |
| 223 base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), | 223 base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), |
| 224 CreateTestImage(80, 80), base::UTF8ToUTF16("display source"), GURL(), | 224 CreateTestImage(80, 80), base::UTF8ToUTF16("display source"), GURL(), |
| 225 NotifierId(NotifierId::APPLICATION, "extension_id"), *data_, | 225 NotifierId(NotifierId::APPLICATION, "extension_id"), *data_, |
| 226 NULL)); | 226 NULL)); |
| 227 notification_->set_small_image(CreateTestImage(16, 16)); | 227 notification_->set_small_image(CreateTestImage(16, 16)); |
| 228 notification_->set_image(CreateTestImage(320, 240)); | 228 notification_->set_image(CreateTestImage(320, 240)); |
| 229 | 229 |
| 230 // Then create a new NotificationView with that single notification. | 230 // Then create a new NotificationView with that single notification. |
| 231 notification_view_.reset( | 231 notification_view_.reset(static_cast<NotificationView*>( |
| 232 NotificationView::Create(this, *notification_, true)); | 232 NotificationView::Create(this, *notification_, true))); |
| 233 notification_view_->set_owned_by_client(); | 233 notification_view_->set_owned_by_client(); |
| 234 | 234 |
| 235 views::Widget::InitParams init_params( | 235 views::Widget::InitParams init_params( |
| 236 CreateParams(views::Widget::InitParams::TYPE_POPUP)); | 236 CreateParams(views::Widget::InitParams::TYPE_POPUP)); |
| 237 views::Widget* widget = new views::Widget(); | 237 views::Widget* widget = new views::Widget(); |
| 238 widget->Init(init_params); | 238 widget->Init(init_params); |
| 239 widget->SetContentsView(notification_view_.get()); | 239 widget->SetContentsView(notification_view_.get()); |
| 240 widget->SetSize(notification_view_->GetPreferredSize()); | 240 widget->SetSize(notification_view_->GetPreferredSize()); |
| 241 } | 241 } |
| 242 | 242 |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 TEST_F(NotificationViewTest, Pinned) { | 701 TEST_F(NotificationViewTest, Pinned) { |
| 702 notification()->set_pinned(true); | 702 notification()->set_pinned(true); |
| 703 | 703 |
| 704 UpdateNotificationViews(); | 704 UpdateNotificationViews(); |
| 705 EXPECT_EQ(NULL, GetCloseButton()); | 705 EXPECT_EQ(NULL, GetCloseButton()); |
| 706 } | 706 } |
| 707 | 707 |
| 708 #endif // defined(OS_CHROMEOS) | 708 #endif // defined(OS_CHROMEOS) |
| 709 | 709 |
| 710 } // namespace message_center | 710 } // namespace message_center |
| OLD | NEW |