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

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

Issue 2595163002: Add origin() method on View and use it to simplify some callers. (Closed)
Patch Set: Resync Created 3 years, 11 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/message_list_view.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | 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/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void CheckVerticalOrderInNotification() { 160 void CheckVerticalOrderInNotification() {
161 std::vector<views::View*> vertical_order; 161 std::vector<views::View*> vertical_order;
162 vertical_order.push_back(notification_view()->top_view_); 162 vertical_order.push_back(notification_view()->top_view_);
163 vertical_order.push_back(notification_view()->image_view_); 163 vertical_order.push_back(notification_view()->image_view_);
164 std::copy(notification_view()->action_buttons_.begin(), 164 std::copy(notification_view()->action_buttons_.begin(),
165 notification_view()->action_buttons_.end(), 165 notification_view()->action_buttons_.end(),
166 std::back_inserter(vertical_order)); 166 std::back_inserter(vertical_order));
167 std::vector<views::View*>::iterator current = vertical_order.begin(); 167 std::vector<views::View*>::iterator current = vertical_order.begin();
168 std::vector<views::View*>::iterator last = current++; 168 std::vector<views::View*>::iterator last = current++;
169 while (current != vertical_order.end()) { 169 while (current != vertical_order.end()) {
170 gfx::Point last_point = (*last)->bounds().origin(); 170 gfx::Point last_point = (*last)->origin();
171 views::View::ConvertPointToTarget( 171 views::View::ConvertPointToTarget(
172 (*last), notification_view(), &last_point); 172 (*last), notification_view(), &last_point);
173 173
174 gfx::Point current_point = (*current)->bounds().origin(); 174 gfx::Point current_point = (*current)->origin();
175 views::View::ConvertPointToTarget( 175 views::View::ConvertPointToTarget(
176 (*current), notification_view(), &current_point); 176 (*current), notification_view(), &current_point);
177 177
178 EXPECT_LT(last_point.y(), current_point.y()); 178 EXPECT_LT(last_point.y(), current_point.y());
179 last = current++; 179 last = current++;
180 } 180 }
181 } 181 }
182 182
183 views::ImageButton* GetCloseButton() { 183 views::ImageButton* GetCloseButton() {
184 return notification_view()->close_button(); 184 return notification_view()->close_button();
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 TEST_F(NotificationViewTest, Pinned) { 704 TEST_F(NotificationViewTest, Pinned) {
705 notification()->set_pinned(true); 705 notification()->set_pinned(true);
706 706
707 UpdateNotificationViews(); 707 UpdateNotificationViews();
708 EXPECT_EQ(NULL, GetCloseButton()); 708 EXPECT_EQ(NULL, GetCloseButton());
709 } 709 }
710 710
711 #endif // defined(OS_CHROMEOS) 711 #endif // defined(OS_CHROMEOS)
712 712
713 } // namespace message_center 713 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/message_list_view.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698