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

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

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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/chromeos/ime/infolist_window.cc ('k') | ui/message_center/views/message_list_view.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 bool is_scrollable = false; 231 bool is_scrollable = false;
232 if (scroller_->visible()) 232 if (scroller_->visible())
233 is_scrollable = scroller_->height() < message_list_view_->height(); 233 is_scrollable = scroller_->height() < message_list_view_->height();
234 else if (settings_view_->visible()) 234 else if (settings_view_->visible())
235 is_scrollable = settings_view_->IsScrollable(); 235 is_scrollable = settings_view_->IsScrollable();
236 236
237 if (!animating) { 237 if (!animating) {
238 if (is_scrollable) { 238 if (is_scrollable) {
239 // Draw separator line on the top of the button bar if it is on the bottom 239 // Draw separator line on the top of the button bar if it is on the bottom
240 // or draw it at the bottom if the bar is on the top. 240 // or draw it at the bottom if the bar is on the top.
241 button_bar_->SetBorder(views::Border::CreateSolidSidedBorder( 241 button_bar_->SetBorder(views::CreateSolidSidedBorder(
242 top_down_ ? 0 : 1, 0, top_down_ ? 1 : 0, 0, kFooterDelimiterColor)); 242 top_down_ ? 0 : 1, 0, top_down_ ? 1 : 0, 0, kFooterDelimiterColor));
243 } else { 243 } else {
244 button_bar_->SetBorder(views::Border::CreateEmptyBorder( 244 button_bar_->SetBorder(
245 top_down_ ? 0 : 1, 0, top_down_ ? 1 : 0, 0)); 245 views::CreateEmptyBorder(top_down_ ? 0 : 1, 0, top_down_ ? 1 : 0, 0));
246 } 246 }
247 button_bar_->SchedulePaint(); 247 button_bar_->SchedulePaint();
248 } 248 }
249 button_bar_->SetBounds(0, 249 button_bar_->SetBounds(0,
250 top_down_ ? 0 : height() - button_height, 250 top_down_ ? 0 : height() - button_height,
251 width(), 251 width(),
252 button_height); 252 button_height);
253 if (GetWidget()) 253 if (GetWidget())
254 GetWidget()->GetRootView()->SchedulePaint(); 254 GetWidget()->GetRootView()->SchedulePaint();
255 } 255 }
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // Disable the close-all button since no notification is visible. 639 // Disable the close-all button since no notification is visible.
640 button_bar_->SetCloseAllButtonEnabled(false); 640 button_bar_->SetCloseAllButtonEnabled(false);
641 } 641 }
642 } 642 }
643 643
644 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 644 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
645 message_list_view_->AddNotificationAt(view, 0); 645 message_list_view_->AddNotificationAt(view, 0);
646 } 646 }
647 647
648 } // namespace message_center 648 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/chromeos/ime/infolist_window.cc ('k') | ui/message_center/views/message_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698