| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 id <= content_context_custom_last; | 154 id <= content_context_custom_last; |
| 155 } | 155 } |
| 156 | 156 |
| 157 RenderViewContextMenuBase::RenderViewContextMenuBase( | 157 RenderViewContextMenuBase::RenderViewContextMenuBase( |
| 158 content::RenderFrameHost* render_frame_host, | 158 content::RenderFrameHost* render_frame_host, |
| 159 const content::ContextMenuParams& params) | 159 const content::ContextMenuParams& params) |
| 160 : params_(params), | 160 : params_(params), |
| 161 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), | 161 source_web_contents_(WebContents::FromRenderFrameHost(render_frame_host)), |
| 162 browser_context_(source_web_contents_->GetBrowserContext()), | 162 browser_context_(source_web_contents_->GetBrowserContext()), |
| 163 menu_model_(this), | 163 menu_model_(this), |
| 164 render_frame_id_(render_frame_host->GetRoutingID()), |
| 164 command_executed_(false), | 165 command_executed_(false), |
| 165 render_process_id_(render_frame_host->GetProcess()->GetID()), | 166 render_process_id_(render_frame_host->GetProcess()->GetID()) { |
| 166 render_frame_id_(render_frame_host->GetRoutingID()) { | |
| 167 } | 167 } |
| 168 | 168 |
| 169 RenderViewContextMenuBase::~RenderViewContextMenuBase() { | 169 RenderViewContextMenuBase::~RenderViewContextMenuBase() { |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Menu construction functions ------------------------------------------------- | 172 // Menu construction functions ------------------------------------------------- |
| 173 | 173 |
| 174 void RenderViewContextMenuBase::Init() { | 174 void RenderViewContextMenuBase::Init() { |
| 175 // Command id range must have been already initializerd. | 175 // Command id range must have been already initializerd. |
| 176 DCHECK_NE(-1, content_context_custom_first); | 176 DCHECK_NE(-1, content_context_custom_first); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 386 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
| 387 return IsCustomItemCheckedInternal(params_.custom_items, id); | 387 return IsCustomItemCheckedInternal(params_.custom_items, id); |
| 388 } | 388 } |
| 389 | 389 |
| 390 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 390 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
| 391 return IsCustomItemEnabledInternal(params_.custom_items, id); | 391 return IsCustomItemEnabledInternal(params_.custom_items, id); |
| 392 } | 392 } |
| 393 | 393 |
| OLD | NEW |