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

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

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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 <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 16 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "components/renderer_context_menu/context_menu_content_type.h" 18 #include "components/renderer_context_menu/context_menu_content_type.h"
19 #include "components/renderer_context_menu/render_view_context_menu_base.h" 19 #include "components/renderer_context_menu/render_view_context_menu_base.h"
20 #include "components/renderer_context_menu/render_view_context_menu_observer.h" 20 #include "components/renderer_context_menu/render_view_context_menu_observer.h"
21 #include "components/renderer_context_menu/render_view_context_menu_proxy.h" 21 #include "components/renderer_context_menu/render_view_context_menu_proxy.h"
22 #include "content/public/common/context_menu_params.h" 22 #include "content/public/common/context_menu_params.h"
23 #include "extensions/features/features.h"
23 #include "printing/features/features.h" 24 #include "printing/features/features.h"
24 #include "ui/base/models/simple_menu_model.h" 25 #include "ui/base/models/simple_menu_model.h"
25 #include "ui/base/window_open_disposition.h" 26 #include "ui/base/window_open_disposition.h"
26 #include "ui/gfx/geometry/vector2d.h" 27 #include "ui/gfx/geometry/vector2d.h"
27 28
28 #if defined(ENABLE_EXTENSIONS) 29 #if BUILDFLAG(ENABLE_EXTENSIONS)
29 #include "chrome/browser/extensions/context_menu_matcher.h" 30 #include "chrome/browser/extensions/context_menu_matcher.h"
30 #include "chrome/browser/extensions/menu_manager.h" 31 #include "chrome/browser/extensions/menu_manager.h"
31 #endif 32 #endif
32 33
33 class OpenWithMenuObserver; 34 class OpenWithMenuObserver;
34 class PrintPreviewContextMenuObserver; 35 class PrintPreviewContextMenuObserver;
35 class Profile; 36 class Profile;
36 class SpellingMenuObserver; 37 class SpellingMenuObserver;
37 class SpellingOptionsSubMenuObserver; 38 class SpellingOptionsSubMenuObserver;
38 39
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 protected: 83 protected:
83 Profile* GetProfile(); 84 Profile* GetProfile();
84 85
85 // Returns a (possibly truncated) version of the current selection text 86 // Returns a (possibly truncated) version of the current selection text
86 // suitable for putting in the title of a menu item. 87 // suitable for putting in the title of a menu item.
87 base::string16 PrintableSelectionText(); 88 base::string16 PrintableSelectionText();
88 89
89 // Helper function to escape "&" as "&&". 90 // Helper function to escape "&" as "&&".
90 void EscapeAmpersands(base::string16* text); 91 void EscapeAmpersands(base::string16* text);
91 92
92 #if defined(ENABLE_EXTENSIONS) 93 #if BUILDFLAG(ENABLE_EXTENSIONS)
93 extensions::ContextMenuMatcher extension_items_; 94 extensions::ContextMenuMatcher extension_items_;
94 #endif 95 #endif
95 void RecordUsedItem(int id) override; 96 void RecordUsedItem(int id) override;
96 97
97 // Returns true if the browser is in HTML fullscreen mode, initiated by the 98 // Returns true if the browser is in HTML fullscreen mode, initiated by the
98 // page (as opposed to the user). Used to determine which shortcut to display. 99 // page (as opposed to the user). Used to determine which shortcut to display.
99 bool IsHTML5Fullscreen() const; 100 bool IsHTML5Fullscreen() const;
100 101
101 private: 102 private:
102 friend class RenderViewContextMenuTest; 103 friend class RenderViewContextMenuTest;
103 friend class TestRenderViewContextMenu; 104 friend class TestRenderViewContextMenu;
104 105
105 static bool IsDevToolsURL(const GURL& url); 106 static bool IsDevToolsURL(const GURL& url);
106 static bool IsInternalResourcesURL(const GURL& url); 107 static bool IsInternalResourcesURL(const GURL& url);
107 #if defined(ENABLE_EXTENSIONS) 108 #if BUILDFLAG(ENABLE_EXTENSIONS)
108 static bool ExtensionContextAndPatternMatch( 109 static bool ExtensionContextAndPatternMatch(
109 const content::ContextMenuParams& params, 110 const content::ContextMenuParams& params,
110 const extensions::MenuItem::ContextList& contexts, 111 const extensions::MenuItem::ContextList& contexts,
111 const extensions::URLPatternSet& target_url_patterns); 112 const extensions::URLPatternSet& target_url_patterns);
112 static bool MenuItemMatchesParams(const content::ContextMenuParams& params, 113 static bool MenuItemMatchesParams(const content::ContextMenuParams& params,
113 const extensions::MenuItem* item); 114 const extensions::MenuItem* item);
114 #endif 115 #endif
115 116
116 // RenderViewContextMenuBase: 117 // RenderViewContextMenuBase:
117 void InitMenu() override; 118 void InitMenu() override;
(...skipping 21 matching lines...) Expand all
139 void AppendPageItems(); 140 void AppendPageItems();
140 void AppendExitFullscreenItem(); 141 void AppendExitFullscreenItem();
141 void AppendCopyItem(); 142 void AppendCopyItem();
142 void AppendPrintItem(); 143 void AppendPrintItem();
143 void AppendMediaRouterItem(); 144 void AppendMediaRouterItem();
144 void AppendRotationItems(); 145 void AppendRotationItems();
145 void AppendEditableItems(); 146 void AppendEditableItems();
146 void AppendLanguageSettings(); 147 void AppendLanguageSettings();
147 void AppendSpellingSuggestionItems(); 148 void AppendSpellingSuggestionItems();
148 void AppendSearchProvider(); 149 void AppendSearchProvider();
149 #if defined(ENABLE_EXTENSIONS) 150 #if BUILDFLAG(ENABLE_EXTENSIONS)
150 void AppendAllExtensionItems(); 151 void AppendAllExtensionItems();
151 void AppendCurrentExtensionItems(); 152 void AppendCurrentExtensionItems();
152 #endif 153 #endif
153 void AppendPrintPreviewItems(); 154 void AppendPrintPreviewItems();
154 void AppendSearchWebForImageItems(); 155 void AppendSearchWebForImageItems();
155 void AppendProtocolHandlerSubMenu(); 156 void AppendProtocolHandlerSubMenu();
156 void AppendPasswordItems(); 157 void AppendPasswordItems();
157 158
158 // Command enabled query functions. 159 // Command enabled query functions.
159 bool IsReloadEnabled() const; 160 bool IsReloadEnabled() const;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 244
244 // In the case of a MimeHandlerView this will point to the WebContents that 245 // In the case of a MimeHandlerView this will point to the WebContents that
245 // embeds the MimeHandlerViewGuest. Otherwise this will be the same as 246 // embeds the MimeHandlerViewGuest. Otherwise this will be the same as
246 // |source_web_contents_|. 247 // |source_web_contents_|.
247 content::WebContents* const embedder_web_contents_; 248 content::WebContents* const embedder_web_contents_;
248 249
249 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); 250 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu);
250 }; 251 };
251 252
252 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ 253 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698