Chromium Code Reviews| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 | 521 |
| 522 if (is_locked_) | 522 if (is_locked_) |
| 523 SetVisibilityMode(Mode::BUTTONS_ONLY, animate); | 523 SetVisibilityMode(Mode::BUTTONS_ONLY, animate); |
| 524 else if (settings_visible_) | 524 else if (settings_visible_) |
| 525 SetVisibilityMode(Mode::SETTINGS, animate); | 525 SetVisibilityMode(Mode::SETTINGS, animate); |
| 526 else if (no_message_views) | 526 else if (no_message_views) |
| 527 SetVisibilityMode(Mode::BUTTONS_ONLY, animate); | 527 SetVisibilityMode(Mode::BUTTONS_ONLY, animate); |
| 528 else | 528 else |
| 529 SetVisibilityMode(Mode::NOTIFICATIONS, animate); | 529 SetVisibilityMode(Mode::NOTIFICATIONS, animate); |
| 530 | 530 |
| 531 if (no_message_views) { | |
| 532 scroller_->SetFocusBehavior(FocusBehavior::NEVER); | |
|
David Tseng
2016/08/12 18:11:05
Future note to xiyuan@
making this
+ scroller_-
| |
| 533 } else { | |
| 534 #if defined(OS_MACOSX) | |
| 535 scroller_->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); | |
| 536 #else | |
| 537 scroller_->SetFocusBehavior(FocusBehavior::ALWAYS); | |
| 538 #endif | |
| 539 } | |
| 540 | |
| 531 UpdateButtonBarStatus(); | 541 UpdateButtonBarStatus(); |
| 532 | 542 |
| 533 if (focus_manager && focused_view) | 543 if (focus_manager && focused_view) |
| 534 focus_manager->SetFocusedView(focused_view); | 544 focus_manager->SetFocusedView(focused_view); |
| 535 | 545 |
| 536 if (scroller_->visible()) | 546 if (scroller_->visible()) |
| 537 scroller_->InvalidateLayout(); | 547 scroller_->InvalidateLayout(); |
| 538 PreferredSizeChanged(); | 548 PreferredSizeChanged(); |
| 539 Layout(); | 549 Layout(); |
| 540 } | 550 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 // Disable the close-all button since no notification is visible. | 633 // Disable the close-all button since no notification is visible. |
| 624 button_bar_->SetCloseAllButtonEnabled(false); | 634 button_bar_->SetCloseAllButtonEnabled(false); |
| 625 } | 635 } |
| 626 } | 636 } |
| 627 | 637 |
| 628 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 638 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 629 message_list_view_->AddNotificationAt(view, 0); | 639 message_list_view_->AddNotificationAt(view, 0); |
| 630 } | 640 } |
| 631 | 641 |
| 632 } // namespace message_center | 642 } // namespace message_center |
| OLD | NEW |