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 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool RenderViewContextMenuBase::IsContentCustomCommandId(int id) { | 162 bool RenderViewContextMenuBase::IsContentCustomCommandId(int id) { |
163 return id >= content_context_custom_first && | 163 return id >= content_context_custom_first && |
164 id <= content_context_custom_last; | 164 id <= content_context_custom_last; |
165 } | 165 } |
166 | 166 |
167 RenderViewContextMenuBase::RenderViewContextMenuBase( | 167 RenderViewContextMenuBase::RenderViewContextMenuBase( |
168 content::RenderFrameHost* render_frame_host, | 168 content::RenderFrameHost* render_frame_host, |
169 const content::ContextMenuParams& params) | 169 const content::ContextMenuParams& params) |
170 : params_(params), | 170 : params_(params), |
171 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), | 171 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), |
172 embedded_web_contents_(GetWebContentsToUse(source_web_contents_)), | 172 embedder_web_contents_(GetWebContentsToUse(source_web_contents_)), |
173 browser_context_(source_web_contents_->GetBrowserContext()), | 173 browser_context_(source_web_contents_->GetBrowserContext()), |
174 menu_model_(this), | 174 menu_model_(this), |
175 render_frame_id_(render_frame_host->GetRoutingID()), | 175 render_frame_id_(render_frame_host->GetRoutingID()), |
176 command_executed_(false), | 176 command_executed_(false), |
177 render_process_id_(render_frame_host->GetProcess()->GetID()) { | 177 render_process_id_(render_frame_host->GetProcess()->GetID()) { |
178 } | 178 } |
179 | 179 |
180 RenderViewContextMenuBase::~RenderViewContextMenuBase() { | 180 RenderViewContextMenuBase::~RenderViewContextMenuBase() { |
181 } | 181 } |
182 | 182 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 395 } |
396 | 396 |
397 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 397 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
398 return IsCustomItemCheckedInternal(params_.custom_items, id); | 398 return IsCustomItemCheckedInternal(params_.custom_items, id); |
399 } | 399 } |
400 | 400 |
401 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 401 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
402 return IsCustomItemEnabledInternal(params_.custom_items, id); | 402 return IsCustomItemEnabledInternal(params_.custom_items, id); |
403 } | 403 } |
404 | 404 |
OLD | NEW |