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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Returns true if the last mouse event was a mouse drag. | 57 // Returns true if the last mouse event was a mouse drag. |
58 bool in_mouse_drag() const { return in_mouse_drag_; } | 58 bool in_mouse_drag() const { return in_mouse_drag_; } |
59 | 59 |
60 // Overridden from aura::EventFilter: | 60 // Overridden from aura::EventFilter: |
61 virtual bool PreHandleKeyEvent(aura::Window* target, | 61 virtual bool PreHandleKeyEvent(aura::Window* target, |
62 ui::KeyEvent* event) OVERRIDE; | 62 ui::KeyEvent* event) OVERRIDE; |
63 virtual bool PreHandleMouseEvent(aura::Window* target, | 63 virtual bool PreHandleMouseEvent(aura::Window* target, |
64 ui::MouseEvent* event) OVERRIDE; | 64 ui::MouseEvent* event) OVERRIDE; |
65 virtual ui::TouchStatus PreHandleTouchEvent( | 65 virtual ui::TouchStatus PreHandleTouchEvent( |
66 aura::Window* target, | 66 aura::Window* target, |
67 ui::TouchEventImpl* event) OVERRIDE; | 67 ui::TouchEvent* event) OVERRIDE; |
68 virtual ui::GestureStatus PreHandleGestureEvent( | 68 virtual ui::GestureStatus PreHandleGestureEvent( |
69 aura::Window* target, | 69 aura::Window* target, |
70 ui::GestureEventImpl* event) OVERRIDE; | 70 ui::GestureEventImpl* event) OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
73 ShelfLayoutManager* shelf_; | 73 ShelfLayoutManager* shelf_; |
74 bool in_mouse_drag_; | 74 bool in_mouse_drag_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(AutoHideEventFilter); | 76 DISALLOW_COPY_AND_ASSIGN(AutoHideEventFilter); |
77 }; | 77 }; |
(...skipping 24 matching lines...) Expand all Loading... |
102 (in_mouse_drag_ && event->type() != ui::ET_MOUSE_RELEASED && | 102 (in_mouse_drag_ && event->type() != ui::ET_MOUSE_RELEASED && |
103 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)) && | 103 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED)) && |
104 !shelf_->IsShelfWindow(target); | 104 !shelf_->IsShelfWindow(target); |
105 if (event->type() == ui::ET_MOUSE_MOVED) | 105 if (event->type() == ui::ET_MOUSE_MOVED) |
106 shelf_->UpdateAutoHideState(); | 106 shelf_->UpdateAutoHideState(); |
107 return false; // Not handled. | 107 return false; // Not handled. |
108 } | 108 } |
109 | 109 |
110 ui::TouchStatus ShelfLayoutManager::AutoHideEventFilter::PreHandleTouchEvent( | 110 ui::TouchStatus ShelfLayoutManager::AutoHideEventFilter::PreHandleTouchEvent( |
111 aura::Window* target, | 111 aura::Window* target, |
112 ui::TouchEventImpl* event) { | 112 ui::TouchEvent* event) { |
113 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. | 113 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. |
114 } | 114 } |
115 | 115 |
116 ui::GestureStatus | 116 ui::GestureStatus |
117 ShelfLayoutManager::AutoHideEventFilter::PreHandleGestureEvent( | 117 ShelfLayoutManager::AutoHideEventFilter::PreHandleGestureEvent( |
118 aura::Window* target, | 118 aura::Window* target, |
119 ui::GestureEventImpl* event) { | 119 ui::GestureEventImpl* event) { |
120 return ui::GESTURE_STATUS_UNKNOWN; // Not handled. | 120 return ui::GESTURE_STATUS_UNKNOWN; // Not handled. |
121 } | 121 } |
122 | 122 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 603 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
604 if (state.visibility_state == VISIBLE) | 604 if (state.visibility_state == VISIBLE) |
605 return size; | 605 return size; |
606 if (state.visibility_state == AUTO_HIDE) | 606 if (state.visibility_state == AUTO_HIDE) |
607 return kAutoHideSize; | 607 return kAutoHideSize; |
608 return 0; | 608 return 0; |
609 } | 609 } |
610 | 610 |
611 } // namespace internal | 611 } // namespace internal |
612 } // namespace ash | 612 } // namespace ash |
OLD | NEW |