| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ | 5 #ifndef ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ |
| 6 #define ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ | 6 #define ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ |
| 7 | 7 |
| 8 #include "ash/shell_observer.h" | 8 #include "ash/shell_observer.h" |
| 9 #include "ui/wm/core/easy_resize_window_targeter.h" | 9 #include "ui/wm/core/easy_resize_window_targeter.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 class PanelLayoutManager; | 13 class PanelLayoutManager; |
| 14 | 14 |
| 15 // A window targeter installed on a panel container to disallow touch | 15 // A window targeter installed on a panel container to disallow touch |
| 16 // hit-testing of attached panel edges that are adjacent to the shelf. This | 16 // hit-testing of attached panel edges that are adjacent to the shelf. This |
| 17 // makes it significantly easier to correctly target shelf buttons with touch. | 17 // makes it significantly easier to correctly target shelf buttons with touch. |
| 18 class AttachedPanelWindowTargeter : public ::wm::EasyResizeWindowTargeter, | 18 class AttachedPanelWindowTargeter : public ::wm::EasyResizeWindowTargeter, |
| 19 public ShellObserver { | 19 public ShellObserver { |
| 20 public: | 20 public: |
| 21 AttachedPanelWindowTargeter(aura::Window* container, | 21 AttachedPanelWindowTargeter(aura::Window* container, |
| 22 const gfx::Insets& default_mouse_extend, | 22 const gfx::Insets& default_mouse_extend, |
| 23 const gfx::Insets& default_touch_extend, | 23 const gfx::Insets& default_touch_extend, |
| 24 PanelLayoutManager* panel_layout_manager); | 24 PanelLayoutManager* panel_layout_manager); |
| 25 virtual ~AttachedPanelWindowTargeter(); | 25 virtual ~AttachedPanelWindowTargeter(); |
| 26 | 26 |
| 27 // ShellObserver: | 27 // ShellObserver: |
| 28 virtual void OnShelfCreatedForRootWindow(aura::Window* root_window) OVERRIDE; | 28 virtual void OnShelfCreatedForRootWindow(aura::Window* root_window) override; |
| 29 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 29 virtual void OnShelfAlignmentChanged(aura::Window* root_window) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 void UpdateTouchExtend(aura::Window* root_window); | 32 void UpdateTouchExtend(aura::Window* root_window); |
| 33 | 33 |
| 34 aura::Window* panel_container_; | 34 aura::Window* panel_container_; |
| 35 PanelLayoutManager* panel_layout_manager_; | 35 PanelLayoutManager* panel_layout_manager_; |
| 36 gfx::Insets default_touch_extend_; | 36 gfx::Insets default_touch_extend_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(AttachedPanelWindowTargeter); | 38 DISALLOW_COPY_AND_ASSIGN(AttachedPanelWindowTargeter); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace ash | 41 } // namespace ash |
| 42 | 42 |
| 43 #endif // ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ | 43 #endif // ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_ |
| OLD | NEW |