OLD | NEW |
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 no_message_views ? empty_list_view_.get() : message_list_view_.get()); | 594 no_message_views ? empty_list_view_.get() : message_list_view_.get()); |
595 | 595 |
596 bool no_closable_views = true; | 596 bool no_closable_views = true; |
597 for (const auto& view : notification_views_) { | 597 for (const auto& view : notification_views_) { |
598 if (!view.second->IsPinned()) { | 598 if (!view.second->IsPinned()) { |
599 no_closable_views = false; | 599 no_closable_views = false; |
600 break; | 600 break; |
601 } | 601 } |
602 } | 602 } |
603 button_bar_->SetCloseAllButtonEnabled(!no_closable_views); | 603 button_bar_->SetCloseAllButtonEnabled(!no_closable_views); |
604 scroller_->SetFocusBehavior(no_message_views ? FocusBehavior::NEVER | 604 |
605 : FocusBehavior::ALWAYS); | 605 if (no_message_views) { |
| 606 scroller_->SetFocusBehavior(FocusBehavior::NEVER); |
| 607 } else { |
| 608 #if defined(OS_MACOSX) |
| 609 scroller_->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 610 #else |
| 611 scroller_->SetFocusBehavior(FocusBehavior::ALWAYS); |
| 612 #endif |
| 613 } |
606 | 614 |
607 if (focus_manager && focused_view) | 615 if (focus_manager && focused_view) |
608 focus_manager->SetFocusedView(focused_view); | 616 focus_manager->SetFocusedView(focused_view); |
609 | 617 |
610 scroller_->InvalidateLayout(); | 618 scroller_->InvalidateLayout(); |
611 PreferredSizeChanged(); | 619 PreferredSizeChanged(); |
612 Layout(); | 620 Layout(); |
613 } | 621 } |
614 | 622 |
615 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 623 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
616 message_list_view_->AddNotificationAt(view, 0); | 624 message_list_view_->AddNotificationAt(view, 0); |
617 } | 625 } |
618 | 626 |
619 } // namespace message_center | 627 } // namespace message_center |
OLD | NEW |