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

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

Issue 1828133004: Refine ash shelf tooltip closing on non-mash ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid WillDeleteShelf in PrepareForShutdown; use aura::WindowObserver instead. Created 4 years, 8 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 | « ash/shelf/shelf_tooltip_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_widget.h" 5 #include "ash/shelf/shelf_widget.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/focus_cycler.h" 8 #include "ash/focus_cycler.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 case ash::SHELF_ALIGNMENT_RIGHT: 273 case ash::SHELF_ALIGNMENT_RIGHT:
274 return gfx::Insets(0, distance, 0, 0); 274 return gfx::Insets(0, distance, 0, 0);
275 case ash::SHELF_ALIGNMENT_TOP: 275 case ash::SHELF_ALIGNMENT_TOP:
276 return gfx::Insets(0, 0, distance, 0); 276 return gfx::Insets(0, 0, distance, 0);
277 } 277 }
278 NOTREACHED(); 278 NOTREACHED();
279 return gfx::Insets(); 279 return gfx::Insets();
280 } 280 }
281 281
282 // ash::ShelfLayoutManagerObserver: 282 // ash::ShelfLayoutManagerObserver:
283 void WillDeleteShelf() override { shelf_ = NULL; } 283 void WillDeleteShelf() override {
284 shelf_->RemoveObserver(this);
285 shelf_ = NULL;
286 }
284 287
285 void WillChangeVisibilityState(ash::ShelfVisibilityState new_state) override { 288 void WillChangeVisibilityState(ash::ShelfVisibilityState new_state) override {
286 gfx::Insets mouse_insets; 289 gfx::Insets mouse_insets;
287 gfx::Insets touch_insets; 290 gfx::Insets touch_insets;
288 if (new_state == ash::SHELF_VISIBLE) { 291 if (new_state == ash::SHELF_VISIBLE) {
289 // Let clicks at the very top of the shelf through so windows can be 292 // Let clicks at the very top of the shelf through so windows can be
290 // resized with the bottom-right corner and bottom edge. 293 // resized with the bottom-right corner and bottom edge.
291 mouse_insets = GetInsetsForAlignment( 294 mouse_insets = GetInsetsForAlignment(
292 ShelfLayoutManager::kWorkspaceAreaVisibleInset, 295 ShelfLayoutManager::kWorkspaceAreaVisibleInset,
293 shelf_->GetAlignment()); 296 shelf_->GetAlignment());
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 DCHECK(delegate_view_); 835 DCHECK(delegate_view_);
833 return delegate_view_->disable_dimming_animations_for_test(); 836 return delegate_view_->disable_dimming_animations_for_test();
834 } 837 }
835 838
836 void ShelfWidget::WillDeleteShelf() { 839 void ShelfWidget::WillDeleteShelf() {
837 shelf_layout_manager_->RemoveObserver(this); 840 shelf_layout_manager_->RemoveObserver(this);
838 shelf_layout_manager_ = NULL; 841 shelf_layout_manager_ = NULL;
839 } 842 }
840 843
841 } // namespace ash 844 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_tooltip_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698