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

Side by Side Diff: components/renderer_context_menu/render_view_context_menu_base.h

Issue 541753003: Use stored render_frame_id_ instead of using GetRenderFrameHost(), as it may return NULL (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 3 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 COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ 5 #ifndef COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_
6 #define COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ 6 #define COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void OpenURL(const GURL& url, const GURL& referrer, 159 void OpenURL(const GURL& url, const GURL& referrer,
160 WindowOpenDisposition disposition, 160 WindowOpenDisposition disposition,
161 content::PageTransition transition); 161 content::PageTransition transition);
162 162
163 content::ContextMenuParams params_; 163 content::ContextMenuParams params_;
164 content::WebContents* source_web_contents_; 164 content::WebContents* source_web_contents_;
165 content::BrowserContext* browser_context_; 165 content::BrowserContext* browser_context_;
166 166
167 ui::SimpleMenuModel menu_model_; 167 ui::SimpleMenuModel menu_model_;
168 168
169 // Renderer's frame id.
170 int render_frame_id_;
171
169 // Our observers. 172 // Our observers.
170 mutable ObserverList<RenderViewContextMenuObserver> observers_; 173 mutable ObserverList<RenderViewContextMenuObserver> observers_;
171 174
172 // Whether a command has been executed. Used to track whether menu observers 175 // Whether a command has been executed. Used to track whether menu observers
173 // should be notified of menu closing without execution. 176 // should be notified of menu closing without execution.
174 bool command_executed_; 177 bool command_executed_;
175 178
176 scoped_ptr<ContextMenuContentType> content_type_; 179 scoped_ptr<ContextMenuContentType> content_type_;
177 180
178 private: 181 private:
179 bool AppendCustomItems(); 182 bool AppendCustomItems();
180 183
181 // The RenderFrameHost's IDs. 184 // The RenderFrameHost's IDs.
182 int render_process_id_; 185 int render_process_id_;
183 int render_frame_id_;
184 186
185 scoped_ptr<ToolkitDelegate> toolkit_delegate_; 187 scoped_ptr<ToolkitDelegate> toolkit_delegate_;
186 188
187 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); 189 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase);
188 }; 190 };
189 191
190 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ 192 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698