Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.h

Issue 186213003: <webview>: Context menu API implementation CL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make {extension_id,webview_instance_id} key for MenuManager items. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 static bool MenuItemMatchesParams(const content::ContextMenuParams& params,
202 const content::ContextMenuParams& params, 203 const extensions::MenuItem* item);
203 const extensions::MenuItem* item);
204 204
205 // Gets the extension (if any) associated with the WebContents that we're in. 205 // Gets the extension (if any) associated with the WebContents that we're in.
206 const extensions::Extension* GetExtension() const; 206 const extensions::Extension* GetExtension() const;
207 bool AppendCustomItems(); 207 bool AppendCustomItems();
208 208
209 void AppendDeveloperItems(); 209 void AppendDeveloperItems();
210 void AppendDevtoolsForUnpackedExtensions(); 210 void AppendDevtoolsForUnpackedExtensions();
211 void AppendLinkItems(); 211 void AppendLinkItems();
212 void AppendImageItems(); 212 void AppendImageItems();
213 void AppendAudioItems(); 213 void AppendAudioItems();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // Whether a command has been executed. Used to track whether menu observers 288 // Whether a command has been executed. Used to track whether menu observers
289 // should be notified of menu closing without execution. 289 // should be notified of menu closing without execution.
290 bool command_executed_; 290 bool command_executed_;
291 291
292 scoped_ptr<ContextMenuContentType> content_type_; 292 scoped_ptr<ContextMenuContentType> content_type_;
293 293
294 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); 294 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu);
295 }; 295 };
296 296
297 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ 297 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698