| 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_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 15 #include "chrome/browser/extensions/context_menu_matcher.h" | 15 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 16 #include "chrome/browser/extensions/menu_manager.h" | 16 #include "chrome/browser/extensions/menu_manager.h" |
| 17 #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" | 17 #include "chrome/browser/renderer_context_menu/render_view_context_menu_observer
.h" |
| 18 #include "content/public/common/context_menu_params.h" | 18 #include "content/public/common/context_menu_params.h" |
| 19 #include "content/public/common/page_transition_types.h" | 19 #include "content/public/common/page_transition_types.h" |
| 20 #include "ui/base/models/simple_menu_model.h" | 20 #include "ui/base/models/simple_menu_model.h" |
| 21 #include "ui/base/window_open_disposition.h" | 21 #include "ui/base/window_open_disposition.h" |
| 22 | 22 |
| 23 class PrintPreviewContextMenuObserver; | 23 class PrintPreviewContextMenuObserver; |
| 24 class Profile; | 24 class Profile; |
| 25 class SpellingMenuObserver; | 25 class SpellingMenuObserver; |
| 26 class SpellCheckerSubMenuObserver; | 26 class SpellCheckerSubMenuObserver; |
| 27 | 27 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 const ui::MenuModel& menu_model() const { return menu_model_; } | 143 const ui::MenuModel& menu_model() const { return menu_model_; } |
| 144 | 144 |
| 145 // SimpleMenuModel::Delegate implementation. | 145 // SimpleMenuModel::Delegate implementation. |
| 146 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 146 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| 147 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 147 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| 148 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 148 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
| 149 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; | 149 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; |
| 150 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; | 150 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; |
| 151 | 151 |
| 152 // RenderViewContextMenuDelegate implementation. | 152 // RenderViewContextMenuProxy implementation. |
| 153 virtual void AddMenuItem(int command_id, | 153 virtual void AddMenuItem(int command_id, |
| 154 const base::string16& title) OVERRIDE; | 154 const base::string16& title) OVERRIDE; |
| 155 virtual void AddCheckItem(int command_id, | 155 virtual void AddCheckItem(int command_id, |
| 156 const base::string16& title) OVERRIDE; | 156 const base::string16& title) OVERRIDE; |
| 157 virtual void AddSeparator() OVERRIDE; | 157 virtual void AddSeparator() OVERRIDE; |
| 158 virtual void AddSubMenu(int command_id, | 158 virtual void AddSubMenu(int command_id, |
| 159 const base::string16& label, | 159 const base::string16& label, |
| 160 ui::MenuModel* model) OVERRIDE; | 160 ui::MenuModel* model) OVERRIDE; |
| 161 virtual void UpdateMenuItem(int command_id, | 161 virtual void UpdateMenuItem(int command_id, |
| 162 bool enabled, | 162 bool enabled, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Whether or not the menu was triggered for a browser plugin guest. | 290 // Whether or not the menu was triggered for a browser plugin guest. |
| 291 // Guests are rendered inside chrome apps, but have most of the actions | 291 // Guests are rendered inside chrome apps, but have most of the actions |
| 292 // that a regular web page has. | 292 // that a regular web page has. |
| 293 // Currently actions/items that are suppressed from guests are: searching, | 293 // Currently actions/items that are suppressed from guests are: searching, |
| 294 // printing, speech and instant. | 294 // printing, speech and instant. |
| 295 bool is_guest_; | 295 bool is_guest_; |
| 296 | 296 |
| 297 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 297 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 298 }; | 298 }; |
| 299 | 299 |
| 300 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 300 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |