| 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/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/metrics/user_metrics_recorder.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 (*it)->UpdateAfterShelfAlignmentChange(alignment); | 335 (*it)->UpdateAfterShelfAlignmentChange(alignment); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 void SystemTray::SetHideNotifications(bool hide_notifications) { | 339 void SystemTray::SetHideNotifications(bool hide_notifications) { |
| 340 if (notification_bubble_) | 340 if (notification_bubble_) |
| 341 notification_bubble_->bubble()->SetVisible(!hide_notifications); | 341 notification_bubble_->bubble()->SetVisible(!hide_notifications); |
| 342 hide_notifications_ = hide_notifications; | 342 hide_notifications_ = hide_notifications; |
| 343 } | 343 } |
| 344 | 344 |
| 345 bool SystemTray::ShouldShowLauncher() const { | 345 bool SystemTray::ShouldShowShelf() const { |
| 346 return system_bubble_.get() && system_bubble_->bubble()->ShouldShowLauncher(); | 346 return system_bubble_.get() && system_bubble_->bubble()->ShouldShowShelf(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 bool SystemTray::HasSystemBubble() const { | 349 bool SystemTray::HasSystemBubble() const { |
| 350 return system_bubble_.get() != NULL; | 350 return system_bubble_.get() != NULL; |
| 351 } | 351 } |
| 352 | 352 |
| 353 bool SystemTray::HasNotificationBubble() const { | 353 bool SystemTray::HasNotificationBubble() const { |
| 354 return notification_bubble_.get() != NULL; | 354 return notification_bubble_.get() != NULL; |
| 355 } | 355 } |
| 356 | 356 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 // Rebuild any notification bubble. | 611 // Rebuild any notification bubble. |
| 612 if (notification_bubble_) { | 612 if (notification_bubble_) { |
| 613 notification_bubble_.reset(); | 613 notification_bubble_.reset(); |
| 614 UpdateNotificationBubble(); | 614 UpdateNotificationBubble(); |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 | 617 |
| 618 void SystemTray::AnchorUpdated() { | 618 void SystemTray::AnchorUpdated() { |
| 619 if (notification_bubble_) { | 619 if (notification_bubble_) { |
| 620 notification_bubble_->bubble_view()->UpdateBubble(); | 620 notification_bubble_->bubble_view()->UpdateBubble(); |
| 621 // Ensure that the notification buble is above the launcher/status area. | 621 // Ensure that the notification buble is above the shelf/status area. |
| 622 notification_bubble_->bubble_view()->GetWidget()->StackAtTop(); | 622 notification_bubble_->bubble_view()->GetWidget()->StackAtTop(); |
| 623 UpdateBubbleViewArrow(notification_bubble_->bubble_view()); | 623 UpdateBubbleViewArrow(notification_bubble_->bubble_view()); |
| 624 } | 624 } |
| 625 if (system_bubble_) { | 625 if (system_bubble_) { |
| 626 system_bubble_->bubble_view()->UpdateBubble(); | 626 system_bubble_->bubble_view()->UpdateBubble(); |
| 627 UpdateBubbleViewArrow(system_bubble_->bubble_view()); | 627 UpdateBubbleViewArrow(system_bubble_->bubble_view()); |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 | 630 |
| 631 base::string16 SystemTray::GetAccessibleNameForTray() { | 631 base::string16 SystemTray::GetAccessibleNameForTray() { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 system_bubble_.reset(); | 723 system_bubble_.reset(); |
| 724 // When closing a system bubble with the alternate shelf layout, we need to | 724 // When closing a system bubble with the alternate shelf layout, we need to |
| 725 // turn off the active tinting of the shelf. | 725 // turn off the active tinting of the shelf. |
| 726 if (full_system_tray_menu_) { | 726 if (full_system_tray_menu_) { |
| 727 SetDrawBackgroundAsActive(false); | 727 SetDrawBackgroundAsActive(false); |
| 728 full_system_tray_menu_ = false; | 728 full_system_tray_menu_ = false; |
| 729 } | 729 } |
| 730 } | 730 } |
| 731 | 731 |
| 732 } // namespace ash | 732 } // namespace ash |
| OLD | NEW |