OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 10 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 NSView* parent_view); | 22 NSView* parent_view); |
23 virtual ~RenderViewContextMenuMac(); | 23 virtual ~RenderViewContextMenuMac(); |
24 | 24 |
25 // Elevate to public so that the obj-c target can call it. | 25 // Elevate to public so that the obj-c target can call it. |
26 void ExecuteCommand(int command_id) { ExecuteItemCommand(command_id); } | 26 void ExecuteCommand(int command_id) { ExecuteItemCommand(command_id); } |
27 | 27 |
28 protected: | 28 protected: |
29 // RenderViewContextMenu implementation- | 29 // RenderViewContextMenu implementation- |
30 virtual void DoInit(); | 30 virtual void DoInit(); |
31 virtual void AppendMenuItem(int id); | 31 virtual void AppendMenuItem(int id); |
32 virtual void AppendMenuItem(int id, const std::wstring& label); | 32 virtual void AppendMenuItem(int id, const string16& label); |
33 virtual void AppendRadioMenuItem(int id, const std::wstring& label); | 33 virtual void AppendRadioMenuItem(int id, const string16& label); |
34 virtual void AppendCheckboxMenuItem(int id, const std::wstring& label); | 34 virtual void AppendCheckboxMenuItem(int id, const string16& label); |
35 virtual void AppendSeparator(); | 35 virtual void AppendSeparator(); |
36 virtual void StartSubMenu(int id, const std::wstring& label); | 36 virtual void StartSubMenu(int id, const string16& label); |
37 virtual void FinishSubMenu(); | 37 virtual void FinishSubMenu(); |
38 | 38 |
39 // Do things like remove the windows accelerators. | 39 // Do things like remove the windows accelerators. |
40 static NSString* PrepareLabelForDisplay(const std::wstring& label); | 40 static NSString* PrepareLabelForDisplay(const string16& label); |
41 | 41 |
42 private: | 42 private: |
43 NSMenu* menu_; | 43 NSMenu* menu_; |
44 NSMenu* insert_menu_; // weak, where new items are inserted (usually | 44 NSMenu* insert_menu_; // weak, where new items are inserted (usually |
45 // |menu_| unless there's a submenu in progress). | 45 // |menu_| unless there's a submenu in progress). |
46 ContextMenuTarget* target_; // obj-c target for menu actions | 46 ContextMenuTarget* target_; // obj-c target for menu actions |
47 NSView* parent_view_; // parent view | 47 NSView* parent_view_; // parent view |
48 }; | 48 }; |
49 | 49 |
50 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ | 50 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_MAC_H_ |
OLD | NEW |