OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 // Factory function to create an instance. | 27 // Factory function to create an instance. |
28 static RenderViewContextMenuViews* Create( | 28 static RenderViewContextMenuViews* Create( |
29 content::WebContents* web_contents, | 29 content::WebContents* web_contents, |
30 const content::ContextMenuParams& params); | 30 const content::ContextMenuParams& params); |
31 | 31 |
32 void RunMenuAt(views::Widget* parent, | 32 void RunMenuAt(views::Widget* parent, |
33 const gfx::Point& point, | 33 const gfx::Point& point, |
34 ui::MenuSourceType type); | 34 ui::MenuSourceType type); |
35 | 35 |
36 #if !defined(OS_WIN) | |
Peter Kasting
2013/11/22 21:53:03
Don't add so many #ifs. Use as few #ifs as possib
pals
2013/11/25 06:28:13
Done. Moved all the changes to a single #if.
| |
37 // SimpleMenuModel::Delegate implementation. | |
Peter Kasting
2013/11/22 21:53:03
You don't inherit from SimpleMenuModel::Delegate.
pals
2013/11/25 06:28:13
Done. Moved to private.
| |
38 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | |
39 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
40 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
41 #endif // !OS_WIN | |
42 | |
36 // RenderViewContextMenuDelegate implementation. | 43 // RenderViewContextMenuDelegate implementation. |
37 virtual void UpdateMenuItem(int command_id, | 44 virtual void UpdateMenuItem(int command_id, |
38 bool enabled, | 45 bool enabled, |
39 bool hidden, | 46 bool hidden, |
40 const string16& title) OVERRIDE; | 47 const string16& title) OVERRIDE; |
41 | 48 |
42 protected: | 49 protected: |
43 RenderViewContextMenuViews(content::WebContents* web_contents, | 50 RenderViewContextMenuViews(content::WebContents* web_contents, |
44 const content::ContextMenuParams& params); | 51 const content::ContextMenuParams& params); |
45 // RenderViewContextMenu implementation. | 52 // RenderViewContextMenu implementation. |
Peter Kasting
2013/11/22 21:53:03
Nit: While here: blank line above this
pals
2013/11/25 06:28:13
Done.
| |
46 virtual void PlatformInit() OVERRIDE; | 53 virtual void PlatformInit() OVERRIDE; |
47 virtual void PlatformCancel() OVERRIDE; | 54 virtual void PlatformCancel() OVERRIDE; |
48 virtual bool GetAcceleratorForCommandId( | 55 virtual bool GetAcceleratorForCommandId( |
49 int command_id, | 56 int command_id, |
50 ui::Accelerator* accelerator) OVERRIDE; | 57 ui::Accelerator* accelerator) OVERRIDE; |
58 #if !defined(OS_WIN) | |
59 virtual void AppendPlatformEditableItems() OVERRIDE; | |
60 #endif // !OS_WIN | |
51 | 61 |
52 private: | 62 private: |
63 #if !defined(OS_WIN) | |
64 // Adds writing direction submenu. | |
65 void AppendBidiSubMenu(); | |
66 | |
67 // Model for the BiDi input submenu. | |
68 ui::SimpleMenuModel bidi_submenu_model_; | |
69 #endif // !OS_WIN | |
70 | |
53 scoped_ptr<views::MenuRunner> menu_runner_; | 71 scoped_ptr<views::MenuRunner> menu_runner_; |
54 | 72 |
55 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); | 73 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); |
56 }; | 74 }; |
57 | 75 |
58 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H _ | 76 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H _ |
OLD | NEW |