OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #import "base/memory/scoped_ptr.h" | 11 #import "base/memory/scoped_ptr.h" |
12 #import "content/browser/renderer_host/render_widget_host_view_mac_delegate.h" | 12 #import "content/browser/renderer_host/render_widget_host_view_mac_delegate.h" |
13 | 13 |
14 class RenderWidgetHost; | 14 class RenderWidgetHost; |
15 | 15 |
16 namespace ChromeRenderWidgetHostViewMacDelegateInternal { | 16 namespace ChromeRenderWidgetHostViewMacDelegateInternal { |
17 class SpellCheckRenderViewObserver; | 17 class SpellCheckRenderViewObserver; |
18 } | 18 } |
19 | 19 |
20 @interface ChromeRenderWidgetHostViewMacDelegate | 20 @interface ChromeRenderWidgetHostViewMacDelegate |
21 : NSObject<RenderWidgetHostViewMacDelegate> { | 21 : NSObject<RenderWidgetHostViewMacDelegate> { |
22 @private | 22 @private |
23 RenderWidgetHost* render_widget_host_; // weak | 23 RenderWidgetHost* renderWidgetHost_; // weak |
24 scoped_ptr<ChromeRenderWidgetHostViewMacDelegateInternal:: | 24 scoped_ptr<ChromeRenderWidgetHostViewMacDelegateInternal:: |
25 SpellCheckRenderViewObserver> spelling_observer_; | 25 SpellCheckRenderViewObserver> spellingObserver_; |
26 | 26 |
27 // If the viewport is scrolled all the way to the left or right. | 27 // If the viewport is scrolled all the way to the left or right. |
28 // Used for history swiping. | 28 // Used for history swiping. |
29 BOOL isPinnedLeft_; | 29 BOOL isPinnedLeft_; |
30 BOOL isPinnedRight_; | 30 BOOL isPinnedRight_; |
31 | 31 |
32 // If the main frame has a horizontal scrollbar. | 32 // If the main frame has a horizontal scrollbar. |
33 // Used for history swiping. | 33 // Used for history swiping. |
34 BOOL hasHorizontalScrollbar_; | 34 BOOL hasHorizontalScrollbar_; |
35 | 35 |
36 // If a scroll event came back unhandled from the renderer. Set to |NO| at | 36 // If a scroll event came back unhandled from the renderer. Set to |NO| at |
37 // the start of a scroll gesture, and then to |YES| if a scroll event comes | 37 // the start of a scroll gesture, and then to |YES| if a scroll event comes |
38 // back unhandled from the renderer. | 38 // back unhandled from the renderer. |
39 // Used for history swiping. | 39 // Used for history swiping. |
40 BOOL gotUnhandledWheelEvent_; | 40 BOOL gotUnhandledWheelEvent_; |
41 | 41 |
42 // Cumulative scroll delta since scroll gesture start. Only valid during | 42 // Cumulative scroll delta since scroll gesture start. Only valid during |
43 // scroll gesture handling. Used for history swiping. | 43 // scroll gesture handling. Used for history swiping. |
44 NSSize totalScrollDelta_; | 44 NSSize totalScrollDelta_; |
45 | 45 |
46 // Used for continuous spell checking. | 46 // Used for continuous spell checking. |
47 BOOL spellcheck_enabled_; | 47 BOOL spellcheckEnabled_; |
48 BOOL spellcheck_checked_; | 48 BOOL spellcheckChecked_; |
49 } | 49 } |
50 | 50 |
51 - (id)initWithRenderWidgetHost:(RenderWidgetHost*)render_widget_host; | 51 - (id)initWithRenderWidgetHost:(RenderWidgetHost*)renderWidgetHost; |
52 | 52 |
53 - (void)viewGone:(NSView*)view; | 53 - (void)viewGone:(NSView*)view; |
54 - (BOOL)handleEvent:(NSEvent*)event; | 54 - (BOOL)handleEvent:(NSEvent*)event; |
55 - (void)gotUnhandledWheelEvent; | 55 - (void)gotUnhandledWheelEvent; |
56 - (void)scrollOffsetPinnedToLeft:(BOOL)left toRight:(BOOL)right; | 56 - (void)scrollOffsetPinnedToLeft:(BOOL)left toRight:(BOOL)right; |
57 - (void)setHasHorizontalScrollbar:(BOOL)has_horizontal_scrollbar; | 57 - (void)setHasHorizontalScrollbar:(BOOL)hasHorizontalScrollbar; |
58 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item | 58 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item |
59 isValidItem:(BOOL*)valid; | 59 isValidItem:(BOOL*)valid; |
60 | 60 |
61 @end | 61 @end |
62 | 62 |
63 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_
H_ | 63 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_
H_ |
OLD | NEW |