| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 gfx::Point current_point = (*current)->bounds().origin(); | 172 gfx::Point current_point = (*current)->bounds().origin(); |
| 173 views::View::ConvertPointToTarget( | 173 views::View::ConvertPointToTarget( |
| 174 (*current), notification_view(), ¤t_point); | 174 (*current), notification_view(), ¤t_point); |
| 175 | 175 |
| 176 EXPECT_LT(last_point.y(), current_point.y()); | 176 EXPECT_LT(last_point.y(), current_point.y()); |
| 177 last = current++; | 177 last = current++; |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 views::ImageButton* GetCloseButton() { | 181 views::ImageButton* GetCloseButton() { |
| 182 return notification_view()->close_button_.get(); | 182 return notification_view()->close_button(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void UpdateNotificationViews() { | 185 void UpdateNotificationViews() { |
| 186 notification_view()->CreateOrUpdateViews(*notification()); | 186 notification_view()->UpdateWithNotification(*notification()); |
| 187 notification_view()->Layout(); | |
| 188 } | 187 } |
| 189 | 188 |
| 190 float GetNotificationScrollAmount() const { | 189 float GetNotificationScrollAmount() const { |
| 191 return notification_view()->GetTransform().To2dTranslation().x(); | 190 return notification_view()->GetTransform().To2dTranslation().x(); |
| 192 } | 191 } |
| 193 | 192 |
| 194 bool IsRemoved(const std::string& notification_id) const { | 193 bool IsRemoved(const std::string& notification_id) const { |
| 195 return (removed_ids_.find(notification_id) != removed_ids_.end()); | 194 return (removed_ids_.find(notification_id) != removed_ids_.end()); |
| 196 } | 195 } |
| 197 | 196 |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 TEST_F(NotificationViewTest, Pinned) { | 700 TEST_F(NotificationViewTest, Pinned) { |
| 702 notification()->set_pinned(true); | 701 notification()->set_pinned(true); |
| 703 | 702 |
| 704 UpdateNotificationViews(); | 703 UpdateNotificationViews(); |
| 705 EXPECT_EQ(NULL, GetCloseButton()); | 704 EXPECT_EQ(NULL, GetCloseButton()); |
| 706 } | 705 } |
| 707 | 706 |
| 708 #endif // defined(OS_CHROMEOS) | 707 #endif // defined(OS_CHROMEOS) |
| 709 | 708 |
| 710 } // namespace message_center | 709 } // namespace message_center |
| OLD | NEW |