Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 75 |
| 76 - (void)gotUnhandledWheelEvent; | |
| 77 @end | 76 @end |
| 78 | 77 |
| 79 @implementation MockRenderWidgetHostViewMacDelegate | 78 @implementation MockRenderWidgetHostViewMacDelegate |
| 80 | 79 |
| 81 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; | 80 @synthesize unhandledWheelEventReceived = unhandledWheelEventReceived_; |
| 82 | 81 |
| 83 - (void)gotUnhandledWheelEvent { | 82 - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event |
| 84 unhandledWheelEventReceived_ = true; | 83 consumed:(BOOL)consumed { |
| 84 if (!consumed) | |
| 85 unhandledWheelEventReceived_ = true; | |
| 85 } | 86 } |
| 86 - (void)touchesBeganWithEvent:(NSEvent*)event{} | 87 - (void)touchesBeganWithEvent:(NSEvent*)event{} |
| 87 - (void)touchesMovedWithEvent:(NSEvent*)event{} | 88 - (void)touchesMovedWithEvent:(NSEvent*)event{} |
| 88 - (void)touchesCancelledWithEvent:(NSEvent*)event{} | 89 - (void)touchesCancelledWithEvent:(NSEvent*)event{} |
| 89 - (void)touchesEndedWithEvent:(NSEvent*)event{} | 90 - (void)touchesEndedWithEvent:(NSEvent*)event{} |
| 90 - (void)beginGestureWithEvent:(NSEvent*)event{} | 91 - (void)beginGestureWithEvent:(NSEvent*)event{} |
| 91 - (void)endGestureWithEvent:(NSEvent*)event{} | 92 - (void)endGestureWithEvent:(NSEvent*)event{} |
|
Avi (use Gerrit)
2014/05/29 15:02:01
While you're in here, can you put space before the
erikchen
2014/05/29 20:42:38
Done.
| |
| 92 - (BOOL)canRubberbandLeft:(NSView*)view { | 93 - (BOOL)canRubberbandLeft:(NSView*)view { |
| 93 return true; | 94 return true; |
| 94 } | 95 } |
| 95 - (BOOL)canRubberbandRight:(NSView*)view { | 96 - (BOOL)canRubberbandRight:(NSView*)view { |
| 96 return true; | 97 return true; |
| 97 } | 98 } |
| 98 | 99 |
| 99 @end | 100 @end |
| 100 | 101 |
| 101 namespace content { | 102 namespace content { |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 host->OnMessageReceived(*response2); | 786 host->OnMessageReceived(*response2); |
| 786 | 787 |
| 787 // Check that the view delegate ignored the empty unhandled wheel event. | 788 // Check that the view delegate ignored the empty unhandled wheel event. |
| 788 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); | 789 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); |
| 789 | 790 |
| 790 // Clean up. | 791 // Clean up. |
| 791 host->Shutdown(); | 792 host->Shutdown(); |
| 792 } | 793 } |
| 793 | 794 |
| 794 } // namespace content | 795 } // namespace content |
| OLD | NEW |