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/common/system/tray/system_tray.h" | 5 #include "ash/common/system/tray/system_tray.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 views::View* SystemTray::GetHelpButtonView() const { | 487 views::View* SystemTray::GetHelpButtonView() const { |
488 if (MaterialDesignController::IsSystemTrayMenuMaterial()) | 488 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
489 return tray_tiles_->GetHelpButtonView(); | 489 return tray_tiles_->GetHelpButtonView(); |
490 return tray_date_->GetHelpButtonView(); | 490 return tray_date_->GetHelpButtonView(); |
491 } | 491 } |
492 | 492 |
493 TrayAudio* SystemTray::GetTrayAudio() const { | 493 TrayAudio* SystemTray::GetTrayAudio() const { |
494 return tray_audio_; | 494 return tray_audio_; |
495 } | 495 } |
496 | 496 |
497 bool SystemTray::CloseNotificationBubbleForTest() const { | |
498 if (!notification_bubble_) | |
499 return false; | |
500 notification_bubble_->bubble()->Close(); | |
501 return true; | |
502 } | |
503 | |
504 // Private methods. | 497 // Private methods. |
505 | 498 |
506 bool SystemTray::HasSystemBubbleType(SystemTrayBubble::BubbleType type) { | 499 bool SystemTray::HasSystemBubbleType(SystemTrayBubble::BubbleType type) { |
507 DCHECK(type != SystemTrayBubble::BUBBLE_TYPE_NOTIFICATION); | 500 DCHECK(type != SystemTrayBubble::BUBBLE_TYPE_NOTIFICATION); |
508 return system_bubble_.get() && system_bubble_->bubble_type() == type; | 501 return system_bubble_.get() && system_bubble_->bubble_type() == type; |
509 } | 502 } |
510 | 503 |
511 void SystemTray::DestroySystemBubble() { | 504 void SystemTray::DestroySystemBubble() { |
512 CloseSystemBubbleAndDeactivateSystemTray(); | 505 CloseSystemBubbleAndDeactivateSystemTray(); |
513 detailed_item_ = NULL; | 506 detailed_item_ = NULL; |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 .work_area() | 897 .work_area() |
905 .height(); | 898 .height(); |
906 if (work_area_height > 0) { | 899 if (work_area_height > 0) { |
907 UMA_HISTOGRAM_CUSTOM_COUNTS( | 900 UMA_HISTOGRAM_CUSTOM_COUNTS( |
908 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 901 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
909 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 902 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
910 } | 903 } |
911 } | 904 } |
912 | 905 |
913 } // namespace ash | 906 } // namespace ash |
OLD | NEW |