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

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

Issue 1914793002: WIP: PointerWatcher for systray bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eventobserver
Patch Set: rebase 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) 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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 ->session_state_delegate() 450 ->session_state_delegate()
451 ->IsInSecondaryLoginScreen(); 451 ->IsInSecondaryLoginScreen();
452 452
453 SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) && 453 SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) &&
454 (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) && 454 (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) &&
455 !userAddingRunning && (message_center->NotificationCount() > 0)); 455 !userAddingRunning && (message_center->NotificationCount() > 0));
456 Layout(); 456 Layout();
457 SchedulePaint(); 457 SchedulePaint();
458 } 458 }
459 459
460 bool WebNotificationTray::ClickedOutsideBubble() { 460 void WebNotificationTray::ClickedOutsideBubble() {
461 // Only hide the message center 461 // Only hide the message center
462 if (!message_center_bubble()) 462 if (!message_center_bubble())
463 return false; 463 return;
464 464
465 message_center_tray_->HideMessageCenterBubble(); 465 message_center_tray_->HideMessageCenterBubble();
466 return true;
467 } 466 }
468 467
469 message_center::MessageCenter* WebNotificationTray::message_center() const { 468 message_center::MessageCenter* WebNotificationTray::message_center() const {
470 return message_center_tray_->message_center(); 469 return message_center_tray_->message_center();
471 } 470 }
472 471
473 // Methods for testing 472 // Methods for testing
474 473
475 bool WebNotificationTray::IsPopupVisible() const { 474 bool WebNotificationTray::IsPopupVisible() const {
476 return message_center_tray_->popups_visible(); 475 return message_center_tray_->popups_visible();
477 } 476 }
478 477
479 message_center::MessageCenterBubble* 478 message_center::MessageCenterBubble*
480 WebNotificationTray::GetMessageCenterBubbleForTest() { 479 WebNotificationTray::GetMessageCenterBubbleForTest() {
481 if (!message_center_bubble()) 480 if (!message_center_bubble())
482 return NULL; 481 return NULL;
483 return static_cast<message_center::MessageCenterBubble*>( 482 return static_cast<message_center::MessageCenterBubble*>(
484 message_center_bubble()->bubble()); 483 message_center_bubble()->bubble());
485 } 484 }
486 485
487 } // namespace ash 486 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698