Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Unified Diff: ash/common/shelf/shelf_window_watcher.cc

Issue 2558963002: Move shelf item tooltip flag from delegate to item. (Closed)
Patch Set: Remove WmWindowMus::SetBoolProperty override. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/shelf/shelf_window_watcher.h ('k') | ash/common/shelf/shelf_window_watcher_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_window_watcher.cc
diff --git a/ash/common/shelf/shelf_window_watcher.cc b/ash/common/shelf/shelf_window_watcher.cc
index 648a8060b2086a5c6f2fa454a28b307d9a249fa7..92bfe9a1cfca22879a5b236302fc4d7625c4b445 100644
--- a/ash/common/shelf/shelf_window_watcher.cc
+++ b/ash/common/shelf/shelf_window_watcher.cc
@@ -38,6 +38,11 @@ void UpdateShelfItemForWindow(ShelfItem* item, WmWindow* window) {
item->image = window->GetAppIcon();
if (item->image.isNull())
item->image = window->GetWindowIcon();
+
+ // Do not show tooltips for visible attached app panel windows.
+ item->shows_tooltip =
+ item->type != TYPE_APP_PANEL || !window->IsVisible() ||
+ !window->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED);
}
} // namespace
@@ -80,6 +85,7 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged(
if (property == WmWindowProperty::APP_ICON ||
property == WmWindowProperty::APP_ID ||
property == WmWindowProperty::DRAW_ATTENTION ||
+ property == WmWindowProperty::PANEL_ATTACHED ||
property == WmWindowProperty::SHELF_ITEM_TYPE ||
property == WmWindowProperty::WINDOW_ICON) {
window_watcher_->OnUserWindowPropertyChanged(window);
@@ -91,6 +97,13 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowDestroying(
window_watcher_->OnUserWindowDestroying(window);
}
+void ShelfWindowWatcher::UserWindowObserver::OnWindowVisibilityChanged(
+ WmWindow* window,
+ bool visible) {
+ // The tooltip behavior for panel windows depends on the panel visibility.
+ window_watcher_->OnUserWindowPropertyChanged(window);
+}
+
////////////////////////////////////////////////////////////////////////////////
ShelfWindowWatcher::ShelfWindowWatcher(ShelfModel* model)
« no previous file with comments | « ash/common/shelf/shelf_window_watcher.h ('k') | ash/common/shelf/shelf_window_watcher_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698