| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 render_process_id_(render_frame_host->GetProcess()->GetID()), | 164 render_process_id_(render_frame_host->GetProcess()->GetID()), |
| 165 command_executed_(false) {} | 165 command_executed_(false) { |
| 166 LOG(ERROR) << "ContextMenuBase: rfh:" << render_frame_host; |
| 167 } |
| 166 | 168 |
| 167 RenderViewContextMenuBase::~RenderViewContextMenuBase() { | 169 RenderViewContextMenuBase::~RenderViewContextMenuBase() { |
| 168 } | 170 } |
| 169 | 171 |
| 170 // Menu construction functions ------------------------------------------------- | 172 // Menu construction functions ------------------------------------------------- |
| 171 | 173 |
| 172 void RenderViewContextMenuBase::Init() { | 174 void RenderViewContextMenuBase::Init() { |
| 173 // Command id range must have been already initializerd. | 175 // Command id range must have been already initializerd. |
| 174 DCHECK_NE(-1, content_context_custom_first); | 176 DCHECK_NE(-1, content_context_custom_first); |
| 175 DCHECK_NE(-1, content_context_custom_last); | 177 DCHECK_NE(-1, content_context_custom_last); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 390 |
| 389 OpenURLParams open_url_params(url, referrer, disposition, transition, false, | 391 OpenURLParams open_url_params(url, referrer, disposition, transition, false, |
| 390 started_from_context_menu); | 392 started_from_context_menu); |
| 391 if (!extra_headers.empty()) | 393 if (!extra_headers.empty()) |
| 392 open_url_params.extra_headers = extra_headers; | 394 open_url_params.extra_headers = extra_headers; |
| 393 | 395 |
| 394 WebContents* new_contents = source_web_contents_->OpenURL(open_url_params); | 396 WebContents* new_contents = source_web_contents_->OpenURL(open_url_params); |
| 395 if (!new_contents) | 397 if (!new_contents) |
| 396 return; | 398 return; |
| 397 | 399 |
| 398 NotifyURLOpened(url, new_contents); | 400 // NotifyURLOpened(url, new_contents); |
| 399 } | 401 } |
| 400 | 402 |
| 401 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 403 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
| 402 return IsCustomItemCheckedInternal(params_.custom_items, id); | 404 return IsCustomItemCheckedInternal(params_.custom_items, id); |
| 403 } | 405 } |
| 404 | 406 |
| 405 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 407 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
| 406 return IsCustomItemEnabledInternal(params_.custom_items, id); | 408 return IsCustomItemEnabledInternal(params_.custom_items, id); |
| 407 } | 409 } |
| OLD | NEW |