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

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

Issue 2007003002: mash: Preliminary support for shelf auto-hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shutdown
Patch Set: cleanup Created 4 years, 7 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
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/shelf/shelf_tooltip_manager.h" 5 #include "ash/shelf/shelf_tooltip_manager.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_view.h" 9 #include "ash/shelf/shelf_view.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 shelf_layout_manager_ = nullptr; 232 shelf_layout_manager_ = nullptr;
233 shelf_view_ = nullptr; 233 shelf_view_ = nullptr;
234 } 234 }
235 235
236 void ShelfTooltipManager::WillChangeVisibilityState( 236 void ShelfTooltipManager::WillChangeVisibilityState(
237 ShelfVisibilityState new_state) { 237 ShelfVisibilityState new_state) {
238 if (new_state == SHELF_HIDDEN) 238 if (new_state == SHELF_HIDDEN)
239 Close(); 239 Close();
240 } 240 }
241 241
242 void ShelfTooltipManager::OnAutoHideStateChanged(ShelfAutoHideState new_state) { 242 void ShelfTooltipManager::OnAutoHideStateChanged(
243 ShelfLayoutManager* layout_manager,
244 ShelfAutoHideState new_state) {
243 if (new_state == SHELF_AUTO_HIDE_HIDDEN) { 245 if (new_state == SHELF_AUTO_HIDE_HIDDEN) {
244 timer_.Stop(); 246 timer_.Stop();
245 // AutoHide state change happens during an event filter, so immediate close 247 // AutoHide state change happens during an event filter, so immediate close
246 // may cause a crash in the HandleMouseEvent() after the filter. So we just 248 // may cause a crash in the HandleMouseEvent() after the filter. So we just
247 // schedule the Close here. 249 // schedule the Close here.
248 base::ThreadTaskRunnerHandle::Get()->PostTask( 250 base::ThreadTaskRunnerHandle::Get()->PostTask(
249 FROM_HERE, 251 FROM_HERE,
250 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); 252 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr()));
251 } 253 }
252 } 254 }
253 255
254 } // namespace ash 256 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698