| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Update the status and text of the specified context-menu item. | 116 // Update the status and text of the specified context-menu item. |
| 117 virtual void UpdateMenuItem(int command_id, | 117 virtual void UpdateMenuItem(int command_id, |
| 118 bool enabled, | 118 bool enabled, |
| 119 bool hidden, | 119 bool hidden, |
| 120 const string16& title) = 0; | 120 const string16& title) = 0; |
| 121 | 121 |
| 122 // Retrieve the given associated objects with a context menu. | 122 // Retrieve the given associated objects with a context menu. |
| 123 virtual content::RenderViewHost* GetRenderViewHost() const = 0; | 123 virtual content::RenderViewHost* GetRenderViewHost() const = 0; |
| 124 virtual content::WebContents* GetWebContents() const = 0; | 124 virtual content::WebContents* GetWebContents() const = 0; |
| 125 virtual Profile* GetProfile() const = 0; | 125 virtual Profile* GetProfile() const = 0; |
| 126 |
| 127 protected: |
| 128 virtual ~RenderViewContextMenuProxy() { } |
| 126 }; | 129 }; |
| 127 | 130 |
| 128 class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, | 131 class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| 129 public RenderViewContextMenuProxy { | 132 public RenderViewContextMenuProxy { |
| 130 public: | 133 public: |
| 131 static const size_t kMaxSelectionTextLength; | 134 static const size_t kMaxSelectionTextLength; |
| 132 | 135 |
| 133 RenderViewContextMenu(content::WebContents* web_contents, | 136 RenderViewContextMenu(content::WebContents* web_contents, |
| 134 const content::ContextMenuParams& params); | 137 const content::ContextMenuParams& params); |
| 135 | 138 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // An observer that disables menu items when print preview is active. | 278 // An observer that disables menu items when print preview is active. |
| 276 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; | 279 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; |
| 277 | 280 |
| 278 // Our observers. | 281 // Our observers. |
| 279 mutable ObserverList<RenderViewContextMenuObserver> observers_; | 282 mutable ObserverList<RenderViewContextMenuObserver> observers_; |
| 280 | 283 |
| 281 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 284 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 282 }; | 285 }; |
| 283 | 286 |
| 284 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 287 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |