| 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/common/page_transition_types.h" | 21 #include "content/public/common/page_transition_types.h" |
| 22 #include "ui/base/models/simple_menu_model.h" | 22 #include "ui/base/models/simple_menu_model.h" |
| 23 #include "ui/base/window_open_disposition.h" | 23 #include "ui/base/window_open_disposition.h" |
| 24 | 24 |
| 25 class PrintPreviewContextMenuObserver; | 25 class PrintPreviewContextMenuObserver; |
| 26 class Profile; | 26 class Profile; |
| 27 class SpellingMenuObserver; | 27 class SpellingMenuObserver; |
| 28 class SpellCheckerSubMenuObserver; | 28 class SpellCheckerSubMenuObserver; |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 class RenderFrameHost; |
| 31 class RenderViewHost; | 32 class RenderViewHost; |
| 32 class WebContents; | 33 class WebContents; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace extensions { | 36 namespace extensions { |
| 36 class Extension; | 37 class Extension; |
| 37 class MenuItem; | 38 class MenuItem; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace gfx { | 41 namespace gfx { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 virtual content::RenderViewHost* GetRenderViewHost() const = 0; | 124 virtual content::RenderViewHost* GetRenderViewHost() const = 0; |
| 124 virtual content::WebContents* GetWebContents() const = 0; | 125 virtual content::WebContents* GetWebContents() const = 0; |
| 125 virtual Profile* GetProfile() const = 0; | 126 virtual Profile* GetProfile() const = 0; |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, | 129 class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| 129 public RenderViewContextMenuProxy { | 130 public RenderViewContextMenuProxy { |
| 130 public: | 131 public: |
| 131 static const size_t kMaxSelectionTextLength; | 132 static const size_t kMaxSelectionTextLength; |
| 132 | 133 |
| 133 RenderViewContextMenu(content::WebContents* web_contents, | 134 RenderViewContextMenu(content::RenderFrameHost* render_frame_host, |
| 134 const content::ContextMenuParams& params); | 135 const content::ContextMenuParams& params); |
| 135 | 136 |
| 136 virtual ~RenderViewContextMenu(); | 137 virtual ~RenderViewContextMenu(); |
| 137 | 138 |
| 138 // Initializes the context menu. | 139 // Initializes the context menu. |
| 139 void Init(); | 140 void Init(); |
| 140 | 141 |
| 141 // Programmatically closes the context menu. | 142 // Programmatically closes the context menu. |
| 142 void Cancel(); | 143 void Cancel(); |
| 143 | 144 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 173 // Platform specific functions. | 174 // Platform specific functions. |
| 174 virtual void PlatformInit() = 0; | 175 virtual void PlatformInit() = 0; |
| 175 virtual void PlatformCancel() = 0; | 176 virtual void PlatformCancel() = 0; |
| 176 virtual bool GetAcceleratorForCommandId( | 177 virtual bool GetAcceleratorForCommandId( |
| 177 int command_id, | 178 int command_id, |
| 178 ui::Accelerator* accelerator) = 0; | 179 ui::Accelerator* accelerator) = 0; |
| 179 virtual void AppendPlatformEditableItems(); | 180 virtual void AppendPlatformEditableItems(); |
| 180 | 181 |
| 181 content::ContextMenuParams params_; | 182 content::ContextMenuParams params_; |
| 182 content::WebContents* source_web_contents_; | 183 content::WebContents* source_web_contents_; |
| 184 // The RenderFrameHost's IDs. |
| 185 int render_process_id_; |
| 186 int render_frame_id_; |
| 183 Profile* profile_; | 187 Profile* profile_; |
| 184 | 188 |
| 185 ui::SimpleMenuModel menu_model_; | 189 ui::SimpleMenuModel menu_model_; |
| 186 extensions::ContextMenuMatcher extension_items_; | 190 extensions::ContextMenuMatcher extension_items_; |
| 187 | 191 |
| 188 private: | 192 private: |
| 189 friend class RenderViewContextMenuTest; | 193 friend class RenderViewContextMenuTest; |
| 190 friend class RenderViewContextMenuPrefsTest; | 194 friend class RenderViewContextMenuPrefsTest; |
| 191 | 195 |
| 192 static bool IsDevToolsURL(const GURL& url); | 196 static bool IsDevToolsURL(const GURL& url); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Guests are rendered inside chrome apps, but have most of the actions | 294 // Guests are rendered inside chrome apps, but have most of the actions |
| 291 // that a regular web page has. | 295 // that a regular web page has. |
| 292 // Currently actions/items that are suppressed from guests are: searching, | 296 // Currently actions/items that are suppressed from guests are: searching, |
| 293 // printing, speech and instant. | 297 // printing, speech and instant. |
| 294 bool is_guest_; | 298 bool is_guest_; |
| 295 | 299 |
| 296 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 300 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 297 }; | 301 }; |
| 298 | 302 |
| 299 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 303 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |