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/tray_event_filter.h" | 5 #include "ash/common/system/tray/tray_event_filter.h" |
6 | 6 |
7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/common/system/tray/tray_background_view.h" | 8 #include "ash/common/system/tray/tray_background_view.h" |
9 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 9 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
10 #include "ash/common/wm/container_finder.h" | 10 #include "ash/common/wm/container_finder.h" |
11 #include "ash/common/wm_lookup.h" | 11 #include "ash/common/wm_lookup.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "ash/common/wm_window.h" | 13 #include "ash/common/wm_window.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 | 17 |
18 TrayEventFilter::TrayEventFilter() { | 18 TrayEventFilter::TrayEventFilter() {} |
19 } | |
20 | 19 |
21 TrayEventFilter::~TrayEventFilter() { | 20 TrayEventFilter::~TrayEventFilter() { |
22 DCHECK(wrappers_.empty()); | 21 DCHECK(wrappers_.empty()); |
23 } | 22 } |
24 | 23 |
25 void TrayEventFilter::AddWrapper(TrayBubbleWrapper* wrapper) { | 24 void TrayEventFilter::AddWrapper(TrayBubbleWrapper* wrapper) { |
26 bool was_empty = wrappers_.empty(); | 25 bool was_empty = wrappers_.empty(); |
27 wrappers_.insert(wrapper); | 26 wrappers_.insert(wrapper); |
28 if (was_empty && !wrappers_.empty()) | 27 if (was_empty && !wrappers_.empty()) |
29 WmShell::Get()->AddPointerWatcher(this); | 28 WmShell::Get()->AddPointerWatcher(this); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 iter != wrappers_.end(); ++iter) { | 91 iter != wrappers_.end(); ++iter) { |
93 trays.insert((*iter)->tray()); | 92 trays.insert((*iter)->tray()); |
94 } | 93 } |
95 for (std::set<TrayBackgroundView*>::iterator iter = trays.begin(); | 94 for (std::set<TrayBackgroundView*>::iterator iter = trays.begin(); |
96 iter != trays.end(); ++iter) { | 95 iter != trays.end(); ++iter) { |
97 (*iter)->ClickedOutsideBubble(); | 96 (*iter)->ClickedOutsideBubble(); |
98 } | 97 } |
99 } | 98 } |
100 | 99 |
101 } // namespace ash | 100 } // namespace ash |
OLD | NEW |