| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 // WmActivationObserver: | 174 // WmActivationObserver: |
| 175 void OnWindowActivated(ActivationReason reason, | 175 void OnWindowActivated(ActivationReason reason, |
| 176 aura::Window* gained_active, | 176 aura::Window* gained_active, |
| 177 aura::Window* lost_active) override { | 177 aura::Window* lost_active) override { |
| 178 if (!tray_->HasSystemBubble() || !gained_active) | 178 if (!tray_->HasSystemBubble() || !gained_active) |
| 179 return; | 179 return; |
| 180 | 180 |
| 181 WmWindow* wm_gained_active = WmWindow::Get(gained_active); | 181 WmWindow* wm_gained_active = WmWindow::Get(gained_active); |
| 182 int container_id = | 182 int container_id = |
| 183 wm::GetContainerForWindow(wm_gained_active)->GetShellWindowId(); | 183 wm::GetContainerForWindow(wm_gained_active)->aura_window()->id(); |
| 184 | 184 |
| 185 // Don't close the bubble if a popup notification is activated. | 185 // Don't close the bubble if a popup notification is activated. |
| 186 if (container_id == kShellWindowId_StatusContainer) | 186 if (container_id == kShellWindowId_StatusContainer) |
| 187 return; | 187 return; |
| 188 | 188 |
| 189 views::Widget* bubble_widget = | 189 views::Widget* bubble_widget = |
| 190 tray_->GetSystemBubble()->bubble_view()->GetWidget(); | 190 tray_->GetSystemBubble()->bubble_view()->GetWidget(); |
| 191 // Don't close the bubble if a transient child is gaining or losing | 191 // Don't close the bubble if a transient child is gaining or losing |
| 192 // activation. | 192 // activation. |
| 193 if (bubble_widget == GetInternalWidgetForWindow(gained_active) || | 193 if (bubble_widget == GetInternalWidgetForWindow(gained_active) || |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 .work_area() | 743 .work_area() |
| 744 .height(); | 744 .height(); |
| 745 if (work_area_height > 0) { | 745 if (work_area_height > 0) { |
| 746 UMA_HISTOGRAM_CUSTOM_COUNTS( | 746 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 747 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 747 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 748 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 748 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 749 } | 749 } |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace ash | 752 } // namespace ash |
| OLD | NEW |