Chromium Code Reviews| 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.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1842 return ui::TruncateString(params_.selection_text, | 1842 return ui::TruncateString(params_.selection_text, |
| 1843 kMaxSelectionTextLength); | 1843 kMaxSelectionTextLength); |
| 1844 } | 1844 } |
| 1845 | 1845 |
| 1846 // Controller functions -------------------------------------------------------- | 1846 // Controller functions -------------------------------------------------------- |
| 1847 | 1847 |
| 1848 void RenderViewContextMenu::OpenURL( | 1848 void RenderViewContextMenu::OpenURL( |
| 1849 const GURL& url, const GURL& referrer, int64 frame_id, | 1849 const GURL& url, const GURL& referrer, int64 frame_id, |
| 1850 WindowOpenDisposition disposition, | 1850 WindowOpenDisposition disposition, |
| 1851 content::PageTransition transition) { | 1851 content::PageTransition transition) { |
| 1852 // Ensure that we do not send url fragment, | |
|
pauljensen
2013/03/14 18:53:44
Capitalize URL. Let's avoid "we" by saying "Ensur
mef
2013/03/14 20:31:38
Done.
| |
| 1853 // username and password fields in the referrer. | |
| 1854 GURL referrer_url(referrer); | |
|
pauljensen
2013/03/14 18:53:44
"referrer_url" doesn't indicate its difference fro
mef
2013/03/14 20:31:38
Done.
| |
| 1855 if (referrer_url.is_valid() && (referrer_url.has_ref() || | |
| 1856 referrer_url.has_username() || referrer_url.has_password())) { | |
| 1857 GURL::Replacements referrer_mods; | |
| 1858 referrer_mods.ClearRef(); | |
| 1859 referrer_mods.ClearUsername(); | |
| 1860 referrer_mods.ClearPassword(); | |
| 1861 referrer_url = referrer_url.ReplaceComponents(referrer_mods); | |
| 1862 } | |
| 1863 | |
| 1852 WebContents* new_contents = source_web_contents_->OpenURL(OpenURLParams( | 1864 WebContents* new_contents = source_web_contents_->OpenURL(OpenURLParams( |
| 1853 url, content::Referrer(referrer, params_.referrer_policy), disposition, | 1865 url, content::Referrer(referrer_url, params_.referrer_policy), |
| 1854 transition, false)); | 1866 disposition, transition, false)); |
| 1855 if (!new_contents) | 1867 if (!new_contents) |
| 1856 return; | 1868 return; |
| 1857 | 1869 |
| 1858 RetargetingDetails details; | 1870 RetargetingDetails details; |
| 1859 details.source_web_contents = source_web_contents_; | 1871 details.source_web_contents = source_web_contents_; |
| 1860 details.source_frame_id = frame_id; | 1872 details.source_frame_id = frame_id; |
| 1861 details.target_url = url; | 1873 details.target_url = url; |
| 1862 details.target_web_contents = new_contents; | 1874 details.target_web_contents = new_contents; |
| 1863 details.not_yet_in_tabstrip = false; | 1875 details.not_yet_in_tabstrip = false; |
| 1864 content::NotificationService::current()->Notify( | 1876 content::NotificationService::current()->Notify( |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1892 source_web_contents_->GetRenderViewHost()-> | 1904 source_web_contents_->GetRenderViewHost()-> |
| 1893 ExecuteMediaPlayerActionAtLocation(location, action); | 1905 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1894 } | 1906 } |
| 1895 | 1907 |
| 1896 void RenderViewContextMenu::PluginActionAt( | 1908 void RenderViewContextMenu::PluginActionAt( |
| 1897 const gfx::Point& location, | 1909 const gfx::Point& location, |
| 1898 const WebPluginAction& action) { | 1910 const WebPluginAction& action) { |
| 1899 source_web_contents_->GetRenderViewHost()-> | 1911 source_web_contents_->GetRenderViewHost()-> |
| 1900 ExecutePluginActionAtLocation(location, action); | 1912 ExecutePluginActionAtLocation(location, action); |
| 1901 } | 1913 } |
| OLD | NEW |