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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 RenderFrameHost* RenderViewContextMenuBase::GetRenderFrameHost() { | 356 RenderFrameHost* RenderViewContextMenuBase::GetRenderFrameHost() { |
357 return RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 357 return RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
358 } | 358 } |
359 | 359 |
360 // Controller functions -------------------------------------------------------- | 360 // Controller functions -------------------------------------------------------- |
361 | 361 |
362 void RenderViewContextMenuBase::OpenURL( | 362 void RenderViewContextMenuBase::OpenURL( |
363 const GURL& url, const GURL& referring_url, | 363 const GURL& url, const GURL& referring_url, |
364 WindowOpenDisposition disposition, | 364 WindowOpenDisposition disposition, |
365 content::PageTransition transition) { | 365 ui::PageTransition transition) { |
366 content::Referrer referrer = content::Referrer::SanitizeForRequest( | 366 content::Referrer referrer = content::Referrer::SanitizeForRequest( |
367 url, | 367 url, |
368 content::Referrer(referring_url.GetAsReferrer(), | 368 content::Referrer(referring_url.GetAsReferrer(), |
369 params_.referrer_policy)); | 369 params_.referrer_policy)); |
370 | 370 |
371 if (params_.link_url == url && disposition != OFF_THE_RECORD) | 371 if (params_.link_url == url && disposition != OFF_THE_RECORD) |
372 params_.custom_context.link_followed = url; | 372 params_.custom_context.link_followed = url; |
373 | 373 |
374 WebContents* new_contents = source_web_contents_->OpenURL(OpenURLParams( | 374 WebContents* new_contents = source_web_contents_->OpenURL(OpenURLParams( |
375 url, referrer, disposition, transition, false)); | 375 url, referrer, disposition, transition, false)); |
376 if (!new_contents) | 376 if (!new_contents) |
377 return; | 377 return; |
378 | 378 |
379 NotifyURLOpened(url, new_contents); | 379 NotifyURLOpened(url, new_contents); |
380 } | 380 } |
381 | 381 |
382 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { | 382 bool RenderViewContextMenuBase::IsCustomItemChecked(int id) const { |
383 return IsCustomItemCheckedInternal(params_.custom_items, id); | 383 return IsCustomItemCheckedInternal(params_.custom_items, id); |
384 } | 384 } |
385 | 385 |
386 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { | 386 bool RenderViewContextMenuBase::IsCustomItemEnabled(int id) const { |
387 return IsCustomItemEnabledInternal(params_.custom_items, id); | 387 return IsCustomItemEnabledInternal(params_.custom_items, id); |
388 } | 388 } |
389 | 389 |
OLD | NEW |