| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/tab_contents/render_view_context_menu_win.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu_win.h" |
| 6 | 6 |
| 7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/tab_contents/retargeting_details.h" | 10 #include "chrome/browser/tab_contents/retargeting_details.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 profile_->GetOriginalProfile(), false); | 59 profile_->GetOriginalProfile(), false); |
| 60 if (browser) { | 60 if (browser) { |
| 61 content::OpenURLParams url_params( | 61 content::OpenURLParams url_params( |
| 62 params_.link_url, | 62 params_.link_url, |
| 63 content::Referrer(params_.frame_url.is_empty() ? | 63 content::Referrer(params_.frame_url.is_empty() ? |
| 64 params_.page_url : params_.frame_url, | 64 params_.page_url : params_.frame_url, |
| 65 params_.referrer_policy), | 65 params_.referrer_policy), |
| 66 NEW_FOREGROUND_TAB, | 66 NEW_FOREGROUND_TAB, |
| 67 content::PAGE_TRANSITION_LINK, | 67 content::PAGE_TRANSITION_LINK, |
| 68 false); | 68 false); |
| 69 WebContents* source_web_contents = browser->GetSelectedWebContents(); | 69 WebContents* source_web_contents = browser->GetActiveWebContents(); |
| 70 WebContents* new_contents = source_web_contents->OpenURL(url_params); | 70 WebContents* new_contents = source_web_contents->OpenURL(url_params); |
| 71 DCHECK(new_contents); | 71 DCHECK(new_contents); |
| 72 return; | 72 return; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 RenderViewContextMenu::ExecuteCommand(command_id, event_flags); | 75 RenderViewContextMenu::ExecuteCommand(command_id, event_flags); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void RenderViewContextMenuWin::SetExternal() { | 78 void RenderViewContextMenuWin::SetExternal() { |
| 79 external_ = true; | 79 external_ = true; |
| 80 } | 80 } |
| OLD | NEW |