| 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; |
| 75 @end | 77 @end |
| 76 | 78 |
| 77 @implementation MockRenderWidgetHostViewMacDelegate | 79 @implementation MockRenderWidgetHostViewMacDelegate |
| 78 | 80 |
| 79 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; | 81 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; |
| 80 | 82 |
| 81 - (void)gotWheelEventConsumed:(BOOL)consumed { | 83 - (void)gotUnhandledWheelEvent { |
| 82 if (!consumed) | 84 unhandledWheelEventReceived_ = true; |
| 83 unhandledWheelEventReceived_ = true; | |
| 84 } | 85 } |
| 85 - (void)touchesBeganWithEvent:(NSEvent*)event{} | 86 - (void)touchesBeganWithEvent:(NSEvent*)event{} |
| 86 - (void)touchesMovedWithEvent:(NSEvent*)event{} | 87 - (void)touchesMovedWithEvent:(NSEvent*)event{} |
| 87 - (void)touchesCancelledWithEvent:(NSEvent*)event{} | 88 - (void)touchesCancelledWithEvent:(NSEvent*)event{} |
| 88 - (void)touchesEndedWithEvent:(NSEvent*)event{} | 89 - (void)touchesEndedWithEvent:(NSEvent*)event{} |
| 89 - (void)beginGestureWithEvent:(NSEvent*)event{} | 90 - (void)beginGestureWithEvent:(NSEvent*)event{} |
| 90 - (void)endGestureWithEvent:(NSEvent*)event{} | 91 - (void)endGestureWithEvent:(NSEvent*)event{} |
| 91 - (BOOL)canRubberbandLeft:(NSView*)view { | 92 - (BOOL)canRubberbandLeft:(NSView*)view { |
| 92 return true; | 93 return true; |
| 93 } | 94 } |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 host->OnMessageReceived(*response2); | 788 host->OnMessageReceived(*response2); |
| 788 | 789 |
| 789 // Check that the view delegate ignored the empty unhandled wheel event. | 790 // Check that the view delegate ignored the empty unhandled wheel event. |
| 790 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); | 791 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); |
| 791 | 792 |
| 792 // Clean up. | 793 // Clean up. |
| 793 host->Shutdown(); | 794 host->Shutdown(); |
| 794 } | 795 } |
| 795 | 796 |
| 796 } // namespace content | 797 } // namespace content |
| OLD | NEW |