OLD | NEW |
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 internal::kShellWindowId_StatusContainer), | 409 internal::kShellWindowId_StatusContainer), |
410 message_center(), | 410 message_center(), |
411 message_center_tray_.get(), | 411 message_center_tray_.get(), |
412 ash::switches::UseAlternateShelfLayout())); | 412 ash::switches::UseAlternateShelfLayout())); |
413 work_area_observer_->StartObserving( | 413 work_area_observer_->StartObserving( |
414 popup_collection_.get(), GetWidget()->GetNativeView()->GetRootWindow()); | 414 popup_collection_.get(), GetWidget()->GetNativeView()->GetRootWindow()); |
415 return true; | 415 return true; |
416 } | 416 } |
417 | 417 |
418 void WebNotificationTray::HidePopups() { | 418 void WebNotificationTray::HidePopups() { |
| 419 DCHECK(popup_collection_.get()); |
| 420 |
| 421 popup_collection_->MarkAllPopupsShown(); |
419 popup_collection_.reset(); | 422 popup_collection_.reset(); |
420 work_area_observer_->StopObserving(); | 423 work_area_observer_->StopObserving(); |
421 } | 424 } |
422 | 425 |
423 // Private methods. | 426 // Private methods. |
424 | 427 |
425 bool WebNotificationTray::ShouldShowMessageCenter() { | 428 bool WebNotificationTray::ShouldShowMessageCenter() { |
426 return status_area_widget()->login_status() != user::LOGGED_IN_LOCKED && | 429 return status_area_widget()->login_status() != user::LOGGED_IN_LOCKED && |
427 !(status_area_widget()->system_tray() && | 430 !(status_area_widget()->system_tray() && |
428 status_area_widget()->system_tray()->HasNotificationBubble()); | 431 status_area_widget()->system_tray()->HasNotificationBubble()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 615 |
613 message_center::MessageCenterBubble* | 616 message_center::MessageCenterBubble* |
614 WebNotificationTray::GetMessageCenterBubbleForTest() { | 617 WebNotificationTray::GetMessageCenterBubbleForTest() { |
615 if (!message_center_bubble()) | 618 if (!message_center_bubble()) |
616 return NULL; | 619 return NULL; |
617 return static_cast<message_center::MessageCenterBubble*>( | 620 return static_cast<message_center::MessageCenterBubble*>( |
618 message_center_bubble()->bubble()); | 621 message_center_bubble()->bubble()); |
619 } | 622 } |
620 | 623 |
621 } // namespace ash | 624 } // namespace ash |
OLD | NEW |