| 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); | |
| 533 } else { | |
| 534 #if defined(OS_MACOSX) | |
| 535 scroller_->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); | |
| 536 #else | |
| 537 scroller_->SetFocusBehavior(FocusBehavior::ALWAYS); | |
| 538 #endif | |
| 539 } | |
| 540 | |
| 541 UpdateButtonBarStatus(); | 531 UpdateButtonBarStatus(); |
| 542 | 532 |
| 543 if (focus_manager && focused_view) | 533 if (focus_manager && focused_view) |
| 544 focus_manager->SetFocusedView(focused_view); | 534 focus_manager->SetFocusedView(focused_view); |
| 545 | 535 |
| 546 if (scroller_->visible()) | 536 if (scroller_->visible()) |
| 547 scroller_->InvalidateLayout(); | 537 scroller_->InvalidateLayout(); |
| 548 PreferredSizeChanged(); | 538 PreferredSizeChanged(); |
| 549 Layout(); | 539 Layout(); |
| 550 } | 540 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 // Disable the close-all button since no notification is visible. | 623 // Disable the close-all button since no notification is visible. |
| 634 button_bar_->SetCloseAllButtonEnabled(false); | 624 button_bar_->SetCloseAllButtonEnabled(false); |
| 635 } | 625 } |
| 636 } | 626 } |
| 637 | 627 |
| 638 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 628 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 639 message_list_view_->AddNotificationAt(view, 0); | 629 message_list_view_->AddNotificationAt(view, 0); |
| 640 } | 630 } |
| 641 | 631 |
| 642 } // namespace message_center | 632 } // namespace message_center |
| OLD | NEW |