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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 2897553002: Do not activate TrayBubbleView by default (Closed)
Patch Set: Add comment. Created 3 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accessibility_delegate.h"
7 #include "ash/resources/vector_icons/vector_icons.h" 9 #include "ash/resources/vector_icons/vector_icons.h"
8 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
9 #include "ash/session/session_controller.h" 11 #include "ash/session/session_controller.h"
10 #include "ash/shelf/shelf.h" 12 #include "ash/shelf/shelf.h"
11 #include "ash/shelf/shelf_constants.h" 13 #include "ash/shelf/shelf_constants.h"
12 #include "ash/shell.h" 14 #include "ash/shell.h"
13 #include "ash/system/status_area_widget.h" 15 #include "ash/system/status_area_widget.h"
14 #include "ash/system/tray/system_tray.h" 16 #include "ash/system/tray/system_tray.h"
15 #include "ash/system/tray/system_tray_delegate.h" 17 #include "ash/system/tray/system_tray_delegate.h"
16 #include "ash/system/tray/tray_bubble_wrapper.h" 18 #include "ash/system/tray/tray_bubble_wrapper.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 if (message_center_bubble()) { 423 if (message_center_bubble()) {
422 message_center_bubble()->bubble_view()->UpdateBubble(); 424 message_center_bubble()->bubble_view()->UpdateBubble();
423 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); 425 UpdateBubbleViewArrow(message_center_bubble()->bubble_view());
424 } 426 }
425 } 427 }
426 428
427 base::string16 WebNotificationTray::GetAccessibleNameForTray() { 429 base::string16 WebNotificationTray::GetAccessibleNameForTray() {
428 return l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_ACCESSIBLE_NAME); 430 return l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_ACCESSIBLE_NAME);
429 } 431 }
430 432
433 bool WebNotificationTray::ShouldEnableExtraKeyboardAccessibility() {
James Cook 2017/06/09 16:06:13 nit: functions in .cc should match order in header
yawano 2017/06/12 09:11:03 Done.
434 return Shell::Get()->accessibility_delegate()->IsSpokenFeedbackEnabled();
435 }
436
431 void WebNotificationTray::HideBubbleWithView( 437 void WebNotificationTray::HideBubbleWithView(
432 const views::TrayBubbleView* bubble_view) { 438 const views::TrayBubbleView* bubble_view) {
433 if (message_center_bubble() && 439 if (message_center_bubble() &&
434 bubble_view == message_center_bubble()->bubble_view()) { 440 bubble_view == message_center_bubble()->bubble_view()) {
435 message_center_tray_->HideMessageCenterBubble(); 441 message_center_tray_->HideMessageCenterBubble();
436 } else if (popup_collection_.get()) { 442 } else if (popup_collection_.get()) {
437 message_center_tray_->HidePopupBubble(); 443 message_center_tray_->HidePopupBubble();
438 } 444 }
439 } 445 }
440 446
441 bool WebNotificationTray::PerformAction(const ui::Event& event) { 447 bool WebNotificationTray::PerformAction(const ui::Event& event) {
442 if (message_center_bubble()) 448 if (message_center_bubble())
443 message_center_tray_->HideMessageCenterBubble(); 449 message_center_tray_->HideMessageCenterBubble();
444 else 450 else
445 message_center_tray_->ShowMessageCenterBubble(); 451 message_center_tray_->ShowMessageCenterBubble();
446 return true; 452 return true;
447 } 453 }
448 454
449 void WebNotificationTray::BubbleViewDestroyed() { 455 void WebNotificationTray::BubbleViewDestroyed() {
450 if (message_center_bubble()) 456 if (message_center_bubble())
451 message_center_bubble()->bubble()->BubbleViewDestroyed(); 457 message_center_bubble()->bubble()->BubbleViewDestroyed();
452 } 458 }
453 459
454 void WebNotificationTray::OnMouseEnteredView() {} 460 void WebNotificationTray::OnMouseEnteredView() {}
455 461
456 void WebNotificationTray::OnMouseExitedView() {} 462 void WebNotificationTray::OnMouseExitedView() {}
457 463
464 void WebNotificationTray::RegisterAccelerators(
465 const std::vector<ui::Accelerator>& accelerators,
466 views::TrayBubbleView* tray_bubble_view) {
467 Shell::Get()->accelerator_controller()->Register(accelerators,
468 tray_bubble_view);
469 }
470
471 void WebNotificationTray::UnregisterAllAccelerators(
472 views::TrayBubbleView* tray_bubble_view) {
473 Shell::Get()->accelerator_controller()->UnregisterAll(tray_bubble_view);
474 }
475
458 base::string16 WebNotificationTray::GetAccessibleNameForBubble() { 476 base::string16 WebNotificationTray::GetAccessibleNameForBubble() {
459 return GetAccessibleNameForTray(); 477 return GetAccessibleNameForTray();
460 } 478 }
461 479
462 void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) { 480 void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) {
463 HideBubbleWithView(bubble_view); 481 HideBubbleWithView(bubble_view);
464 } 482 }
465 483
466 bool WebNotificationTray::ShowNotifierSettings() { 484 bool WebNotificationTray::ShowNotifierSettings() {
467 if (message_center_bubble()) { 485 if (message_center_bubble()) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 616
599 message_center::MessageCenterBubble* 617 message_center::MessageCenterBubble*
600 WebNotificationTray::GetMessageCenterBubbleForTest() { 618 WebNotificationTray::GetMessageCenterBubbleForTest() {
601 if (!message_center_bubble()) 619 if (!message_center_bubble())
602 return nullptr; 620 return nullptr;
603 return static_cast<message_center::MessageCenterBubble*>( 621 return static_cast<message_center::MessageCenterBubble*>(
604 message_center_bubble()->bubble()); 622 message_center_bubble()->bubble());
605 } 623 }
606 624
607 } // namespace ash 625 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698