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 30 matching lines...) Expand all Loading... |
41 #include "ash/common/system/update/tray_update.h" | 41 #include "ash/common/system/update/tray_update.h" |
42 #include "ash/common/system/user/tray_user.h" | 42 #include "ash/common/system/user/tray_user.h" |
43 #include "ash/common/system/web_notification/web_notification_tray.h" | 43 #include "ash/common/system/web_notification/web_notification_tray.h" |
44 #include "ash/common/wm/container_finder.h" | 44 #include "ash/common/wm/container_finder.h" |
45 #include "ash/common/wm_shell.h" | 45 #include "ash/common/wm_shell.h" |
46 #include "ash/common/wm_window.h" | 46 #include "ash/common/wm_window.h" |
47 #include "ash/public/cpp/shell_window_ids.h" | 47 #include "ash/public/cpp/shell_window_ids.h" |
48 #include "ash/root_window_controller.h" | 48 #include "ash/root_window_controller.h" |
49 #include "ash/shell.h" | 49 #include "ash/shell.h" |
50 #include "ash/strings/grit/ash_strings.h" | 50 #include "ash/strings/grit/ash_strings.h" |
| 51 #include "ash/wm/widget_finder.h" |
51 #include "base/logging.h" | 52 #include "base/logging.h" |
52 #include "base/memory/ptr_util.h" | 53 #include "base/memory/ptr_util.h" |
53 #include "base/metrics/histogram_macros.h" | 54 #include "base/metrics/histogram_macros.h" |
54 #include "base/timer/timer.h" | 55 #include "base/timer/timer.h" |
55 #include "ui/base/accelerators/accelerator.h" | 56 #include "ui/base/accelerators/accelerator.h" |
56 #include "ui/base/l10n/l10n_util.h" | 57 #include "ui/base/l10n/l10n_util.h" |
57 #include "ui/compositor/layer.h" | 58 #include "ui/compositor/layer.h" |
58 #include "ui/display/display.h" | 59 #include "ui/display/display.h" |
59 #include "ui/display/screen.h" | 60 #include "ui/display/screen.h" |
60 #include "ui/events/event_constants.h" | 61 #include "ui/events/event_constants.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 wm::GetContainerForWindow(wm_gained_active)->GetShellWindowId(); | 183 wm::GetContainerForWindow(wm_gained_active)->GetShellWindowId(); |
183 | 184 |
184 // Don't close the bubble if a popup notification is activated. | 185 // Don't close the bubble if a popup notification is activated. |
185 if (container_id == kShellWindowId_StatusContainer) | 186 if (container_id == kShellWindowId_StatusContainer) |
186 return; | 187 return; |
187 | 188 |
188 views::Widget* bubble_widget = | 189 views::Widget* bubble_widget = |
189 tray_->GetSystemBubble()->bubble_view()->GetWidget(); | 190 tray_->GetSystemBubble()->bubble_view()->GetWidget(); |
190 // 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 |
191 // activation. | 192 // activation. |
192 if (bubble_widget == wm_gained_active->GetInternalWidget() || | 193 if (bubble_widget == GetInternalWidgetForWindow(gained_active) || |
193 ::wm::HasTransientAncestor(gained_active, | 194 ::wm::HasTransientAncestor(gained_active, |
194 bubble_widget->GetNativeWindow()) || | 195 bubble_widget->GetNativeWindow()) || |
195 (lost_active && ::wm::HasTransientAncestor( | 196 (lost_active && ::wm::HasTransientAncestor( |
196 lost_active, bubble_widget->GetNativeWindow()))) { | 197 lost_active, bubble_widget->GetNativeWindow()))) { |
197 return; | 198 return; |
198 } | 199 } |
199 | 200 |
200 tray_->CloseSystemBubble(); | 201 tray_->CloseSystemBubble(); |
201 } | 202 } |
202 | 203 |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 .work_area() | 743 .work_area() |
743 .height(); | 744 .height(); |
744 if (work_area_height > 0) { | 745 if (work_area_height > 0) { |
745 UMA_HISTOGRAM_CUSTOM_COUNTS( | 746 UMA_HISTOGRAM_CUSTOM_COUNTS( |
746 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 747 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
747 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 748 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
748 } | 749 } |
749 } | 750 } |
750 | 751 |
751 } // namespace ash | 752 } // namespace ash |
OLD | NEW |