| 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/aura/wm_shelf_aura.h" | 8 #include "ash/aura/wm_shelf_aura.h" |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 shelf_->RemoveObserver(this); | 269 shelf_->RemoveObserver(this); |
| 270 shelf_ = NULL; | 270 shelf_ = NULL; |
| 271 } | 271 } |
| 272 | 272 |
| 273 void WillChangeVisibilityState(ShelfVisibilityState new_state) override { | 273 void WillChangeVisibilityState(ShelfVisibilityState new_state) override { |
| 274 gfx::Insets mouse_insets; | 274 gfx::Insets mouse_insets; |
| 275 gfx::Insets touch_insets; | 275 gfx::Insets touch_insets; |
| 276 if (new_state == SHELF_VISIBLE) { | 276 if (new_state == SHELF_VISIBLE) { |
| 277 // Let clicks at the very top of the shelf through so windows can be | 277 // Let clicks at the very top of the shelf through so windows can be |
| 278 // resized with the bottom-right corner and bottom edge. | 278 // resized with the bottom-right corner and bottom edge. |
| 279 mouse_insets = GetInsetsForAlignment( | 279 mouse_insets = GetInsetsForAlignment(kWorkspaceAreaVisibleInset, |
| 280 ShelfLayoutManager::kWorkspaceAreaVisibleInset, | 280 shelf_->GetAlignment()); |
| 281 shelf_->GetAlignment()); | |
| 282 } else if (new_state == SHELF_AUTO_HIDE) { | 281 } else if (new_state == SHELF_AUTO_HIDE) { |
| 283 // Extend the touch hit target out a bit to allow users to drag shelf out | 282 // Extend the touch hit target out a bit to allow users to drag shelf out |
| 284 // while hidden. | 283 // while hidden. |
| 285 touch_insets = GetInsetsForAlignment( | 284 touch_insets = GetInsetsForAlignment(-kWorkspaceAreaAutoHideInset, |
| 286 -ShelfLayoutManager::kWorkspaceAreaAutoHideInset, | 285 shelf_->GetAlignment()); |
| 287 shelf_->GetAlignment()); | |
| 288 } | 286 } |
| 289 | 287 |
| 290 set_mouse_extend(mouse_insets); | 288 set_mouse_extend(mouse_insets); |
| 291 set_touch_extend(touch_insets); | 289 set_touch_extend(touch_insets); |
| 292 } | 290 } |
| 293 | 291 |
| 294 ShelfLayoutManager* shelf_; | 292 ShelfLayoutManager* shelf_; |
| 295 | 293 |
| 296 DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter); | 294 DISALLOW_COPY_AND_ASSIGN(ShelfWindowTargeter); |
| 297 }; | 295 }; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); | 822 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); |
| 825 } | 823 } |
| 826 | 824 |
| 827 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { | 825 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { |
| 828 Widget::OnGestureEvent(event); | 826 Widget::OnGestureEvent(event); |
| 829 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) | 827 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) |
| 830 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); | 828 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); |
| 831 } | 829 } |
| 832 | 830 |
| 833 } // namespace ash | 831 } // namespace ash |
| OLD | NEW |