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 #include "components/renderer_context_menu/render_view_context_menu_base.h" | 5 #include "components/renderer_context_menu/render_view_context_menu_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 | 155 |
156 RenderViewContextMenuBase::RenderViewContextMenuBase( | 156 RenderViewContextMenuBase::RenderViewContextMenuBase( |
157 content::RenderFrameHost* render_frame_host, | 157 content::RenderFrameHost* render_frame_host, |
158 const content::ContextMenuParams& params) | 158 const content::ContextMenuParams& params) |
159 : params_(params), | 159 : params_(params), |
160 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), | 160 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), |
161 browser_context_(source_web_contents_->GetBrowserContext()), | 161 browser_context_(source_web_contents_->GetBrowserContext()), |
162 menu_model_(this), | 162 menu_model_(this), |
163 render_frame_id_(render_frame_host->GetRoutingID()), | 163 render_frame_id_(render_frame_host->GetRoutingID()), |
164 command_executed_(false), | 164 render_process_id_(render_frame_host->GetProcess()->GetID()), |
165 render_process_id_(render_frame_host->GetProcess()->GetID()) { | 165 command_executed_(false) {} |
166 } | |
167 | 166 |
168 RenderViewContextMenuBase::~RenderViewContextMenuBase() { | 167 RenderViewContextMenuBase::~RenderViewContextMenuBase() { |
169 } | 168 } |
170 | 169 |
171 // Menu construction functions ------------------------------------------------- | 170 // Menu construction functions ------------------------------------------------- |
172 | 171 |
173 void RenderViewContextMenuBase::Init() { | 172 void RenderViewContextMenuBase::Init() { |
174 // Command id range must have been already initializerd. | 173 // Command id range must have been already initializerd. |
175 DCHECK_NE(-1, content_context_custom_first); | 174 DCHECK_NE(-1, content_context_custom_first); |
176 DCHECK_NE(-1, content_context_custom_last); | 175 DCHECK_NE(-1, content_context_custom_last); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 NotifyURLOpened(url, new_contents); | 405 NotifyURLOpened(url, new_contents); |
407 } | 406 } |
408 | 407 |
409 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 408 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
410 return IsCustomItemCheckedInternal(params_.custom_items, id); | 409 return IsCustomItemCheckedInternal(params_.custom_items, id); |
411 } | 410 } |
412 | 411 |
413 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 412 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
414 return IsCustomItemEnabledInternal(params_.custom_items, id); | 413 return IsCustomItemEnabledInternal(params_.custom_items, id); |
415 } | 414 } |
OLD | NEW |