Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/message_center/views/notification_view_unittest.cc

Issue 1980753002: Move close button to MessageView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-messageview
Patch Set: move CreateOrUpdateCloseButtonView Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(), &current_point); 174 (*current), notification_view(), &current_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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698