| 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 "ui/wm/core/compound_event_filter.h" | 5 #include "ui/wm/core/compound_event_filter.h" |
| 6 | 6 |
| 7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Additional filters are not owned by CompoundEventFilter and they | 61 // Additional filters are not owned by CompoundEventFilter and they |
| 62 // should all be removed when running here. |handlers_| has | 62 // should all be removed when running here. |handlers_| has |
| 63 // check_empty == true and will DCHECK failure if it is not empty. | 63 // check_empty == true and will DCHECK failure if it is not empty. |
| 64 } | 64 } |
| 65 | 65 |
| 66 // static | 66 // static |
| 67 gfx::NativeCursor CompoundEventFilter::CursorForWindowComponent( | 67 gfx::NativeCursor CompoundEventFilter::CursorForWindowComponent( |
| 68 int window_component) { | 68 int window_component) { |
| 69 switch (window_component) { | 69 switch (window_component) { |
| 70 case HTBOTTOM: | 70 case HTBOTTOM: |
| 71 return ui::kCursorSouthResize; | 71 return ui::CursorType::kSouthResize; |
| 72 case HTBOTTOMLEFT: | 72 case HTBOTTOMLEFT: |
| 73 return ui::kCursorSouthWestResize; | 73 return ui::CursorType::kSouthWestResize; |
| 74 case HTBOTTOMRIGHT: | 74 case HTBOTTOMRIGHT: |
| 75 return ui::kCursorSouthEastResize; | 75 return ui::CursorType::kSouthEastResize; |
| 76 case HTLEFT: | 76 case HTLEFT: |
| 77 return ui::kCursorWestResize; | 77 return ui::CursorType::kWestResize; |
| 78 case HTRIGHT: | 78 case HTRIGHT: |
| 79 return ui::kCursorEastResize; | 79 return ui::CursorType::kEastResize; |
| 80 case HTTOP: | 80 case HTTOP: |
| 81 return ui::kCursorNorthResize; | 81 return ui::CursorType::kNorthResize; |
| 82 case HTTOPLEFT: | 82 case HTTOPLEFT: |
| 83 return ui::kCursorNorthWestResize; | 83 return ui::CursorType::kNorthWestResize; |
| 84 case HTTOPRIGHT: | 84 case HTTOPRIGHT: |
| 85 return ui::kCursorNorthEastResize; | 85 return ui::CursorType::kNorthEastResize; |
| 86 default: | 86 default: |
| 87 return ui::kCursorNull; | 87 return ui::CursorType::kNull; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CompoundEventFilter::AddHandler(ui::EventHandler* handler) { | 91 void CompoundEventFilter::AddHandler(ui::EventHandler* handler) { |
| 92 handlers_.AddObserver(handler); | 92 handlers_.AddObserver(handler); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void CompoundEventFilter::RemoveHandler(ui::EventHandler* handler) { | 95 void CompoundEventFilter::RemoveHandler(ui::EventHandler* handler) { |
| 96 handlers_.RemoveObserver(handler); | 96 handlers_.RemoveObserver(handler); |
| 97 } | 97 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 void CompoundEventFilter::OnGestureEvent(ui::GestureEvent* event) { | 239 void CompoundEventFilter::OnGestureEvent(ui::GestureEvent* event) { |
| 240 for (ui::EventHandler& handler : handlers_) { | 240 for (ui::EventHandler& handler : handlers_) { |
| 241 if (event->stopped_propagation()) | 241 if (event->stopped_propagation()) |
| 242 break; | 242 break; |
| 243 handler.OnGestureEvent(event); | 243 handler.OnGestureEvent(event); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace wm | 247 } // namespace wm |
| OLD | NEW |