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
3 // found in the LICENSE file.
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_
8 #import <Cocoa/Cocoa.h>
10 #include "base/memory/scoped_ptr.h"
11 #import "content/public/browser/render_widget_host_view_mac_delegate.h"
14 class RenderWidgetHost
;
17 namespace ChromeRenderWidgetHostViewMacDelegateInternal
{
18 class SpellCheckRenderViewObserver
;
21 @interface ChromeRenderWidgetHostViewMacDelegate
22 : NSObject
<RenderWidgetHostViewMacDelegate
> {
24 content::RenderWidgetHost
* renderWidgetHost_
; // weak
25 scoped_ptr
<ChromeRenderWidgetHostViewMacDelegateInternal::
26 SpellCheckRenderViewObserver
> spellingObserver_
;
28 // If the viewport is scrolled all the way to the left or right.
29 // Used for history swiping.
33 // If the main frame has a horizontal scrollbar.
34 // Used for history swiping.
35 BOOL hasHorizontalScrollbar_
;
37 // If a scroll event came back unhandled from the renderer. Set to |NO| at
38 // the start of a scroll gesture, and then to |YES| if a scroll event comes
39 // back unhandled from the renderer.
40 // Used for history swiping.
41 BOOL gotUnhandledWheelEvent_
;
43 // Cumulative scroll delta since scroll gesture start. Only valid during
44 // scroll gesture handling. Used for history swiping.
45 NSSize totalScrollDelta_
;
47 // Used for continuous spell checking.
48 BOOL spellcheckEnabled_
;
49 BOOL spellcheckChecked_
;
52 - (id
)initWithRenderWidgetHost
:(content::RenderWidgetHost
*)renderWidgetHost
;
54 - (void)viewGone
:(NSView
*)view
;
55 - (BOOL
)handleEvent
:(NSEvent
*)event
;
56 - (void)gotUnhandledWheelEvent
;
57 - (void)scrollOffsetPinnedToLeft
:(BOOL
)left toRight
:(BOOL
)right
;
58 - (void)setHasHorizontalScrollbar
:(BOOL
)hasHorizontalScrollbar
;
59 - (BOOL
)validateUserInterfaceItem
:(id
<NSValidatedUserInterfaceItem
>)item
60 isValidItem
:(BOOL
*)valid
;
64 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_