| 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_tooltip_manager.h" | 5 #include "ash/common/shelf/shelf_tooltip_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/shelf_view.h" | 7 #include "ash/common/shelf/shelf_view.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // AutoHide state change happens during an event filter, so immediate close | 243 // AutoHide state change happens during an event filter, so immediate close |
| 244 // may cause a crash in the HandleMouseEvent() after the filter. So we just | 244 // may cause a crash in the HandleMouseEvent() after the filter. So we just |
| 245 // schedule the Close here. | 245 // schedule the Close here. |
| 246 base::ThreadTaskRunnerHandle::Get()->PostTask( | 246 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 247 FROM_HERE, | 247 FROM_HERE, |
| 248 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); | 248 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) { | 252 bool ShelfTooltipManager::ShouldShowTooltipForView(views::View* view) { |
| 253 return shelf_view_ && shelf_view_->ShouldShowTooltipForView(view) && | 253 WmShelf* shelf = shelf_view_ ? shelf_view_->wm_shelf() : nullptr; |
| 254 shelf_view_->wm_shelf()->GetVisibilityState() == SHELF_VISIBLE; | 254 return shelf && shelf_view_->ShouldShowTooltipForView(view) && |
| 255 (shelf->GetVisibilityState() == SHELF_VISIBLE || |
| 256 (shelf->GetVisibilityState() == SHELF_AUTO_HIDE && |
| 257 shelf->GetAutoHideState() == SHELF_AUTO_HIDE_SHOWN)); |
| 255 } | 258 } |
| 256 | 259 |
| 257 } // namespace ash | 260 } // namespace ash |
| OLD | NEW |