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. 4 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_ 7 8 #import <Cocoa/Cocoa.h> 9 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" 13 14 namespace content { 15 class RenderWidgetHost; 16 } 17 18 namespace ChromeRenderWidgetHostViewMacDelegateInternal { 19 class SpellCheckObserver; 20 } 21 22 @class HistorySwiper; 23 @interface ChromeRenderWidgetHostViewMacDelegate 24 : NSObject<RenderWidgetHostViewMacDelegate> { 25 @private 26 content::RenderWidgetHost* renderWidgetHost_; // weak 27 scoped_ptr<ChromeRenderWidgetHostViewMacDelegateInternal::SpellCheckObserver> 28 spellingObserver_; 29 30 // Used for continuous spell checking. 31 BOOL spellcheckEnabled_; 32 BOOL spellcheckChecked_; 33 34 // Responsible for 2-finger swipes history navigation. 35 base::scoped_nsobject<HistorySwiper> historySwiper_; 36 } 37 38 - (id)initWithRenderWidgetHost:(content::RenderWidgetHost*)renderWidgetHost; 39 40 - (void)viewGone:(NSView*)view; 41 - (BOOL)handleEvent:(NSEvent*)event; 42 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item 43 isValidItem:(BOOL*)valid; 44 @end 45 46 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_WIDGET_HOST_VIEW_MAC_DELEGATE_H_ 47