render_view_context_menu_mac.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1// Copyright (c) 2010 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ 6#define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ 7 8#import <Cocoa/Cocoa.h> 9 10#include "base/scoped_nsobject.h" 11#include "chrome/browser/tab_contents/render_view_context_menu.h" 12 13@class MenuController; 14 15// Mac implementation of the context menu display code. Uses a Cocoa NSMenu 16// to display the context menu. Internally uses an obj-c object as the 17// target of the NSMenu, bridging back to this C++ class. 18 19class RenderViewContextMenuMac : public RenderViewContextMenu { 20 public: 21 RenderViewContextMenuMac(TabContents* web_contents, 22 const ContextMenuParams& params, 23 NSView* parent_view); 24 virtual ~RenderViewContextMenuMac(); 25 26 protected: 27 // RenderViewContextMenu implementation- 28 virtual void PlatformInit(); 29 virtual bool GetAcceleratorForCommandId( 30 int command_id, 31 menus::Accelerator* accelerator) { 32 return false; 33 } 34 35 private: 36 scoped_nsobject<MenuController> menuController_; 37 NSView* parent_view_; // parent view 38}; 39 40#endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ 41