OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_window_watcher.h" | 5 #include "ash/common/shelf/shelf_window_watcher.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 item->status = STATUS_ACTIVE; | 31 item->status = STATUS_ACTIVE; |
32 else if (window->GetBoolProperty(WmWindowProperty::DRAW_ATTENTION)) | 32 else if (window->GetBoolProperty(WmWindowProperty::DRAW_ATTENTION)) |
33 item->status = STATUS_ATTENTION; | 33 item->status = STATUS_ATTENTION; |
34 | 34 |
35 item->app_id = window->GetStringProperty(WmWindowProperty::APP_ID); | 35 item->app_id = window->GetStringProperty(WmWindowProperty::APP_ID); |
36 | 36 |
37 // Prefer app icons over window icons, they're typically larger. | 37 // Prefer app icons over window icons, they're typically larger. |
38 item->image = window->GetAppIcon(); | 38 item->image = window->GetAppIcon(); |
39 if (item->image.isNull()) | 39 if (item->image.isNull()) |
40 item->image = window->GetWindowIcon(); | 40 item->image = window->GetWindowIcon(); |
41 | |
42 // Do not show tooltips for visible attached app panel windows. | |
43 item->shows_tooltip = | |
44 item->type != TYPE_APP_PANEL || !window->IsVisible() || | |
sky
2016/12/08 00:38:54
Do we always end up back in this function when the
msw
2016/12/08 20:31:36
This was just working by chance, because minimizin
| |
45 !window->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED); | |
41 } | 46 } |
42 | 47 |
43 } // namespace | 48 } // namespace |
44 | 49 |
45 ShelfWindowWatcher::ContainerWindowObserver::ContainerWindowObserver( | 50 ShelfWindowWatcher::ContainerWindowObserver::ContainerWindowObserver( |
46 ShelfWindowWatcher* window_watcher) | 51 ShelfWindowWatcher* window_watcher) |
47 : window_watcher_(window_watcher) {} | 52 : window_watcher_(window_watcher) {} |
48 | 53 |
49 ShelfWindowWatcher::ContainerWindowObserver::~ContainerWindowObserver() {} | 54 ShelfWindowWatcher::ContainerWindowObserver::~ContainerWindowObserver() {} |
50 | 55 |
(...skipping 22 matching lines...) Expand all Loading... | |
73 : window_watcher_(window_watcher) {} | 78 : window_watcher_(window_watcher) {} |
74 | 79 |
75 ShelfWindowWatcher::UserWindowObserver::~UserWindowObserver() {} | 80 ShelfWindowWatcher::UserWindowObserver::~UserWindowObserver() {} |
76 | 81 |
77 void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged( | 82 void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged( |
78 WmWindow* window, | 83 WmWindow* window, |
79 WmWindowProperty property) { | 84 WmWindowProperty property) { |
80 if (property == WmWindowProperty::APP_ICON || | 85 if (property == WmWindowProperty::APP_ICON || |
81 property == WmWindowProperty::APP_ID || | 86 property == WmWindowProperty::APP_ID || |
82 property == WmWindowProperty::DRAW_ATTENTION || | 87 property == WmWindowProperty::DRAW_ATTENTION || |
88 property == WmWindowProperty::PANEL_ATTACHED || | |
83 property == WmWindowProperty::SHELF_ITEM_TYPE || | 89 property == WmWindowProperty::SHELF_ITEM_TYPE || |
84 property == WmWindowProperty::WINDOW_ICON) { | 90 property == WmWindowProperty::WINDOW_ICON) { |
85 window_watcher_->OnUserWindowPropertyChanged(window); | 91 window_watcher_->OnUserWindowPropertyChanged(window); |
86 } | 92 } |
87 } | 93 } |
88 | 94 |
89 void ShelfWindowWatcher::UserWindowObserver::OnWindowDestroying( | 95 void ShelfWindowWatcher::UserWindowObserver::OnWindowDestroying( |
90 WmWindow* window) { | 96 WmWindow* window) { |
91 window_watcher_->OnUserWindowDestroying(window); | 97 window_watcher_->OnUserWindowDestroying(window); |
92 } | 98 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 observed_container_windows_.Add(panel_container); | 218 observed_container_windows_.Add(panel_container); |
213 } | 219 } |
214 | 220 |
215 void ShelfWindowWatcher::OnDisplayRemoved(const display::Display& old_display) { | 221 void ShelfWindowWatcher::OnDisplayRemoved(const display::Display& old_display) { |
216 } | 222 } |
217 | 223 |
218 void ShelfWindowWatcher::OnDisplayMetricsChanged(const display::Display&, | 224 void ShelfWindowWatcher::OnDisplayMetricsChanged(const display::Display&, |
219 uint32_t) {} | 225 uint32_t) {} |
220 | 226 |
221 } // namespace ash | 227 } // namespace ash |
OLD | NEW |