| OLD | NEW |
| 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 Loading... |
| 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 { | 283 void WillDeleteShelf() override { shelf_ = NULL; } |
| 284 shelf_->RemoveObserver(this); | |
| 285 shelf_ = NULL; | |
| 286 } | |
| 287 | 284 |
| 288 void WillChangeVisibilityState(ash::ShelfVisibilityState new_state) override { | 285 void WillChangeVisibilityState(ash::ShelfVisibilityState new_state) override { |
| 289 gfx::Insets mouse_insets; | 286 gfx::Insets mouse_insets; |
| 290 gfx::Insets touch_insets; | 287 gfx::Insets touch_insets; |
| 291 if (new_state == ash::SHELF_VISIBLE) { | 288 if (new_state == ash::SHELF_VISIBLE) { |
| 292 // Let clicks at the very top of the shelf through so windows can be | 289 // Let clicks at the very top of the shelf through so windows can be |
| 293 // resized with the bottom-right corner and bottom edge. | 290 // resized with the bottom-right corner and bottom edge. |
| 294 mouse_insets = GetInsetsForAlignment( | 291 mouse_insets = GetInsetsForAlignment( |
| 295 ShelfLayoutManager::kWorkspaceAreaVisibleInset, | 292 ShelfLayoutManager::kWorkspaceAreaVisibleInset, |
| 296 shelf_->GetAlignment()); | 293 shelf_->GetAlignment()); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 DCHECK(delegate_view_); | 832 DCHECK(delegate_view_); |
| 836 return delegate_view_->disable_dimming_animations_for_test(); | 833 return delegate_view_->disable_dimming_animations_for_test(); |
| 837 } | 834 } |
| 838 | 835 |
| 839 void ShelfWidget::WillDeleteShelf() { | 836 void ShelfWidget::WillDeleteShelf() { |
| 840 shelf_layout_manager_->RemoveObserver(this); | 837 shelf_layout_manager_->RemoveObserver(this); |
| 841 shelf_layout_manager_ = NULL; | 838 shelf_layout_manager_ = NULL; |
| 842 } | 839 } |
| 843 | 840 |
| 844 } // namespace ash | 841 } // namespace ash |
| OLD | NEW |