| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/wm/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/launcher/launcher.h" | 9 #include "ash/launcher/launcher.h" |
| 10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool in_mouse_drag() const { return in_mouse_drag_; } | 56 bool in_mouse_drag() const { return in_mouse_drag_; } |
| 57 | 57 |
| 58 // Overridden from aura::EventFilter: | 58 // Overridden from aura::EventFilter: |
| 59 virtual bool PreHandleKeyEvent(aura::Window* target, | 59 virtual bool PreHandleKeyEvent(aura::Window* target, |
| 60 ui::KeyEvent* event) OVERRIDE; | 60 ui::KeyEvent* event) OVERRIDE; |
| 61 virtual bool PreHandleMouseEvent(aura::Window* target, | 61 virtual bool PreHandleMouseEvent(aura::Window* target, |
| 62 ui::MouseEvent* event) OVERRIDE; | 62 ui::MouseEvent* event) OVERRIDE; |
| 63 virtual ui::TouchStatus PreHandleTouchEvent( | 63 virtual ui::TouchStatus PreHandleTouchEvent( |
| 64 aura::Window* target, | 64 aura::Window* target, |
| 65 ui::TouchEvent* event) OVERRIDE; | 65 ui::TouchEvent* event) OVERRIDE; |
| 66 virtual ui::GestureStatus PreHandleGestureEvent( | 66 virtual ui::EventResult PreHandleGestureEvent( |
| 67 aura::Window* target, | 67 aura::Window* target, |
| 68 ui::GestureEvent* event) OVERRIDE; | 68 ui::GestureEvent* event) OVERRIDE; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 ShelfLayoutManager* shelf_; | 71 ShelfLayoutManager* shelf_; |
| 72 bool in_mouse_drag_; | 72 bool in_mouse_drag_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(AutoHideEventFilter); | 74 DISALLOW_COPY_AND_ASSIGN(AutoHideEventFilter); |
| 75 }; | 75 }; |
| 76 | 76 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 104 shelf_->UpdateAutoHideState(); | 104 shelf_->UpdateAutoHideState(); |
| 105 return false; // Not handled. | 105 return false; // Not handled. |
| 106 } | 106 } |
| 107 | 107 |
| 108 ui::TouchStatus ShelfLayoutManager::AutoHideEventFilter::PreHandleTouchEvent( | 108 ui::TouchStatus ShelfLayoutManager::AutoHideEventFilter::PreHandleTouchEvent( |
| 109 aura::Window* target, | 109 aura::Window* target, |
| 110 ui::TouchEvent* event) { | 110 ui::TouchEvent* event) { |
| 111 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. | 111 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. |
| 112 } | 112 } |
| 113 | 113 |
| 114 ui::GestureStatus | 114 ui::EventResult |
| 115 ShelfLayoutManager::AutoHideEventFilter::PreHandleGestureEvent( | 115 ShelfLayoutManager::AutoHideEventFilter::PreHandleGestureEvent( |
| 116 aura::Window* target, | 116 aura::Window* target, |
| 117 ui::GestureEvent* event) { | 117 ui::GestureEvent* event) { |
| 118 return ui::GESTURE_STATUS_UNKNOWN; // Not handled. | 118 return ui::ER_UNHANDLED; // Not handled. |
| 119 } | 119 } |
| 120 | 120 |
| 121 //////////////////////////////////////////////////////////////////////////////// | 121 //////////////////////////////////////////////////////////////////////////////// |
| 122 // ShelfLayoutManager, public: | 122 // ShelfLayoutManager, public: |
| 123 | 123 |
| 124 ShelfLayoutManager::ShelfLayoutManager(views::Widget* status) | 124 ShelfLayoutManager::ShelfLayoutManager(views::Widget* status) |
| 125 : root_window_(Shell::GetPrimaryRootWindow()), | 125 : root_window_(Shell::GetPrimaryRootWindow()), |
| 126 in_layout_(false), | 126 in_layout_(false), |
| 127 auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT), | 127 auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT), |
| 128 alignment_(SHELF_ALIGNMENT_BOTTOM), | 128 alignment_(SHELF_ALIGNMENT_BOTTOM), |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 704 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
| 705 if (state.visibility_state == VISIBLE) | 705 if (state.visibility_state == VISIBLE) |
| 706 return size; | 706 return size; |
| 707 if (state.visibility_state == AUTO_HIDE) | 707 if (state.visibility_state == AUTO_HIDE) |
| 708 return kAutoHideSize; | 708 return kAutoHideSize; |
| 709 return 0; | 709 return 0; |
| 710 } | 710 } |
| 711 | 711 |
| 712 } // namespace internal | 712 } // namespace internal |
| 713 } // namespace ash | 713 } // namespace ash |
| OLD | NEW |