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_MAC_DELEGATE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_MAC_DELEGATE_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #import "content/public/browser/render_widget_host_view_mac_delegate.h"
15 class RenderWidgetHost
;
18 namespace ChromeRenderWidgetHostViewMacDelegateInternal
{
19 class SpellCheckObserver
;
23 @interface ChromeRenderWidgetHostViewMacDelegate
24 : NSObject
<RenderWidgetHostViewMacDelegate
> {
26 content::RenderWidgetHost
* renderWidgetHost_
; // weak
27 scoped_ptr
<ChromeRenderWidgetHostViewMacDelegateInternal::SpellCheckObserver
>
30 // Used for continuous spell checking.
31 BOOL spellcheckEnabled_
;
32 BOOL spellcheckChecked_
;
34 // Responsible for 2-finger swipes history navigation.
35 base::scoped_nsobject
<HistorySwiper
> historySwiper_
;
38 - (id
)initWithRenderWidgetHost
:(content::RenderWidgetHost
*)renderWidgetHost
;
40 - (void)viewGone
:(NSView
*)view
;
41 - (BOOL
)handleEvent
:(NSEvent
*)event
;
42 - (void)gotUnhandledWheelEvent
;
43 - (void)scrollOffsetPinnedToLeft
:(BOOL
)left toRight
:(BOOL
)right
;
44 - (void)setHasHorizontalScrollbar
:(BOOL
)hasHorizontalScrollbar
;
45 - (BOOL
)validateUserInterfaceItem
:(id
<NSValidatedUserInterfaceItem
>)item
46 isValidItem
:(BOOL
*)valid
;
50 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_MAC_DELEGATE_H_