| 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/status_area_widget.h" | 5 #include "ash/system/status_area_widget.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // hierarchy. Do not used scoped pointers since we don't want to destroy them | 69 // hierarchy. Do not used scoped pointers since we don't want to destroy them |
| 70 // in the destructor if Shutdown() is not called (e.g. in tests). | 70 // in the destructor if Shutdown() is not called (e.g. in tests). |
| 71 delete logout_button_tray_; | 71 delete logout_button_tray_; |
| 72 logout_button_tray_ = NULL; | 72 logout_button_tray_ = NULL; |
| 73 delete web_notification_tray_; | 73 delete web_notification_tray_; |
| 74 web_notification_tray_ = NULL; | 74 web_notification_tray_ = NULL; |
| 75 delete system_tray_; | 75 delete system_tray_; |
| 76 system_tray_ = NULL; | 76 system_tray_ = NULL; |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool StatusAreaWidget::ShouldShowLauncher() const { | 79 bool StatusAreaWidget::ShouldShowShelf() const { |
| 80 if ((system_tray_ && system_tray_->ShouldShowLauncher()) || | 80 if ((system_tray_ && system_tray_->ShouldShowShelf()) || |
| 81 (web_notification_tray_ && | 81 (web_notification_tray_ && |
| 82 web_notification_tray_->ShouldBlockLauncherAutoHide())) | 82 web_notification_tray_->ShouldBlockShelfAutoHide())) |
| 83 return true; | 83 return true; |
| 84 | 84 |
| 85 if (!RootWindowController::ForLauncher(GetNativeView())->shelf()->IsVisible()) | 85 if (!RootWindowController::ForShelf(GetNativeView())->shelf()->IsVisible()) |
| 86 return false; | 86 return false; |
| 87 | 87 |
| 88 // If the launcher is currently visible, don't hide the launcher if the mouse | 88 // If the shelf is currently visible, don't hide the shelf if the mouse |
| 89 // is in any of the notification bubbles. | 89 // is in any of the notification bubbles. |
| 90 return (system_tray_ && system_tray_->IsMouseInNotificationBubble()) || | 90 return (system_tray_ && system_tray_->IsMouseInNotificationBubble()) || |
| 91 (web_notification_tray_ && | 91 (web_notification_tray_ && |
| 92 web_notification_tray_->IsMouseInNotificationBubble()); | 92 web_notification_tray_->IsMouseInNotificationBubble()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool StatusAreaWidget::IsMessageBubbleShown() const { | 95 bool StatusAreaWidget::IsMessageBubbleShown() const { |
| 96 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || | 96 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || |
| 97 (web_notification_tray_ && | 97 (web_notification_tray_ && |
| 98 web_notification_tray_->IsMessageCenterBubbleVisible())); | 98 web_notification_tray_->IsMessageCenterBubbleVisible())); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (system_tray_) | 143 if (system_tray_) |
| 144 system_tray_->UpdateAfterLoginStatusChange(login_status); | 144 system_tray_->UpdateAfterLoginStatusChange(login_status); |
| 145 if (web_notification_tray_) | 145 if (web_notification_tray_) |
| 146 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 146 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
| 147 if (logout_button_tray_) | 147 if (logout_button_tray_) |
| 148 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 148 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace internal | 151 } // namespace internal |
| 152 } // namespace ash | 152 } // namespace ash |
| OLD | NEW |