Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6137)

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 6681030: Requesting Review for BugFix Chromium:1935 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 75533)
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
@@ -52,13 +52,14 @@
#include "net/url_request/url_request.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/favicon_size.h"
#include "webkit/glue/webmenuitem.h"
using WebKit::WebContextMenuData;
using WebKit::WebMediaPlayerAction;
+using WebKit::WebURL;
+using WebKit::WebString;
namespace {
@@ -1174,19 +1175,24 @@
switch (id) {
case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB:
- OpenURL(params_.link_url,
- source_tab_contents_->delegate() &&
+ OpenURL(
+ params_.link_url,
+ params_.frame_url.is_empty() ? params_.page_url : params_.frame_url,
+ source_tab_contents_->delegate() &&
source_tab_contents_->delegate()->IsApplication() ?
NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB,
- PageTransition::LINK);
+ PageTransition::LINK);
break;
case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW:
- OpenURL(params_.link_url, NEW_WINDOW, PageTransition::LINK);
+ OpenURL(
+ params_.link_url,
+ params_.frame_url.is_empty() ? params_.page_url : params_.frame_url,
+ NEW_WINDOW, PageTransition::LINK);
break;
case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
- OpenURL(params_.link_url, OFF_THE_RECORD, PageTransition::LINK);
+ OpenURL(params_.link_url, GURL(), OFF_THE_RECORD, PageTransition::LINK);
break;
case IDC_CONTENT_CONTEXT_SAVEAVAS:
@@ -1218,7 +1224,10 @@
case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB:
case IDC_CONTENT_CONTEXT_OPENAVNEWTAB:
- OpenURL(params_.src_url, NEW_BACKGROUND_TAB, PageTransition::LINK);
+ OpenURL(
+ params_.src_url,
+ params_.frame_url.is_empty() ? params_.page_url : params_.frame_url,
+ NEW_BACKGROUND_TAB, PageTransition::LINK);
break;
case IDC_CONTENT_CONTEXT_PLAYPAUSE: {
@@ -1339,7 +1348,8 @@
case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
OpenURL(GURL(chrome::kViewSourceScheme + std::string(":") +
- params_.frame_url.spec()), NEW_FOREGROUND_TAB, PageTransition::LINK);
+ params_.frame_url.spec()), GURL(),
+ NEW_FOREGROUND_TAB, PageTransition::LINK);
break;
case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: {
@@ -1392,7 +1402,7 @@
case IDC_CONTENT_CONTEXT_SEARCHWEBFOR:
case IDC_CONTENT_CONTEXT_GOTOURL: {
- OpenURL(selection_navigation_url_, NEW_FOREGROUND_TAB,
+ OpenURL(selection_navigation_url_, GURL(), NEW_FOREGROUND_TAB,
PageTransition::LINK);
break;
}
@@ -1509,10 +1519,10 @@
// Controller functions --------------------------------------------------------
void RenderViewContextMenu::OpenURL(
- const GURL& url,
+ const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
- source_tab_contents_->OpenURL(url, GURL(), disposition, transition);
+ source_tab_contents_->OpenURL(url, referrer, disposition, transition);
}
void RenderViewContextMenu::CopyImageAt(int x, int y) {
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698