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 "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 @end | 67 @end |
68 | 68 |
69 @interface MockRenderWidgetHostViewMacDelegate | 69 @interface MockRenderWidgetHostViewMacDelegate |
70 : NSObject<RenderWidgetHostViewMacDelegate> { | 70 : NSObject<RenderWidgetHostViewMacDelegate> { |
71 BOOL unhandledWheelEventReceived_; | 71 BOOL unhandledWheelEventReceived_; |
72 } | 72 } |
73 | 73 |
74 @property(nonatomic) BOOL unhandledWheelEventReceived; | 74 @property(nonatomic) BOOL unhandledWheelEventReceived; |
75 | |
76 - (void)gotUnhandledWheelEvent; | |
77 @end | 75 @end |
78 | 76 |
79 @implementation MockRenderWidgetHostViewMacDelegate | 77 @implementation MockRenderWidgetHostViewMacDelegate |
80 | 78 |
81 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; | 79 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; |
82 | 80 |
83 - (void)gotUnhandledWheelEvent { | 81 - (void)gotWheelEventConsumed:(BOOL)consumed { |
84 unhandledWheelEventReceived_ = true; | 82 if (!consumed) |
| 83 unhandledWheelEventReceived_ = true; |
85 } | 84 } |
86 - (void)touchesBeganWithEvent:(NSEvent*)event{} | 85 - (void)touchesBeganWithEvent:(NSEvent*)event{} |
87 - (void)touchesMovedWithEvent:(NSEvent*)event{} | 86 - (void)touchesMovedWithEvent:(NSEvent*)event{} |
88 - (void)touchesCancelledWithEvent:(NSEvent*)event{} | 87 - (void)touchesCancelledWithEvent:(NSEvent*)event{} |
89 - (void)touchesEndedWithEvent:(NSEvent*)event{} | 88 - (void)touchesEndedWithEvent:(NSEvent*)event{} |
90 - (void)beginGestureWithEvent:(NSEvent*)event{} | 89 - (void)beginGestureWithEvent:(NSEvent*)event{} |
91 - (void)endGestureWithEvent:(NSEvent*)event{} | 90 - (void)endGestureWithEvent:(NSEvent*)event{} |
92 - (BOOL)canRubberbandLeft:(NSView*)view { | 91 - (BOOL)canRubberbandLeft:(NSView*)view { |
93 return true; | 92 return true; |
94 } | 93 } |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 host->OnMessageReceived(*response2); | 787 host->OnMessageReceived(*response2); |
789 | 788 |
790 // Check that the view delegate ignored the empty unhandled wheel event. | 789 // Check that the view delegate ignored the empty unhandled wheel event. |
791 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); | 790 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); |
792 | 791 |
793 // Clean up. | 792 // Clean up. |
794 host->Shutdown(); | 793 host->Shutdown(); |
795 } | 794 } |
796 | 795 |
797 } // namespace content | 796 } // namespace content |
OLD | NEW |