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

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

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_->SetFocusable(!no_message_views); 604
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 }
605 614
606 if (focus_manager && focused_view) 615 if (focus_manager && focused_view)
607 focus_manager->SetFocusedView(focused_view); 616 focus_manager->SetFocusedView(focused_view);
608 617
609 scroller_->InvalidateLayout(); 618 scroller_->InvalidateLayout();
610 PreferredSizeChanged(); 619 PreferredSizeChanged();
611 Layout(); 620 Layout();
612 } 621 }
613 622
614 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 623 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
615 message_list_view_->AddNotificationAt(view, 0); 624 message_list_view_->AddNotificationAt(view, 0);
616 } 625 }
617 626
618 } // namespace message_center 627 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698