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_CONTEXT_MENU_CONTENT_TYPE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_CONTEXT_MENU_CONTENT_TYPE_H_ |
6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_CONTEXT_MENU_CONTENT_TYPE_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_CONTEXT_MENU_CONTENT_TYPE_H_ |
7 | 7 |
8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
9 #include "content/public/common/context_menu_params.h" | 9 #include "content/public/common/context_menu_params.h" |
10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const content::ContextMenuParams& params); | 58 const content::ContextMenuParams& params); |
59 | 59 |
60 // Returns if |group| is enabled. | 60 // Returns if |group| is enabled. |
61 virtual bool SupportsGroup(int group); | 61 virtual bool SupportsGroup(int group); |
62 | 62 |
63 protected: | 63 protected: |
64 ContextMenuContentType(content::RenderFrameHost* render_frame_host, | 64 ContextMenuContentType(content::RenderFrameHost* render_frame_host, |
65 const content::ContextMenuParams& params, | 65 const content::ContextMenuParams& params, |
66 bool supports_custom_items); | 66 bool supports_custom_items); |
67 | 67 |
| 68 const content::ContextMenuParams& params() const { return params_; } |
| 69 |
68 const extensions::Extension* GetExtension() const; | 70 const extensions::Extension* GetExtension() const; |
69 | 71 |
70 content::ContextMenuParams params_; | |
71 content::WebContents* source_web_contents_; | |
72 Profile* profile_; | |
73 bool supports_custom_items_; | |
74 bool has_custom_items_; | |
75 | |
76 private: | 72 private: |
77 friend class ContextMenuContentTypeFactory; | 73 friend class ContextMenuContentTypeFactory; |
78 friend class ContextMenuContentTypeTest; | 74 friend class ContextMenuContentTypeTest; |
79 | 75 |
80 bool HasCustomItems(const std::vector<content::MenuItem>& items) const; | |
81 void Initialize(); | |
82 bool SupportsGroupInternal(int group); | 76 bool SupportsGroupInternal(int group); |
83 | 77 |
| 78 const content::ContextMenuParams params_; |
| 79 content::WebContents* source_web_contents_; |
| 80 Profile* profile_; |
| 81 const bool supports_custom_items_; |
| 82 |
84 DISALLOW_COPY_AND_ASSIGN(ContextMenuContentType); | 83 DISALLOW_COPY_AND_ASSIGN(ContextMenuContentType); |
85 }; | 84 }; |
86 | 85 |
87 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_CONTEXT_MENU_CONTENT_TYPE_H_ | 86 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_CONTEXT_MENU_CONTENT_TYPE_H_ |
OLD | NEW |