| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_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/renderer_context_menu/context_menu_content_type.h" | 17 #include "chrome/browser/renderer_context_menu/context_menu_content_type.h" |
| 18 #include "chrome/browser/renderer_context_menu/render_view_context_menu_observer
.h" | 18 #include "chrome/browser/renderer_context_menu/render_view_context_menu_observer
.h" |
| 19 #include "content/public/common/context_menu_params.h" | 19 #include "content/public/common/context_menu_params.h" |
| 20 #include "content/public/common/page_transition_types.h" | 20 #include "content/public/common/page_transition_types.h" |
| 21 #include "ui/base/models/simple_menu_model.h" | 21 #include "ui/base/models/simple_menu_model.h" |
| 22 #include "ui/base/window_open_disposition.h" | 22 #include "ui/base/window_open_disposition.h" |
| 23 | 23 |
| 24 class PrintPreviewContextMenuObserver; | 24 class PrintPreviewContextMenuObserver; |
| 25 class Profile; | 25 class Profile; |
| 26 class SpellingMenuObserver; | 26 class SpellingMenuObserver; |
| 27 class SpellCheckerSubMenuObserver; | 27 class SpellCheckerSubMenuObserver; |
| 28 class WebViewGuest; |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 class RenderFrameHost; | 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; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 private: | 192 private: |
| 192 friend class RenderViewContextMenuTest; | 193 friend class RenderViewContextMenuTest; |
| 193 friend class RenderViewContextMenuPrefsTest; | 194 friend class RenderViewContextMenuPrefsTest; |
| 194 | 195 |
| 195 static bool IsDevToolsURL(const GURL& url); | 196 static bool IsDevToolsURL(const GURL& url); |
| 196 static bool IsInternalResourcesURL(const GURL& url); | 197 static bool IsInternalResourcesURL(const GURL& url); |
| 197 static bool ExtensionContextAndPatternMatch( | 198 static bool ExtensionContextAndPatternMatch( |
| 198 const content::ContextMenuParams& params, | 199 const content::ContextMenuParams& params, |
| 199 extensions::MenuItem::ContextList contexts, | 200 extensions::MenuItem::ContextList contexts, |
| 200 const extensions::URLPatternSet& target_url_patterns); | 201 const extensions::URLPatternSet& target_url_patterns); |
| 201 static bool MenuItemMatchesParams( | 202 // |guest| is NULL for not <webview> cases. |
| 202 const content::ContextMenuParams& params, | 203 static bool MenuItemMatchesParams(const content::ContextMenuParams& params, |
| 203 const extensions::MenuItem* item); | 204 const WebViewGuest* guest, |
| 205 const extensions::MenuItem* item); |
| 204 | 206 |
| 205 // Gets the extension (if any) associated with the WebContents that we're in. | 207 // Gets the extension (if any) associated with the WebContents that we're in. |
| 206 const extensions::Extension* GetExtension() const; | 208 const extensions::Extension* GetExtension() const; |
| 207 bool AppendCustomItems(); | 209 bool AppendCustomItems(); |
| 208 | 210 |
| 209 void AppendDeveloperItems(); | 211 void AppendDeveloperItems(); |
| 210 void AppendDevtoolsForUnpackedExtensions(); | 212 void AppendDevtoolsForUnpackedExtensions(); |
| 211 void AppendLinkItems(); | 213 void AppendLinkItems(); |
| 212 void AppendImageItems(); | 214 void AppendImageItems(); |
| 213 void AppendAudioItems(); | 215 void AppendAudioItems(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Whether a command has been executed. Used to track whether menu observers | 290 // Whether a command has been executed. Used to track whether menu observers |
| 289 // should be notified of menu closing without execution. | 291 // should be notified of menu closing without execution. |
| 290 bool command_executed_; | 292 bool command_executed_; |
| 291 | 293 |
| 292 scoped_ptr<ContextMenuContentType> content_type_; | 294 scoped_ptr<ContextMenuContentType> content_type_; |
| 293 | 295 |
| 294 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 296 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 295 }; | 297 }; |
| 296 | 298 |
| 297 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 299 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |