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

Side by Side Diff: ash/common/shelf/shelf_tooltip_manager.cc

Issue 2388893002: Show tooltips in SHELF_AUTO_HIDE ShelfVisibilityState. (Closed)
Patch Set: Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/common/shelf/shelf_tooltip_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/shelf_tooltip_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698