summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-28 01:29:20 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-28 01:29:20 +0000
commite5d549d8889c0533703211652564bc0a55ec9938 (patch)
tree1657b37fe9aab6dc719d2f4cc2298c42a8d92e62 /chrome/browser
parent1f2f300c1767a21a17e1b9ce3acb4b75ae854600 (diff)
downloadchromium_src-e5d549d8889c0533703211652564bc0a55ec9938.zip
chromium_src-e5d549d8889c0533703211652564bc0a55ec9938.tar.gz
chromium_src-e5d549d8889c0533703211652564bc0a55ec9938.tar.bz2
Move the PageNavigator interface and GlobalRequestID struct to content\public and put them in the content namespace. Make PageNavigator use WebContents instead of TabContents. While I'm touching all the callers, I've removed the deprecated PageNavigator function and converted users to the new one.
BUG=98716 TBR=joi Review URL: http://codereview.chromium.org/8991012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/accessibility/accessibility_win_browsertest.cc46
-rw-r--r--chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc7
-rw-r--r--chrome/browser/alternate_nav_url_fetcher.cc11
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc12
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.cc3
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.h11
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc19
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc18
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.h9
-rw-r--r--chrome/browser/browser_commands_unittest.cc6
-rw-r--r--chrome/browser/chromeos/login/registration_screen.cc5
-rw-r--r--chrome/browser/chromeos/login/registration_screen.h5
-rw-r--r--chrome/browser/chromeos/panels/panel_browsertest.cc9
-rw-r--r--chrome/browser/crash_recovery_browsertest.cc8
-rw-r--r--chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc12
-rw-r--r--chrome/browser/debugger/devtools_window.cc4
-rw-r--r--chrome/browser/debugger/devtools_window.h5
-rw-r--r--chrome/browser/download/download_shelf_context_menu.cc3
-rw-r--r--chrome/browser/extensions/extension_context_menu_model.cc9
-rw-r--r--chrome/browser/extensions/extension_host.cc3
-rw-r--r--chrome/browser/extensions/extension_host.h5
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc7
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc7
-rw-r--r--chrome/browser/extensions/network_delay_listener.cc1
-rw-r--r--chrome/browser/extensions/network_delay_listener.h8
-rw-r--r--chrome/browser/extensions/user_script_listener.cc1
-rw-r--r--chrome/browser/extensions/user_script_listener.h7
-rw-r--r--chrome/browser/extensions/user_script_listener_unittest.cc5
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc1
-rw-r--r--chrome/browser/extensions/window_open_apitest.cc13
-rw-r--r--chrome/browser/external_tab_container_win.cc9
-rw-r--r--chrome/browser/external_tab_container_win.h13
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context.cc12
-rw-r--r--chrome/browser/google/google_url_tracker.cc22
-rw-r--r--chrome/browser/oom_priority_manager_browsertest.cc2
-rw-r--r--chrome/browser/plugin_installer_infobar_delegate.cc11
-rw-r--r--chrome/browser/plugin_observer.cc16
-rw-r--r--chrome/browser/prerender/prerender_browsertest.cc7
-rw-r--r--chrome/browser/prerender/prerender_contents.cc3
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc16
-rw-r--r--chrome/browser/renderer_host/safe_browsing_resource_handler.cc4
-rw-r--r--chrome/browser/renderer_host/transfer_navigation_resource_handler.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc23
-rw-r--r--chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc1
-rw-r--r--chrome/browser/tab_contents/insecure_content_infobar_delegate.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc30
-rw-r--r--chrome/browser/tab_contents/spelling_bubble_model.cc8
-rw-r--r--chrome/browser/tab_contents/web_drop_target_win.cc22
-rw-r--r--chrome/browser/task_manager/task_manager.cc11
-rw-r--r--chrome/browser/translate/options_menu_model.cc9
-rw-r--r--chrome/browser/ui/blocked_content/blocked_content_container.cc5
-rw-r--r--chrome/browser/ui/blocked_content/blocked_content_container.h5
-rw-r--r--chrome/browser/ui/browser.cc57
-rw-r--r--chrome/browser/ui/browser.h20
-rw-r--r--chrome/browser/ui/browser_browsertest.cc5
-rw-r--r--chrome/browser/ui/browser_init.cc8
-rw-r--r--chrome/browser/ui/browser_navigator.cc1
-rw-r--r--chrome/browser/ui/browser_navigator.h4
-rw-r--r--chrome/browser/ui/cocoa/about_window_controller.mm9
-rw-r--r--chrome/browser/ui/cocoa/applescript/tab_applescript.mm10
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm9
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm9
-rw-r--r--chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm9
-rw-r--r--chrome/browser/ui/cocoa/page_info_bubble_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm13
-rw-r--r--chrome/browser/ui/cocoa/view_id_util_browsertest.mm13
-rw-r--r--chrome/browser/ui/cocoa/web_intent_bubble_controller.mm9
-rw-r--r--chrome/browser/ui/gtk/about_chrome_dialog.cc2
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc1
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h9
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h9
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc3
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h7
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/global_history_menu.cc2
-rw-r--r--chrome/browser/ui/gtk/location_bar_view_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/page_info_bubble_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/sad_tab_gtk.cc1
-rw-r--r--chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h5
-rw-r--r--chrome/browser/ui/gtk/view_id_util_browsertest.cc2
-rw-r--r--chrome/browser/ui/gtk/web_intent_picker_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/web_intent_picker_gtk.h2
-rw-r--r--chrome/browser/ui/login/login_prompt_browsertest.cc66
-rw-r--r--chrome/browser/ui/panels/panel_settings_menu_model.cc14
-rw-r--r--chrome/browser/ui/pdf/pdf_unsupported_feature.cc8
-rw-r--r--chrome/browser/ui/toolbar/toolbar_model_unittest.cc8
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc6
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc11
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.h7
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc18
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu.h4
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc3
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h15
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc18
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc3
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h9
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc3
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h11
-rw-r--r--chrome/browser/ui/views/extensions/extension_install_dialog_view.cc9
-rw-r--r--chrome/browser/ui/views/instant_confirm_view.cc9
-rw-r--r--chrome/browser/ui/views/page_info_bubble_view.cc7
-rw-r--r--chrome/browser/ui/views/sad_tab_view.cc1
-rw-r--r--chrome/browser/ui/views/tabs/default_tab_drag_controller.cc6
-rw-r--r--chrome/browser/ui/views/tabs/default_tab_drag_controller.h5
-rw-r--r--chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc7
-rw-r--r--chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h6
-rw-r--r--chrome/browser/ui/webui/html_dialog_tab_contents_delegate_unittest.cc7
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc8
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_login_handler.cc10
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_handler.cc14
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_utils_x11.cc8
-rw-r--r--chrome/browser/ui/webui/options2/advanced_options_handler2.cc14
-rw-r--r--chrome/browser/ui/webui/options2/advanced_options_utils2_x11.cc8
-rw-r--r--chrome/browser/ui/webui/print_preview_handler.cc13
-rw-r--r--chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc13
122 files changed, 712 insertions, 412 deletions
diff --git a/chrome/browser/accessibility/accessibility_win_browsertest.cc b/chrome/browser/accessibility/accessibility_win_browsertest.cc
index 89a9bdd..2135b68 100644
--- a/chrome/browser/accessibility/accessibility_win_browsertest.cc
+++ b/chrome/browser/accessibility/accessibility_win_browsertest.cc
@@ -22,6 +22,8 @@
#include "third_party/iaccessible2/ia2_api_all.h"
#include "third_party/isimpledom/ISimpleDOMNode.h"
+using content::OpenURLParams;
+using content::Referrer;
using std::auto_ptr;
using std::vector;
using std::wstring;
@@ -354,8 +356,8 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
"data:text/html,<html><head><title>Accessibility Win Test</title></head>"
"<body><input type='button' value='push' /><input type='checkbox' />"
"</body></html>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
tree_updated_observer2.Wait();
// Check the browser's copy of the renderer accessibility tree.
@@ -397,8 +399,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
content::NotificationService::AllSources());
GURL tree_url("data:text/html,<ul tabindex='-1' role='radiogroup'><li id='li'"
">li</li></ul>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -451,8 +454,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
content::NotificationService::AllSources());
GURL tree_url("data:text/html,<body><input type='checkbox' /></body>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -487,8 +491,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
// The role attribute causes the node to be in the accessibility tree.
GURL tree_url(
"data:text/html,<body role=group></body>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -521,8 +526,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
GURL tree_url(
"data:text/html,<div role=group style='visibility: hidden'>text"
"</div>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -554,8 +560,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
// The role attribute causes the node to be in the accessibility tree.
GURL tree_url(
"data:text/html,<div role=group tabindex='-1'></div>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -605,8 +612,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
content::NotificationService::AllSources());
GURL tree_url("data:text/html,<body><input type='text' value='old value'/>"
"</body>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -648,8 +656,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
content::NotificationService::AllSources());
GURL tree_url("data:text/html,<html><head><title>MyDocument</title></head>"
"<body>Content</body></html>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
@@ -676,8 +685,9 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
content::NotificationService::AllSources());
GURL tree_url("data:text/html,<body><input type='checkbox' /></body>");
- browser()->OpenURL(
- tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ tree_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
GetRendererAccessible();
tree_updated_observer1.Wait();
diff --git a/chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc b/chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc
index b382cc9..77a7f4d 100644
--- a/chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc
+++ b/chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -22,6 +22,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h"
+using content::OpenURLParams;
+using content::Referrer;
+
// Suffix of the expectation file corresponding to html file.
// Example:
// HTML test: test-file.html
@@ -111,8 +114,8 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
content::NotificationService::AllSources());
GURL url(kUrlPreamble + html_contents);
- browser()->OpenURL(
- url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
// Wait for the tree.
tree_updated_observer.Wait();
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc
index 7ab97c0..2747359 100644
--- a/chrome/browser/alternate_nav_url_fetcher.cc
+++ b/chrome/browser/alternate_nav_url_fetcher.cc
@@ -23,6 +23,9 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using content::OpenURLParams;
+using content::Referrer;
+
// AlternateNavInfoBarDelegate ------------------------------------------------
class AlternateNavInfoBarDelegate : public LinkInfoBarDelegate {
@@ -76,12 +79,14 @@ string16 AlternateNavInfoBarDelegate::GetLinkText() const {
bool AlternateNavInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- owner()->web_contents()->OpenURL(
- alternate_nav_url_, GURL(), disposition,
+ OpenURLParams params(
+ alternate_nav_url_, Referrer(), disposition,
// Pretend the user typed this URL, so that navigating to
// it will be the default action when it's typed again in
// the future.
- content::PAGE_TRANSITION_TYPED);
+ content::PAGE_TRANSITION_TYPED,
+ false);
+ owner()->web_contents()->OpenURL(params);
// We should always close, even if the navigation did not occur within this
// TabContents.
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index a64aa52..c927544 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -154,6 +154,8 @@ using content::ChildProcessHost;
using content::DownloadItem;
using content::DownloadManager;
using content::PluginService;
+using content::OpenURLParams;
+using content::Referrer;
using content::SSLStatus;
using content::WebContents;
@@ -632,8 +634,9 @@ void TestingAutomationProvider::NavigateToURLBlockUntilNavigationsComplete(
number_of_navigations, false, false);
// TODO(darin): avoid conversion to GURL.
- browser->OpenURL(
- url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
+ browser->OpenURL(params);
return;
}
}
@@ -666,8 +669,9 @@ void TestingAutomationProvider::NavigationAsyncWithDisposition(
if (browser) {
// Don't add any listener unless a callback mechanism is desired.
// TODO(vibhor): Do this if such a requirement arises in future.
- browser->OpenURL(
- url, GURL(), disposition, content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ url, Referrer(), disposition, content::PAGE_TRANSITION_TYPED, false);
+ browser->OpenURL(params);
*status = true;
}
}
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
index bf3736e..558fcba 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
@@ -15,11 +15,12 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::PageNavigator;
using content::UserMetricsAction;
BookmarkContextMenuController::BookmarkContextMenuController(
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
index da12260..ab8588a 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
@@ -13,9 +13,12 @@
#include "ui/base/models/simple_menu_model.h"
#include "ui/gfx/native_widget_types.h"
-class PageNavigator;
class Profile;
+namespace content {
+class PageNavigator;
+}
+
// An interface implemented by an object that performs actions on the actual
// menu for the controller.
class BookmarkContextMenuControllerDelegate {
@@ -47,7 +50,7 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver,
gfx::NativeWindow parent_window,
BookmarkContextMenuControllerDelegate* delegate,
Profile* profile,
- PageNavigator* navigator,
+ content::PageNavigator* navigator,
const BookmarkNode* parent,
const std::vector<const BookmarkNode*>& selection);
virtual ~BookmarkContextMenuController();
@@ -66,7 +69,7 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver,
// Accessors:
Profile* profile() const { return profile_; }
- PageNavigator* navigator() const { return navigator_; }
+ content::PageNavigator* navigator() const { return navigator_; }
private:
// Adds a IDC_* style command to the menu with a localized string.
@@ -86,7 +89,7 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver,
gfx::NativeWindow parent_window_;
BookmarkContextMenuControllerDelegate* delegate_;
Profile* profile_;
- PageNavigator* navigator_;
+ content::PageNavigator* navigator_;
const BookmarkNode* parent_;
std::vector<const BookmarkNode*> selection_;
BookmarkModel* model_;
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc
index 538de7c..c2e9632 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/test/test_browser_thread.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -22,23 +22,14 @@
#endif
using content::BrowserThread;
+using content::OpenURLParams;
+using content::PageNavigator;
+using content::WebContents;
// PageNavigator implementation that records the URL.
class TestingPageNavigator : public PageNavigator {
public:
- // Deprecated. Please use the one-argument variant.
- // TODO(adriansc): Remove this method once refactoring changed all call
- // sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) OVERRIDE {
- DCHECK(referrer.is_empty());
- return OpenURL(OpenURLParams(url, content::Referrer(), disposition,
- transition, false));
- }
-
- virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE {
+ virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE {
urls_.push_back(params.url);
return NULL;
}
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 0cba25c..62cc9c7 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -25,8 +25,8 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/tab_contents/page_navigator.h"
#include "content/browser/tab_contents/tab_contents.h"
+#include "content/public/browser/page_navigator.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/ui_strings.h"
@@ -52,6 +52,9 @@
#endif
using base::Time;
+using content::OpenURLParams;
+using content::PageNavigator;
+using content::WebContents;
namespace {
@@ -71,18 +74,7 @@ class NewBrowserPageNavigator : public PageNavigator {
Browser* browser() const { return browser_; }
- // Deprecated. Please use one-argument variant.
- // TODO(adriansc): Remove this method once refactoring changed all call sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) OVERRIDE {
- DCHECK(referrer.is_empty());
- return OpenURL(OpenURLParams(url, content::Referrer(), disposition,
- transition, false));
- }
-
- virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE {
+ virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE {
if (!browser_) {
Profile* profile = (params.disposition == OFF_THE_RECORD) ?
profile_->GetOffTheRecordProfile() : profile_;
diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h
index 4caeb0a..67846a8 100644
--- a/chrome/browser/bookmarks/bookmark_utils.h
+++ b/chrome/browser/bookmarks/bookmark_utils.h
@@ -19,11 +19,14 @@
class BookmarkModel;
class BookmarkNode;
class Browser;
-class PageNavigator;
class PrefService;
class Profile;
class TabContents;
+namespace content {
+class PageNavigator;
+}
+
namespace views {
class DropTargetEvent;
}
@@ -86,14 +89,14 @@ void DragBookmarks(Profile* profile,
// no browser with the specified profile a new one is created.
void OpenAll(gfx::NativeWindow parent,
Profile* profile,
- PageNavigator* navigator,
+ content::PageNavigator* navigator,
const std::vector<const BookmarkNode*>& nodes,
WindowOpenDisposition initial_disposition);
// Convenience for |OpenAll| with a single BookmarkNode.
void OpenAll(gfx::NativeWindow parent,
Profile* profile,
- PageNavigator* navigator,
+ content::PageNavigator* navigator,
const BookmarkNode* node,
WindowOpenDisposition initial_disposition);
diff --git a/chrome/browser/browser_commands_unittest.cc b/chrome/browser/browser_commands_unittest.cc
index b5c4175..d04ae23 100644
--- a/chrome/browser/browser_commands_unittest.cc
+++ b/chrome/browser/browser_commands_unittest.cc
@@ -15,6 +15,9 @@
typedef BrowserWithTestWindowTest BrowserCommandsTest;
+using content::OpenURLParams;
+using content::Referrer;
+
// Tests IDC_SELECT_TAB_0, IDC_SELECT_NEXT_TAB, IDC_SELECT_PREVIOUS_TAB and
// IDC_SELECT_LAST_TAB.
TEST_F(BrowserCommandsTest, TabNavigationAccelerators) {
@@ -86,7 +89,8 @@ TEST_F(BrowserCommandsTest, BookmarkCurrentPage) {
// Navigate to a url.
GURL url1("http://foo/1");
AddTab(browser(), url1);
- browser()->OpenURL(url1, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url1, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
// TODO(beng): remove this once we can use TabContentses directly in testing
// instead of the TestTabContents which causes this command not to
diff --git a/chrome/browser/chromeos/login/registration_screen.cc b/chrome/browser/chromeos/login/registration_screen.cc
index 4d5e1e4..2d6e104 100644
--- a/chrome/browser/chromeos/login/registration_screen.cc
+++ b/chrome/browser/chromeos/login/registration_screen.cc
@@ -20,6 +20,9 @@
#include "net/url_request/url_request_about_job.h"
#include "net/url_request/url_request_filter.h"
+using content::OpenURLParams;
+using content::WebContents;
+
namespace chromeos {
namespace {
@@ -108,7 +111,7 @@ void RegistrationScreen::OnPageLoadFailed(const std::string& url) {
///////////////////////////////////////////////////////////////////////////////
// RegistrationScreen, content::WebContentsDelegate implementation:
-TabContents* RegistrationScreen::OpenURLFromTab(TabContents* source,
+WebContents* RegistrationScreen::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
if (params.url.spec() == kRegistrationSuccessUrl) {
source->Stop();
diff --git a/chrome/browser/chromeos/login/registration_screen.h b/chrome/browser/chromeos/login/registration_screen.h
index cd36f97..b02bb0a 100644
--- a/chrome/browser/chromeos/login/registration_screen.h
+++ b/chrome/browser/chromeos/login/registration_screen.h
@@ -81,8 +81,9 @@ class RegistrationScreen : public ViewScreen<RegistrationView>,
virtual RegistrationView* AllocateView() OVERRIDE;
// content::WebContentsDelegate implementation:
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void HandleKeyboardEvent(
const NativeWebKeyboardEvent& event) OVERRIDE;
diff --git a/chrome/browser/chromeos/panels/panel_browsertest.cc b/chrome/browser/chromeos/panels/panel_browsertest.cc
index d48bad9..db0484a 100644
--- a/chrome/browser/chromeos/panels/panel_browsertest.cc
+++ b/chrome/browser/chromeos/panels/panel_browsertest.cc
@@ -18,6 +18,9 @@
#include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h"
#endif
+using content::OpenURLParams;
+using content::Referrer;
+
namespace chromeos {
class PanelTest : public InProcessBrowserTest {
@@ -50,7 +53,8 @@ IN_PROC_BROWSER_TEST_F(PanelTest, PanelOpenSmall) {
ui_test_utils::WindowedNotificationObserver tab_added_observer(
content::NOTIFICATION_TAB_ADDED,
content::NotificationService::AllSources());
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
tab_added_observer.Wait();
// Find the new browser.
@@ -100,7 +104,8 @@ IN_PROC_BROWSER_TEST_F(PanelTest, MAYBE_PanelOpenLarge) {
ui_test_utils::WindowedNotificationObserver tab_added_observer(
content::NOTIFICATION_TAB_ADDED,
content::NotificationService::AllSources());
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
tab_added_observer.Wait();
// Shouldn't find a new browser.
diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc
index 6913bae..4387098 100644
--- a/chrome/browser/crash_recovery_browsertest.cc
+++ b/chrome/browser/crash_recovery_browsertest.cc
@@ -15,14 +15,18 @@
#include "content/public/common/page_transition_types.h"
#include "testing/gtest/include/gtest/gtest.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
void SimulateRendererCrash(Browser* browser) {
ui_test_utils::WindowedNotificationObserver observer(
content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED,
content::NotificationService::AllSources());
- browser->OpenURL(GURL(chrome::kChromeUICrashURL), GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_TYPED);
+ browser->OpenURL(OpenURLParams(
+ GURL(chrome::kChromeUICrashURL), Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_TYPED, false));
observer.Wait();
}
diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
index 00ed210..2375954 100644
--- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
+++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
@@ -14,6 +14,8 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate(
@@ -93,9 +95,13 @@ bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore"));
- owner()->web_contents()->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
- chrome::kLearnMoreRegisterProtocolHandlerURL)), GURL(),
+ OpenURLParams params(
+ google_util::AppendGoogleLocaleParam(GURL(
+ chrome::kLearnMoreRegisterProtocolHandlerURL)),
+ Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK);
+ content::PAGE_TRANSITION_LINK,
+ false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index 324b843..a91ce99 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -57,6 +57,8 @@ using content::DevToolsAgentHost;
using content::DevToolsAgentHostRegistry;
using content::DevToolsClientHost;
using content::DevToolsManager;
+using content::OpenURLParams;
+using content::WebContents;
const char DevToolsWindow::kDevToolsApp[] = "DevToolsApp";
@@ -439,7 +441,7 @@ void DevToolsWindow::AddDevToolsExtensionsToClient() {
CallClientFunction(ASCIIToUTF16("WebInspector.addExtensions"), results);
}
-TabContents* DevToolsWindow::OpenURLFromTab(TabContents* source,
+WebContents* DevToolsWindow::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
if (inspected_tab_) {
OpenURLParams forward_params = params;
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index 8e979ca..920eab8 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -98,8 +98,9 @@ class DevToolsWindow : private content::NotificationObserver,
void CallClientFunction(const string16& function_name,
const base::Value& arg);
// Overridden from content::WebContentsDelegate.
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void AddNewContents(TabContents* source,
TabContents* new_contents,
WindowOpenDisposition disposition,
diff --git a/chrome/browser/download/download_shelf_context_menu.cc b/chrome/browser/download/download_shelf_context_menu.cc
index 9dd2167..b676e4c 100644
--- a/chrome/browser/download/download_shelf_context_menu.cc
+++ b/chrome/browser/download/download_shelf_context_menu.cc
@@ -10,13 +10,14 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/tab_contents/page_navigator.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
+#include "content/public/browser/page_navigator.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
using content::DownloadItem;
+using content::OpenURLParams;
DownloadShelfContextMenu::~DownloadShelfContextMenu() {}
diff --git a/chrome/browser/extensions/extension_context_menu_model.cc b/chrome/browser/extensions/extension_context_menu_model.cc
index 2ceb38e..0670504 100644
--- a/chrome/browser/extensions/extension_context_menu_model.cc
+++ b/chrome/browser/extensions/extension_context_menu_model.cc
@@ -20,6 +20,9 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::Referrer;
+
enum MenuEntries {
NAME = 0,
CONFIGURE,
@@ -114,8 +117,10 @@ void ExtensionContextMenuModel::ExecuteCommand(int command_id) {
switch (command_id) {
case NAME: {
- browser_->OpenURL(extension->GetHomepageURL(), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(extension->GetHomepageURL(), Referrer(),
+ NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ browser_->OpenURL(params);
break;
}
case CONFIGURE:
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 74ef697..4444d4e 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -52,6 +52,7 @@
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
+using content::OpenURLParams;
using content::WebContents;
// Helper class that rate-limits the creation of renderer processes for
@@ -395,7 +396,7 @@ void ExtensionHost::CloseContents(WebContents* contents) {
}
}
-TabContents* ExtensionHost::OpenURLFromTab(TabContents* source,
+WebContents* ExtensionHost::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
// Whitelist the dispositions we will allow to be opened.
switch (params.disposition) {
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h
index 7951ea1..8e9e74b 100644
--- a/chrome/browser/extensions/extension_host.h
+++ b/chrome/browser/extensions/extension_host.h
@@ -117,8 +117,9 @@ class ExtensionHost : public content::WebContentsDelegate,
virtual void DidStopLoading() OVERRIDE;
// content::WebContentsDelegate
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) OVERRIDE;
virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event)
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 33e92f3..8e355c0 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -29,6 +29,8 @@
#include "content/public/browser/notification_service.h"
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
namespace {
@@ -213,8 +215,9 @@ void ExtensionProcessManager::OpenOptionsPage(const Extension* extension,
browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile());
}
- browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(extension->options_url(), Referrer(), SINGLETON_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
browser->window()->Show();
static_cast<RenderViewHostDelegate*>(browser->GetSelectedTabContents())->
Activate();
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 85ff76a..f31e98a 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -60,6 +60,8 @@
namespace keys = extension_tabs_module_constants;
namespace errors = extension_manifest_errors;
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
const int CaptureVisibleTabFunction::kDefaultQuality = 90;
@@ -1376,8 +1378,9 @@ bool ReloadTabFunction::RunImpl() {
if (tab_contents->ShowingInterstitialPage()) {
// This does as same as Browser::ReloadInternal.
NavigationEntry* entry = tab_contents->GetController().GetActiveEntry();
- GetCurrentBrowser()->OpenURL(entry->GetURL(), GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_RELOAD);
+ OpenURLParams params(entry->GetURL(), Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_RELOAD, false);
+ GetCurrentBrowser()->OpenURL(params);
} else if (bypass_cache) {
tab_contents->GetController().ReloadIgnoringCache(true);
} else {
diff --git a/chrome/browser/extensions/network_delay_listener.cc b/chrome/browser/extensions/network_delay_listener.cc
index 431087a..c417e1c 100644
--- a/chrome/browser/extensions/network_delay_listener.cc
+++ b/chrome/browser/extensions/network_delay_listener.cc
@@ -18,6 +18,7 @@
#include "net/url_request/url_request.h"
using content::BrowserThread;
+using content::GlobalRequestID;
NetworkDelayListener::NetworkDelayListener()
: resource_queue_(NULL),
diff --git a/chrome/browser/extensions/network_delay_listener.h b/chrome/browser/extensions/network_delay_listener.h
index d2207cb..8ed16d6 100644
--- a/chrome/browser/extensions/network_delay_listener.h
+++ b/chrome/browser/extensions/network_delay_listener.h
@@ -17,12 +17,6 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-namespace net {
-class URLRequest;
-} // namespace net
-
-struct GlobalRequestID;
-
// This class handles delaying of resource loads that depend on unloaded
// extensions. For each request that comes in, we check if all extensions are
// ready for it to be loaded; if not, we delay the request.
@@ -43,7 +37,7 @@ class NetworkDelayListener
virtual bool ShouldDelayRequest(
net::URLRequest* request,
const ResourceDispatcherHostRequestInfo& request_info,
- const GlobalRequestID& request_id) OVERRIDE;
+ const content::GlobalRequestID& request_id) OVERRIDE;
virtual void WillShutdownResourceQueue() OVERRIDE;
friend class base::RefCountedThreadSafe<NetworkDelayListener>;
diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc
index b169f12..cc05035 100644
--- a/chrome/browser/extensions/user_script_listener.cc
+++ b/chrome/browser/extensions/user_script_listener.cc
@@ -16,6 +16,7 @@
#include "net/url_request/url_request.h"
using content::BrowserThread;
+using content::GlobalRequestID;
struct UserScriptListener::ProfileData {
// True if the user scripts contained in |url_patterns| are ready for
diff --git a/chrome/browser/extensions/user_script_listener.h b/chrome/browser/extensions/user_script_listener.h
index 8efb34b..99ff409 100644
--- a/chrome/browser/extensions/user_script_listener.h
+++ b/chrome/browser/extensions/user_script_listener.h
@@ -14,13 +14,16 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+namespace content {
+struct GlobalRequestID;
+}
+
namespace net {
class URLRequest;
} // namespace net
class Extension;
class URLPattern;
-struct GlobalRequestID;
// This class handles delaying of resource loads that depend on unloaded user
// scripts. For each request that comes in, we check if it depends on a user
@@ -43,7 +46,7 @@ class UserScriptListener
virtual bool ShouldDelayRequest(
net::URLRequest* request,
const ResourceDispatcherHostRequestInfo& request_info,
- const GlobalRequestID& request_id) OVERRIDE;
+ const content::GlobalRequestID& request_id) OVERRIDE;
virtual void WillShutdownResourceQueue() OVERRIDE;
friend class base::RefCountedThreadSafe<UserScriptListener>;
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index cbba08a..b09136d 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -15,18 +15,15 @@
#include "chrome/test/base/testing_profile.h"
#include "content/browser/mock_resource_context.h"
#include "content/browser/renderer_host/dummy_resource_handler.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/browser/renderer_host/resource_queue.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/notification_service.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_test_job.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-
-class Profile;
-
using content::DummyResourceHandler;
namespace {
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 95056c2..598ca2b 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -26,6 +26,7 @@
#include "net/url_request/url_request_status.h"
using content::BrowserThread;
+using content::OpenURLParams;
using content::WebContents;
const char kManifestKey[] = "manifest";
diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc
index 02a4a58..ef4e9f9 100644
--- a/chrome/browser/extensions/window_open_apitest.cc
+++ b/chrome/browser/extensions/window_open_apitest.cc
@@ -15,6 +15,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "net/base/mock_host_resolver.h"
+using content::OpenURLParams;
+using content::Referrer;
+
// Disabled, http://crbug.com/64899.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) {
CommandLine::ForCurrentProcess()->AppendSwitch(
@@ -160,10 +163,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PopupBlockingHostedApp) {
test_server()->GetURL(popup_app_contents_path + "open_popup.html")
.ReplaceComponents(replace_host);
- browser()->OpenURL(open_tab, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_TYPED);
- browser()->OpenURL(open_popup, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ open_tab, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
+ browser()->OpenURL(OpenURLParams(
+ open_popup, Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_TYPED, false));
WaitForTabsAndPopups(browser(), 3, 1, 0);
}
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index bd797c1..d9d8640 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -66,6 +66,7 @@
#include "ui/views/layout/grid_layout.h"
using content::BrowserThread;
+using content::OpenURLParams;
using content::SSLStatus;
using content::WebContents;
using ui::ViewProp;
@@ -352,7 +353,7 @@ ExternalTabContainer*
////////////////////////////////////////////////////////////////////////////////
// ExternalTabContainer, content::WebContentsDelegate implementation:
-TabContents* ExternalTabContainer::OpenURLFromTab(TabContents* source,
+WebContents* ExternalTabContainer::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
if (pending()) {
pending_open_url_requests_.push_back(params);
@@ -1186,8 +1187,8 @@ TemporaryPopupExternalTabContainer::~TemporaryPopupExternalTabContainer() {
DVLOG(1) << __FUNCTION__;
}
-TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab(
- TabContents* source,
+WebContents* TemporaryPopupExternalTabContainer::OpenURLFromTab(
+ WebContents* source,
const OpenURLParams& params) {
if (!automation_)
return NULL;
@@ -1197,7 +1198,7 @@ TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab(
DCHECK(route_all_top_level_navigations_);
forward_params.disposition = NEW_FOREGROUND_TAB;
}
- TabContents* new_contents =
+ WebContents* new_contents =
ExternalTabContainer::OpenURLFromTab(source, forward_params);
// support only one navigation for a dummy tab before it is killed.
::DestroyWindow(GetNativeView());
diff --git a/chrome/browser/external_tab_container_win.h b/chrome/browser/external_tab_container_win.h
index 8f41759..554e9ab 100644
--- a/chrome/browser/external_tab_container_win.h
+++ b/chrome/browser/external_tab_container_win.h
@@ -120,9 +120,9 @@ class ExternalTabContainer : public content::WebContentsDelegate,
static ExternalTabContainer* GetContainerForTab(HWND tab_window);
// Overridden from content::WebContentsDelegate:
-
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags) OVERRIDE;
virtual void AddNewContents(TabContents* source,
@@ -319,7 +319,7 @@ class ExternalTabContainer : public content::WebContentsDelegate,
// attach tab request.
// Contains the list of URL requests which are pending waiting for an ack
// from the external host.
- std::vector<OpenURLParams> pending_open_url_requests_;
+ std::vector<content::OpenURLParams> pending_open_url_requests_;
// Set to true if the ExternalTabContainer instance is waiting for an ack
// from the host.
@@ -368,8 +368,9 @@ class TemporaryPopupExternalTabContainer : public ExternalTabContainer {
virtual void Observe(int type, const content::NotificationSource& source,
const content::NotificationDetails& details) {}
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags) {
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index 63c7771..e09253d 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -40,9 +40,11 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using WebKit::WebSecurityOrigin;
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
-using WebKit::WebSecurityOrigin;
// GeolocationInfoBarQueueController ------------------------------------------
@@ -244,10 +246,12 @@ bool GeolocationConfirmInfoBarDelegate::LinkClicked(
"https://www.google.com/support/chrome/bin/answer.py?answer=142065";
#endif
- owner()->web_contents()->OpenURL(
+ OpenURLParams params(
google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)),
- GURL(), (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK);
+ Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false);
+ owner()->web_contents()->OpenURL(params);
return false; // Do not dismiss the info bar.
}
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index cd5e0fc..ee7aacb 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -32,6 +32,9 @@
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
InfoBarDelegate* CreateInfobar(InfoBarTabHelper* infobar_helper,
@@ -73,10 +76,13 @@ string16 GoogleURLTrackerInfoBarDelegate::GetLinkText() const {
bool GoogleURLTrackerInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- owner()->web_contents()->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
- "https://www.google.com/support/chrome/bin/answer.py?answer=1618699")),
- GURL(), (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ google_util::AppendGoogleLocaleParam(GURL(
+ "https://www.google.com/support/chrome/bin/answer.py?answer=1618699")),
+ Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
@@ -304,9 +310,11 @@ void GoogleURLTracker::RedoSearch() {
replacements.SetHost(google_url_.host().data(),
url_parse::Component(0, google_url_.host().length()));
GURL new_search_url(search_url_.ReplaceComponents(replacements));
- if (new_search_url.is_valid())
- controller_->tab_contents()->OpenURL(new_search_url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_GENERATED);
+ if (new_search_url.is_valid()) {
+ OpenURLParams params(new_search_url, Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_GENERATED, false);
+ controller_->tab_contents()->OpenURL(params);
+ }
}
void GoogleURLTracker::Observe(int type,
diff --git a/chrome/browser/oom_priority_manager_browsertest.cc b/chrome/browser/oom_priority_manager_browsertest.cc
index a2b5f76..e8da7a0 100644
--- a/chrome/browser/oom_priority_manager_browsertest.cc
+++ b/chrome/browser/oom_priority_manager_browsertest.cc
@@ -12,6 +12,8 @@
#include "content/public/browser/notification_types.h"
#include "googleurl/src/gurl.h"
+using content::OpenURLParams;
+
namespace {
class OomPriorityManagerTest : public InProcessBrowserTest {
diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc
index daaf1b9..9c29b6b 100644
--- a/chrome/browser/plugin_installer_infobar_delegate.cc
+++ b/chrome/browser/plugin_installer_infobar_delegate.cc
@@ -14,6 +14,9 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using content::OpenURLParams;
+using content::Referrer;
+
PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate(
InfoBarTabHelper* infobar_helper,
const string16& plugin_name,
@@ -73,9 +76,11 @@ bool PluginInstallerInfoBarDelegate::LinkClicked(
url = google_util::AppendGoogleLocaleParam(GURL(
"https://www.google.com/support/chrome/bin/answer.py?answer=142064"));
}
- owner()->web_contents()->OpenURL(
- url, GURL(),
+
+ OpenURLParams params(
+ url, Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK);
+ content::PAGE_TRANSITION_LINK, false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index 61c3fb31..615d953 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -29,6 +29,8 @@
#include "webkit/plugins/npapi/plugin_group.h"
#include "webkit/plugins/webplugininfo.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
namespace {
@@ -73,10 +75,12 @@ bool PluginInfoBarDelegate::Cancel() {
}
bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
- owner()->web_contents()->OpenURL(
- google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())), GURL(),
+ OpenURLParams params(
+ google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())), Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK);
+ content::PAGE_TRANSITION_LINK,
+ false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
@@ -260,8 +264,10 @@ string16 OutdatedPluginInfoBarDelegate::GetButtonLabel(
bool OutdatedPluginInfoBarDelegate::Accept() {
content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Update"));
- owner()->web_contents()->OpenURL(update_url_, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ update_url_, Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index 678c413..85b2b79 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -50,6 +50,8 @@ using content::DevToolsAgentHost;
using content::DevToolsAgentHostRegistry;
using content::DevToolsClientHost;
using content::DevToolsManager;
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
// Prerender tests work as follows:
@@ -715,8 +717,9 @@ class PrerenderBrowserTest : public InProcessBrowserTest {
// Since the test needs to wait until the prerendered page has stopped
// loading, rather than the page directly navigated to, need to
// handle browser navigation directly.
- browser()->OpenURL(
- src_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ src_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
ui_test_utils::RunMessageLoop();
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 263f3bc..ac540af 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -38,6 +38,7 @@
#endif
using content::DownloadItem;
+using content::OpenURLParams;
using content::WebContents;
namespace prerender {
@@ -92,7 +93,7 @@ class PrerenderContents::TabContentsDelegateImpl
prerender_contents_(prerender_contents) {
}
- virtual TabContents* OpenURLFromTab(TabContents* source,
+ virtual WebContents* OpenURLFromTab(WebContents* source,
const OpenURLParams& params) OVERRIDE {
// |OpenURLFromTab| is typically called when a frame performs a navigation
// that requires the browser to perform the transition instead of WebKit.
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 6a427dfa..e368150 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -36,6 +36,8 @@
#include "ui/base/l10n/l10n_font_util.h"
#include "ui/gfx/font.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
namespace {
@@ -259,15 +261,17 @@ void CloudPrintSetupFlow::OnUserSubmittedAuth(const std::string& user,
}
void CloudPrintSetupFlow::OnUserClickedLearnMore() {
- web_ui_->tab_contents()->OpenURL(CloudPrintURL::GetCloudPrintLearnMoreURL(),
- GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(CloudPrintURL::GetCloudPrintLearnMoreURL(),
+ Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
void CloudPrintSetupFlow::OnUserClickedPrintTestPage() {
- web_ui_->tab_contents()->OpenURL(CloudPrintURL::GetCloudPrintTestPageURL(),
- GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(CloudPrintURL::GetCloudPrintTestPageURL(),
+ Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
index 2d97154..5827742 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
@@ -9,15 +9,17 @@
#include "chrome/browser/prerender/prerender_final_status.h"
#include "chrome/browser/prerender/prerender_tracker.h"
#include "chrome/browser/renderer_host/chrome_url_request_user_data.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/common/resource_response.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request.h"
+using content::GlobalRequestID;
+
// Maximum time in milliseconds to wait for the safe browsing service to
// verify a URL. After this amount of time the outstanding check will be
// aborted, and the URL will be treated as if it were safe.
diff --git a/chrome/browser/renderer_host/transfer_navigation_resource_handler.cc b/chrome/browser/renderer_host/transfer_navigation_resource_handler.cc
index 38fa16b..25a04c3 100644
--- a/chrome/browser/renderer_host/transfer_navigation_resource_handler.cc
+++ b/chrome/browser/renderer_host/transfer_navigation_resource_handler.cc
@@ -14,6 +14,8 @@
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/public/common/referrer.h"
+using content::GlobalRequestID;
+
namespace {
void RequestTransferURLOnUIThread(int render_process_id,
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index d66a700..4aa2c9c 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -40,6 +40,8 @@
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
// For malware interstitial pages, we link the problematic URL to Google's
@@ -438,14 +440,19 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
} else {
NOTREACHED();
}
- tab()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ tab()->OpenURL(params);
return;
}
if (command == kShowPrivacyCommand) {
// User pressed "Safe Browsing privacy policy".
GURL url(kSbPrivacyPolicyUrl);
- tab()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ tab()->OpenURL(params);
return;
}
@@ -510,8 +517,10 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
kSbReportPhishingErrorUrl,
bad_url_spec,
threat_type == SafeBrowsingService::CLIENT_SIDE_PHISHING_URL);
- tab()->OpenURL(
- report_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ report_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ tab()->OpenURL(params);
return;
}
@@ -524,8 +533,10 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
diagnostic_url = google_util::AppendGoogleLocaleParam(diagnostic_url);
DCHECK(unsafe_resources_[element_index].threat_type ==
SafeBrowsingService::URL_MALWARE);
- tab()->OpenURL(
- diagnostic_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ diagnostic_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ tab()->OpenURL(params);
return;
}
diff --git a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc
index 7e808b3..c53ffc6 100644
--- a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc
+++ b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/sync/test/integration/sessions_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
+using content::OpenURLParams;
using sessions_helper::GetLocalSession;
using sessions_helper::GetSessionData;
using sessions_helper::OpenMultipleTabs;
diff --git a/chrome/browser/tab_contents/insecure_content_infobar_delegate.cc b/chrome/browser/tab_contents/insecure_content_infobar_delegate.cc
index 18b1632..efbeda9 100644
--- a/chrome/browser/tab_contents/insecure_content_infobar_delegate.cc
+++ b/chrome/browser/tab_contents/insecure_content_infobar_delegate.cc
@@ -13,6 +13,8 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+
InsecureContentInfoBarDelegate::InsecureContentInfoBarDelegate(
InfoBarTabHelper* infobar_helper,
InfoBarType type)
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index fd9c06b..551c748 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -88,8 +88,10 @@
#endif
using content::DownloadManager;
+using content::OpenURLParams;
using content::SSLStatus;
using content::UserMetricsAction;
+using content::WebContents;
using WebKit::WebContextMenuData;
using WebKit::WebMediaPlayerAction;
using WebKit::WebURL;
@@ -1830,23 +1832,23 @@ void RenderViewContextMenu::OpenURL(
const GURL& url, const GURL& referrer, int64 frame_id,
WindowOpenDisposition disposition,
content::PageTransition transition) {
- TabContents* new_contents = source_tab_contents_->OpenURL(OpenURLParams(
+ WebContents* new_contents = source_tab_contents_->OpenURL(OpenURLParams(
url, content::Referrer(referrer, params_.referrer_policy), disposition,
transition, false));
+ if (!new_contents)
+ return;
- if (new_contents) {
- RetargetingDetails details;
- details.source_web_contents = source_tab_contents_;
- details.source_frame_id = frame_id;
- details.target_url = url;
- details.target_web_contents = new_contents;
- details.not_yet_in_tabstrip = false;
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_RETARGETING,
- content::Source<Profile>(Profile::FromBrowserContext(
- source_tab_contents_->GetBrowserContext())),
- content::Details<RetargetingDetails>(&details));
- }
+ RetargetingDetails details;
+ details.source_web_contents = source_tab_contents_;
+ details.source_frame_id = frame_id;
+ details.target_url = url;
+ details.target_web_contents = new_contents;
+ details.not_yet_in_tabstrip = false;
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_RETARGETING,
+ content::Source<Profile>(Profile::FromBrowserContext(
+ source_tab_contents_->GetBrowserContext())),
+ content::Details<RetargetingDetails>(&details));
}
void RenderViewContextMenu::CopyImageAt(int x, int y) {
diff --git a/chrome/browser/tab_contents/spelling_bubble_model.cc b/chrome/browser/tab_contents/spelling_bubble_model.cc
index 2ae4b17..793b9b4 100644
--- a/chrome/browser/tab_contents/spelling_bubble_model.cc
+++ b/chrome/browser/tab_contents/spelling_bubble_model.cc
@@ -18,6 +18,9 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
+using content::Referrer;
+
SpellingBubbleModel::SpellingBubbleModel(Profile* profile)
: profile_(profile) {
}
@@ -59,7 +62,8 @@ string16 SpellingBubbleModel::GetLinkText() const {
void SpellingBubbleModel::LinkClicked() {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
- browser->OpenURL(
+ OpenURLParams params(
google_util::AppendGoogleLocaleParam(GURL(chrome::kPrivacyLearnMoreURL)),
- GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
}
diff --git a/chrome/browser/tab_contents/web_drop_target_win.cc b/chrome/browser/tab_contents/web_drop_target_win.cc
index 9e67b5d..cb184e9 100644
--- a/chrome/browser/tab_contents/web_drop_target_win.cc
+++ b/chrome/browser/tab_contents/web_drop_target_win.cc
@@ -29,6 +29,8 @@ using WebKit::WebDragOperationCopy;
using WebKit::WebDragOperationLink;
using WebKit::WebDragOperationMove;
using WebKit::WebDragOperationGeneric;
+using content::OpenURLParams;
+using content::Referrer;
namespace {
@@ -68,15 +70,17 @@ class InterstitialDropTarget {
}
DWORD OnDrop(IDataObject* data_object, DWORD effect) {
- if (ui::ClipboardUtil::HasUrl(data_object)) {
- std::wstring url;
- std::wstring title;
- ui::ClipboardUtil::GetUrl(data_object, &url, &title, true);
- tab_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_AUTO_BOOKMARK);
- return GetPreferredDropEffect(effect);
- }
- return DROPEFFECT_NONE;
+ if (!ui::ClipboardUtil::HasUrl(data_object))
+ return DROPEFFECT_NONE;
+
+ std::wstring url;
+ std::wstring title;
+ ui::ClipboardUtil::GetUrl(data_object, &url, &title, true);
+ OpenURLParams params(
+ GURL(url), Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
+ tab_contents_->OpenURL(params);
+ return GetPreferredDropEffect(effect);
}
private:
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index cb14d7f..fb071b0 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -46,6 +46,8 @@
#endif
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
namespace {
@@ -1062,6 +1064,9 @@ TaskManager* TaskManager::GetInstance() {
void TaskManager::OpenAboutMemory() {
Browser* browser = BrowserList::GetLastActive();
+ OpenURLParams params(
+ GURL(chrome::kChromeUIMemoryURL), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
if (!browser) {
// On OS X, the task manager can be open without any open browser windows.
@@ -1072,11 +1077,9 @@ void TaskManager::OpenAboutMemory() {
if (!profile)
return;
browser = Browser::Create(profile);
- browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ browser->OpenURL(params);
} else {
- browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ browser->OpenURL(params);
// In case the browser window is minimized, show it. If |browser| is a
// non-tabbed window, the call to OpenURL above will have opened a
diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc
index d3ccd48..662d674 100644
--- a/chrome/browser/translate/options_menu_model.cc
+++ b/chrome/browser/translate/options_menu_model.cc
@@ -16,6 +16,8 @@
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
namespace {
@@ -142,9 +144,10 @@ void OptionsMenuModel::ExecuteCommand(int command_id) {
if (web_contents) {
GURL about_url = google_util::AppendGoogleLocaleParam(
GURL(kAboutGoogleTranslateUrl));
- web_contents->OpenURL(
- about_url, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ about_url, Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ web_contents->OpenURL(params);
}
break;
}
diff --git a/chrome/browser/ui/blocked_content/blocked_content_container.cc b/chrome/browser/ui/blocked_content/blocked_content_container.cc
index 1759b54..bab9545 100644
--- a/chrome/browser/ui/blocked_content/blocked_content_container.cc
+++ b/chrome/browser/ui/blocked_content/blocked_content_container.cc
@@ -9,6 +9,7 @@
#include "content/public/browser/web_contents.h"
#include "ui/gfx/rect.h"
+using content::OpenURLParams;
using content::WebContents;
// static
@@ -109,8 +110,8 @@ void BlockedContentContainer::Clear() {
// Overridden from content::WebContentsDelegate:
-TabContents* BlockedContentContainer::OpenURLFromTab(
- TabContents* source,
+WebContents* BlockedContentContainer::OpenURLFromTab(
+ WebContents* source,
const OpenURLParams& params) {
return owner_->web_contents()->OpenURL(params);
}
diff --git a/chrome/browser/ui/blocked_content/blocked_content_container.h b/chrome/browser/ui/blocked_content/blocked_content_container.h
index 99da4e0..829ab46 100644
--- a/chrome/browser/ui/blocked_content/blocked_content_container.h
+++ b/chrome/browser/ui/blocked_content/blocked_content_container.h
@@ -57,8 +57,9 @@ class BlockedContentContainer : public BlockedContentTabHelperDelegate,
// Overridden from content::WebContentsDelegate:
// Forwards OpenURLFromTab to our |owner_|.
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
// Forwards AddNewContents to our |owner_|.
virtual void AddNewContents(TabContents* source,
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 9c38db6..5d2d85a 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -207,7 +207,9 @@
#endif
using base::TimeDelta;
+using content::OpenURLParams;
using content::PluginService;
+using content::Referrer;
using content::SSLStatus;
using content::UserMetricsAction;
using content::WebContents;
@@ -1548,8 +1550,9 @@ void Browser::ReloadInternal(WindowOpenDisposition disposition,
if (current_tab && current_tab->ShowingInterstitialPage()) {
NavigationEntry* entry = current_tab->GetController().GetActiveEntry();
DCHECK(entry); // Should exist if interstitial is showing.
- OpenURL(
- entry->GetURL(), GURL(), disposition, content::PAGE_TRANSITION_RELOAD);
+ OpenURL(OpenURLParams(
+ entry->GetURL(), Referrer(), disposition,
+ content::PAGE_TRANSITION_RELOAD, false));
return;
}
@@ -1565,11 +1568,12 @@ void Browser::ReloadInternal(WindowOpenDisposition disposition,
void Browser::Home(WindowOpenDisposition disposition) {
content::RecordAction(UserMetricsAction("Home"));
- OpenURL(
- profile_->GetHomePage(), GURL(), disposition,
+ OpenURL(OpenURLParams(
+ profile_->GetHomePage(), Referrer(), disposition,
content::PageTransitionFromInt(
content::PAGE_TRANSITION_AUTO_BOOKMARK |
- content::PAGE_TRANSITION_HOME_PAGE));
+ content::PAGE_TRANSITION_HOME_PAGE),
+ false));
}
void Browser::OpenCurrentURL() {
@@ -2250,8 +2254,9 @@ void Browser::ShowHelpTab() {
}
void Browser::OpenPrivacyDashboardTabAndActivate() {
- OpenURL(GURL(kPrivacyDashboardUrl), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURL(OpenURLParams(
+ GURL(kPrivacyDashboardUrl), Referrer(),
+ NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
window_->Activate();
}
@@ -2301,8 +2306,9 @@ void Browser::OpenLanguageOptionsDialog() {
}
void Browser::OpenSystemTabAndActivate() {
- OpenURL(GURL(chrome::kChromeUISystemInfoURL), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURL(OpenURLParams(
+ GURL(chrome::kChromeUISystemInfoURL), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false));
window_->Activate();
}
@@ -2311,16 +2317,18 @@ void Browser::OpenMobilePlanTabAndActivate() {
switches::kEnableMobileSetupDialog)) {
window_->ShowMobileSetup();
} else {
- OpenURL(GURL(chrome::kChromeUIMobileSetupURL), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURL(OpenURLParams(
+ GURL(chrome::kChromeUIMobileSetupURL), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false));
window_->Activate();
}
}
#endif
void Browser::OpenPluginsTabAndActivate() {
- OpenURL(GURL(chrome::kChromeUIPluginsURL), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURL(OpenURLParams(
+ GURL(chrome::kChromeUIPluginsURL), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false));
window_->Activate();
}
@@ -3004,18 +3012,7 @@ void Browser::UpdateUIForNavigationInTab(TabContentsWrapper* contents,
///////////////////////////////////////////////////////////////////////////////
// Browser, PageNavigator implementation:
-// TODO(adriansc): Remove this method once refactoring changed all call sites.
-TabContents* Browser::OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) {
- // For specifying a referrer, use the version of OpenURL taking OpenURLParams.
- DCHECK(referrer.is_empty());
- return OpenURLFromTab(NULL, OpenURLParams(
- url, content::Referrer(), disposition, transition, false));
-}
-
-TabContents* Browser::OpenURL(const OpenURLParams& params) {
+WebContents* Browser::OpenURL(const OpenURLParams& params) {
return OpenURLFromTab(NULL, params);
}
@@ -3424,7 +3421,7 @@ void Browser::TabStripEmpty() {
///////////////////////////////////////////////////////////////////////////////
// Browser, content::WebContentsDelegate implementation:
-TabContents* Browser::OpenURLFromTab(TabContents* source,
+WebContents* Browser::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
browser::NavigateParams nav_params(this, params.url, params.transition);
nav_params.source_contents =
@@ -4076,8 +4073,12 @@ void Browser::URLStarredChanged(TabContentsWrapper* source, bool starred) {
void Browser::FileSelected(const FilePath& path, int index, void* params) {
profile_->set_last_selected_directory(path.DirName());
GURL file_url = net::FilePathToFileURL(path);
- if (!file_url.is_empty())
- OpenURL(file_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ if (file_url.is_empty())
+ return;
+
+ OpenURL(OpenURLParams(
+ file_url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 7ef9bc0..d388b05 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -44,8 +44,8 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/extensions/extension_constants.h"
-#include "content/browser/tab_contents/page_navigator.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/page_zoom.h"
@@ -81,7 +81,7 @@ class Browser : public TabHandlerDelegate,
public BlockedContentTabHelperDelegate,
public BookmarkTabHelperDelegate,
public ExtensionTabHelperDelegate,
- public PageNavigator,
+ public content::PageNavigator,
public CommandUpdater::CommandUpdaterDelegate,
public content::NotificationObserver,
public SelectFileDialog::Listener,
@@ -757,14 +757,9 @@ class Browser : public TabHandlerDelegate,
// Interface implementations ////////////////////////////////////////////////
- // Overridden from PageNavigator:
- // Deprecated. Please use the one-argument variant instead.
- // TODO(adriansc): Remove this method once refactoring changed all call sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) OVERRIDE;
- virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE;
+ // Overridden from content::PageNavigator:
+ virtual content::WebContents* OpenURL(
+ const content::OpenURLParams& params) OVERRIDE;
// Overridden from CommandUpdater::CommandUpdaterDelegate:
virtual void ExecuteCommand(int id) OVERRIDE;
@@ -918,8 +913,9 @@ class Browser : public TabHandlerDelegate,
};
// Overridden from content::WebContentsDelegate:
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags) OVERRIDE;
virtual void AddNewContents(TabContents* source,
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index d571c10..61a3564 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -61,6 +61,8 @@
#include "chrome/browser/browser_process.h"
#endif
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
namespace {
@@ -302,7 +304,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) {
// Navigate to a page that triggers a cross-site transition.
ASSERT_TRUE(test_server()->Start());
GURL url2(test_server()->GetURL("files/title1.html"));
- browser()->OpenURL(url2, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url2, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
ui_test_utils::WindowedNotificationObserver host_destroyed_observer(
content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index ffb2d72..12fca50 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -124,6 +124,8 @@
#endif
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
namespace {
@@ -1310,8 +1312,10 @@ string16 LearnMoreInfoBar::GetLinkText() const {
}
bool LearnMoreInfoBar::LinkClicked(WindowOpenDisposition disposition) {
- owner()->web_contents()->OpenURL(learn_more_url_, GURL(), disposition,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ learn_more_url_, Referrer(), disposition, content::PAGE_TRANSITION_LINK,
+ false);
+ owner()->web_contents()->OpenURL(params);
return false;
}
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 6acc870..7289caa 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -35,6 +35,7 @@
#include "content/public/browser/notification_service.h"
#include "net/http/http_util.h"
+using content::GlobalRequestID;
using content::WebContents;
namespace {
diff --git a/chrome/browser/ui/browser_navigator.h b/chrome/browser/ui/browser_navigator.h
index ef37d3f..1a82cfe 100644
--- a/chrome/browser/ui/browser_navigator.h
+++ b/chrome/browser/ui/browser_navigator.h
@@ -8,7 +8,7 @@
#include <string>
-#include "content/browser/renderer_host/global_request_id.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/referrer.h"
#include "googleurl/src/gurl.h"
@@ -185,7 +185,7 @@ struct NavigateParams {
// Refers to a navigation that was parked in the browser in order to be
// transferred to another RVH. Only used in case of a redirection of a request
// to a different site that created a new RVH.
- GlobalRequestID transferred_global_request_id;
+ content::GlobalRequestID transferred_global_request_id;
private:
NavigateParams();
diff --git a/chrome/browser/ui/cocoa/about_window_controller.mm b/chrome/browser/ui/cocoa/about_window_controller.mm
index 83d5b41..f156a40 100644
--- a/chrome/browser/ui/cocoa/about_window_controller.mm
+++ b/chrome/browser/ui/cocoa/about_window_controller.mm
@@ -27,6 +27,9 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
void AttributedStringAppendString(NSMutableAttributedString* attr_str,
@@ -619,8 +622,10 @@ static BOOL recentShownUserActionFailedStatus = NO;
// We always create a new window, so there's no need to try to re-use
// an existing one just to pass in the NEW_WINDOW disposition.
Browser* browser = Browser::Create(profile_);
- browser->OpenURL(GURL([link UTF8String]), GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL([link UTF8String]), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
browser->window()->Show();
return YES;
}
diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
index 748e15d..dcd8b23 100644
--- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
@@ -26,6 +26,9 @@
#include "content/public/browser/web_contents_delegate.h"
#include "googleurl/src/gurl.h"
+using content::OpenURLParams;
+using content::Referrer;
+
@interface AnyResultValue : NSObject {
@private
scoped_nsobject<NSAppleEventDescriptor> descriptor;
@@ -390,12 +393,13 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) {
NavigationEntry* entry =
tabContents_->tab_contents()->GetController().GetLastCommittedEntry();
if (entry) {
- tabContents_->tab_contents()->OpenURL(
+ tabContents_->tab_contents()->OpenURL(OpenURLParams(
GURL(chrome::kViewSourceScheme + std::string(":") +
entry->GetURL().spec()),
- GURL(),
+ Referrer(),
NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ content::PAGE_TRANSITION_LINK,
+ false));
}
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index a77a617..40e524e 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -53,6 +53,8 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/mac/nsimage_cache.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
// Bookmark bar state changing and animations
@@ -1109,8 +1111,10 @@ void RecordAppLaunch(Profile* profile, GURL url) {
// Actually open the URL. This is the last chance for a unit test to
// override.
- (void)openURL:(GURL)url disposition:(WindowOpenDisposition)disposition {
- browser_->OpenURL(
- url, GURL(), disposition, content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ OpenURLParams params(
+ url, Referrer(), disposition, content::PAGE_TRANSITION_AUTO_BOOKMARK,
+ false);
+ browser_->OpenURL(params);
}
- (void)clearMenuTagMap {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
index 375b78e..a402b43 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
@@ -16,6 +16,8 @@
#include "content/public/browser/user_metrics.h"
#include "ui/base/text/text_elider.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
namespace {
@@ -94,8 +96,10 @@ const NSUInteger kMaximumMenuPixelsWide = 300;
browser = Browser::Create(bridge_->GetProfile());
WindowOpenDisposition disposition =
event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
- browser->OpenURL(node->url(), GURL(), disposition,
- content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ OpenURLParams params(
+ node->url(), Referrer(), disposition,
+ content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
+ browser->OpenURL(params);
}
// Open sites under BookmarkNode with the specified disposition.
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index bdc2ca8..45f205e 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -146,6 +146,8 @@
// longer indicate that the window is shrinking from an apparent zoomed state)
// and if it's set we continue to constrain the resize.
+using content::OpenURLParams;
+using content::Referrer;
using content::WebContents;
@interface NSWindow (NSPrivateApis)
@@ -1756,8 +1758,10 @@ enum {
if (web_contents) {
GURL helpUrl =
google_util::AppendGoogleLocaleParam(GURL(chrome::kCrashReasonURL));
- web_contents->OpenURL(
- helpUrl, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ helpUrl, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ web_contents->OpenURL(params);
}
}
}
diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
index 702da38..dc1c730 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
@@ -35,6 +35,9 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
+using content::OpenURLParams;
+using content::Referrer;
+
// A class that loads the extension icon on the I/O thread before showing the
// confirmation dialog to uninstall the given extension.
// Also acts as the extension's UI delegate in order to display the dialog.
@@ -245,8 +248,10 @@ int CurrentTabId() {
case kExtensionContextName: {
GURL url(std::string(extension_urls::kGalleryBrowsePrefix) +
std::string("/detail/") + extension_->id());
- browser->OpenURL(
- url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ browser->OpenURL(params);
break;
}
case kExtensionContextOptions: {
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index c67e774..4d4aabe 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -20,6 +20,9 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
+using content::OpenURLParams;
+using content::Referrer;
+
@interface ExtensionInstallDialogController ()
- (bool)isInlineInstall;
- (void)appendRatingStar:(const SkBitmap*)skiaImage;
@@ -124,9 +127,9 @@ void AppendRatingStarsShim(const SkBitmap* skiaImage, void* data) {
- (IBAction)storeLinkClicked:(id)sender {
GURL store_url(
extension_urls::GetWebstoreItemDetailURLPrefix() + extension_->id());
- BrowserList::GetLastActiveWithProfile(profile_)->
- OpenURL(store_url, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ BrowserList::GetLastActiveWithProfile(profile_)->OpenURL(OpenURLParams(
+ store_url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false));
delegate_->InstallUIAbort(/*user_initiated=*/true);
[NSApp endSheet:[self window]];
diff --git a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
index 7fa2988..2f3a050 100644
--- a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
@@ -17,6 +17,9 @@
#include "chrome/browser/ui/cocoa/event_utils.h"
#include "webkit/glue/window_open_disposition.h"
+using content::OpenURLParams;
+using content::Referrer;
+
@implementation HistoryMenuCocoaController
- (id)initWithBridge:(HistoryMenuBridge*)bridge {
@@ -47,8 +50,10 @@
node->session_id, UNKNOWN);
} else {
DCHECK(node->url.is_valid());
- browser->OpenURL(node->url, GURL(), disposition,
- content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ OpenURLParams params(
+ node->url, Referrer(), disposition,
+ content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
+ browser->OpenURL(params);
}
}
diff --git a/chrome/browser/ui/cocoa/page_info_bubble_controller.mm b/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
index 26ee5a5..39e0652 100644
--- a/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
@@ -32,6 +32,8 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::SSLStatus;
@interface PageInfoBubbleController (Private)
@@ -214,8 +216,10 @@ void ShowPageInfoBubble(gfx::NativeWindow parent,
GURL url = google_util::AppendGoogleLocaleParam(
GURL(chrome::kPageInfoHelpCenterURL));
Browser* browser = BrowserList::GetLastActive();
- browser->OpenURL(
- url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ browser->OpenURL(params);
}
// This will create the subviews for the page info window. The general layout
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index 447197f..2a0bd59 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -66,6 +66,8 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/mac/nsimage_cache.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
NSString* const kTabStripNumberOfTabsChanged = @"kTabStripNumberOfTabsChanged";
@@ -1882,9 +1884,9 @@ private:
}
case CURRENT_TAB:
content::RecordAction(UserMetricsAction("Tab_DropURLOnTab"));
- tabStripModel_->GetTabContentsAt(index)
- ->tab_contents()->OpenURL(*url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ *url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
+ tabStripModel_->GetTabContentsAt(index)->tab_contents()->OpenURL(params);
tabStripModel_->ActivateTabAt(index, true);
break;
default:
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index a5f5f68..0affff4 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -61,6 +61,9 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/rect.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
// Height of the toolbar in pixels when the bookmark bar is closed.
@@ -755,8 +758,9 @@ class NotificationBridge : public content::NotificationObserver {
OmniboxView::StripJavascriptSchemas(UTF8ToUTF16(url.spec())));
return;
}
- browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
+ browser_->GetSelectedTabContents()->OpenURL(params);
}
// (URLDropTargetController protocol)
@@ -771,8 +775,9 @@ class NotificationBridge : public content::NotificationObserver {
base::SysNSStringToUTF16(text), string16(), false, false, &match, NULL);
GURL url(match.destination_url);
- browser_->GetSelectedTabContents()->OpenURL(url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
+ browser_->GetSelectedTabContents()->OpenURL(params);
}
// (URLDropTargetController protocol)
diff --git a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
index 3cf49d4..dffc231 100644
--- a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
+++ b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
@@ -20,6 +20,9 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+using content::OpenURLParams;
+using content::Referrer;
+
// Basic sanity check of ViewID use on the mac.
class ViewIDTest : public InProcessBrowserTest {
public:
@@ -108,15 +111,17 @@ IN_PROC_BROWSER_TEST_F(ViewIDTest, Tab) {
// Open 9 new tabs.
for (int i = 1; i <= 9; ++i) {
CheckViewID(static_cast<ViewID>(VIEW_ID_TAB_0 + i), false);
- browser()->OpenURL(GURL(chrome::kAboutBlankURL), GURL(),
- NEW_BACKGROUND_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ GURL(chrome::kAboutBlankURL), Referrer(), NEW_BACKGROUND_TAB,
+ content::PAGE_TRANSITION_TYPED, false));
CheckViewID(static_cast<ViewID>(VIEW_ID_TAB_0 + i), true);
// VIEW_ID_TAB_LAST should always be available.
CheckViewID(VIEW_ID_TAB_LAST, true);
}
// Open the 11th tab.
- browser()->OpenURL(GURL(chrome::kAboutBlankURL), GURL(),
- NEW_BACKGROUND_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ GURL(chrome::kAboutBlankURL), Referrer(), NEW_BACKGROUND_TAB,
+ content::PAGE_TRANSITION_TYPED, false));
CheckViewID(VIEW_ID_TAB_LAST, true);
}
diff --git a/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm b/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm
index e08cc45..c4804d1 100644
--- a/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm
@@ -21,6 +21,9 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
// The width of the window, in view coordinates. The height will be
@@ -112,8 +115,10 @@ const CGFloat kTextWidth = kWindowWidth - (kImageSize + kImageSpacing +
- (IBAction)showChromeWebStore:(id)sender {
GURL url(l10n_util::GetStringUTF8(IDS_WEBSTORE_URL));
Browser* browser = BrowserList::GetLastActive();
- browser->OpenURL(url, GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ browser->OpenURL(params);
}
// A picker button has been pressed - invoke corresponding service.
diff --git a/chrome/browser/ui/gtk/about_chrome_dialog.cc b/chrome/browser/ui/gtk/about_chrome_dialog.cc
index d1d7f88..04d182f 100644
--- a/chrome/browser/ui/gtk/about_chrome_dialog.cc
+++ b/chrome/browser/ui/gtk/about_chrome_dialog.cc
@@ -28,6 +28,8 @@
#include "ui/gfx/image/image.h"
#include "webkit/glue/webkit_glue.h"
+using content::OpenURLParams;
+
namespace {
// Left or right margin.
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
index c0e1881..d707d80 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
@@ -51,6 +51,7 @@
#include "ui/gfx/image/cairo_cached_surface.h"
#include "ui/gfx/image/image.h"
+using content::PageNavigator;
using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
index 300f9f8..0c6632b 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
@@ -36,9 +36,12 @@ class Browser;
class BrowserWindowGtk;
class GtkThemeService;
class MenuGtk;
-class PageNavigator;
class TabstripOriginProvider;
+namespace content {
+class PageNavigator;
+}
+
class BookmarkBarGtk : public ui::AnimationDelegate,
public BookmarkModelObserver,
public MenuBarHelper::Delegate,
@@ -62,7 +65,7 @@ class BookmarkBarGtk : public ui::AnimationDelegate,
// Sets the PageNavigator that is used when the user selects an entry on
// the bookmark bar.
- void SetPageNavigator(PageNavigator* navigator);
+ void SetPageNavigator(content::PageNavigator* navigator);
// Create the contents of the bookmark bar.
void Init();
@@ -297,7 +300,7 @@ class BookmarkBarGtk : public ui::AnimationDelegate,
void OnEditBookmarksEnabledChanged();
// Used for opening urls.
- PageNavigator* page_navigator_;
+ content::PageNavigator* page_navigator_;
Browser* browser_;
BrowserWindowGtk* window_;
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc
index 6a7515c..24e31df 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -25,6 +25,9 @@
#include "ui/gfx/gtk_util.h"
#include "webkit/glue/window_open_disposition.h"
+using content::OpenURLParams;
+using content::PageNavigator;
+
namespace {
void SetImageMenuItem(GtkWidget* menu_item,
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
index 497216a..5bfcba2 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
@@ -19,11 +19,14 @@
#include "webkit/glue/window_open_disposition.h"
class Profile;
-class PageNavigator;
class BookmarkModel;
class BookmarkNode;
class MenuGtk;
+namespace content {
+class PageNavigator;
+}
+
typedef struct _GdkDragContext GdkDragContext;
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GtkSelectionData GtkSelectionData;
@@ -35,7 +38,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
// Creates a BookmarkMenuController showing the children of |node| starting
// at index |start_child_index|.
BookmarkMenuController(Profile* profile,
- PageNavigator* page_navigator,
+ content::PageNavigator* page_navigator,
GtkWindow* window,
const BookmarkNode* node,
int start_child_index);
@@ -99,7 +102,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
GdkDragContext*, GtkSelectionData*, guint, guint);
Profile* profile_;
- PageNavigator* page_navigator_;
+ content::PageNavigator* page_navigator_;
// Parent window of this menu.
GtkWindow* parent_window_;
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc
index cd23414..8d50903 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc
@@ -17,6 +17,9 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::PageNavigator;
+
// Per chrome/app/chrome_command_ids.h, values < 4000 are for "dynamic menu
// items". We only use one command id for all the bookmarks, because we handle
// bookmark item activations directly. So we pick a suitably large random value
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h b/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h
index 0c091d7..67dc8e5 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h
@@ -16,7 +16,10 @@ class Browser;
class BookmarkModel;
class BookmarkNode;
class MenuGtk; // See below for why we need this.
+
+namespace content {
class PageNavigator;
+}
// BookmarkNodeMenuModel builds a SimpleMenuModel on demand when the menu is
// shown, and automatically destroys child models when the menu is closed.
@@ -25,7 +28,7 @@ class BookmarkNodeMenuModel : public ui::SimpleMenuModel {
BookmarkNodeMenuModel(ui::SimpleMenuModel::Delegate* delegate,
BookmarkModel* model,
const BookmarkNode* node,
- PageNavigator* page_navigator);
+ content::PageNavigator* page_navigator);
virtual ~BookmarkNodeMenuModel();
// From SimpleMenuModel. Takes care of deleting submenus.
@@ -64,7 +67,7 @@ class BookmarkNodeMenuModel : public ui::SimpleMenuModel {
const BookmarkNode* node_;
// The page navigator used to open bookmarks in ActivatedAt().
- PageNavigator* page_navigator_;
+ content::PageNavigator* page_navigator_;
// A list of the submenus we own and will need to delete.
std::vector<BookmarkNodeMenuModel*> submenus_;
diff --git a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
index 9d08063..01e8a8e 100644
--- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
@@ -21,6 +21,8 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/gtk_util.h"
+using content::OpenURLParams;
+
namespace {
const int kLeftColumnMinWidth = 250;
diff --git a/chrome/browser/ui/gtk/global_history_menu.cc b/chrome/browser/ui/gtk/global_history_menu.cc
index 3f941b6..4bda136 100644
--- a/chrome/browser/ui/gtk/global_history_menu.cc
+++ b/chrome/browser/ui/gtk/global_history_menu.cc
@@ -31,6 +31,8 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/gtk_util.h"
+using content::OpenURLParams;
+
namespace {
// The maximum number of most visited items to display.
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index 4c36500..3bcc7eb 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -70,6 +70,8 @@
#include "ui/gfx/image/image.h"
#include "webkit/glue/window_open_disposition.h"
+using content::OpenURLParams;
+
namespace {
// We are positioned with a little bit of extra space that we don't use now.
diff --git a/chrome/browser/ui/gtk/page_info_bubble_gtk.cc b/chrome/browser/ui/gtk/page_info_bubble_gtk.cc
index e7c9e4d..8a0cf6d 100644
--- a/chrome/browser/ui/gtk/page_info_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/page_info_bubble_gtk.cc
@@ -28,7 +28,7 @@
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
-class Profile;
+using content::OpenURLParams;
using content::SSLStatus;
diff --git a/chrome/browser/ui/gtk/sad_tab_gtk.cc b/chrome/browser/ui/gtk/sad_tab_gtk.cc
index f365e30..202a502 100644
--- a/chrome/browser/ui/gtk/sad_tab_gtk.cc
+++ b/chrome/browser/ui/gtk/sad_tab_gtk.cc
@@ -17,6 +17,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
using content::WebContents;
namespace {
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
index b41c088..dfd2b88 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/notification_types.h"
#include "ui/gfx/screen.h"
+using content::OpenURLParams;
using content::WebContents;
namespace {
@@ -171,8 +172,8 @@ DraggedTabData DraggedTabControllerGtk::InitDraggedTabData(TabGtk* tab) {
////////////////////////////////////////////////////////////////////////////////
// DraggedTabControllerGtk, content::WebContentsDelegate implementation:
-TabContents* DraggedTabControllerGtk::OpenURLFromTab(
- TabContents* source,
+WebContents* DraggedTabControllerGtk::OpenURLFromTab(
+ WebContents* source,
const OpenURLParams& params) {
if (drag_data_->GetSourceTabData()->original_delegate_) {
OpenURLParams forward_params = params;
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h
index 4cbf515..45ec934 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h
+++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h
@@ -85,8 +85,9 @@ class DraggedTabControllerGtk : public content::NotificationObserver,
DraggedTabData InitDraggedTabData(TabGtk* tab);
// Overridden from content::WebContentsDelegate:
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags) OVERRIDE;
virtual void AddNewContents(TabContents* source,
diff --git a/chrome/browser/ui/gtk/view_id_util_browsertest.cc b/chrome/browser/ui/gtk/view_id_util_browsertest.cc
index 255b5a3..ae9338e 100644
--- a/chrome/browser/ui/gtk/view_id_util_browsertest.cc
+++ b/chrome/browser/ui/gtk/view_id_util_browsertest.cc
@@ -10,6 +10,8 @@
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
+using content::OpenURLParams;
+
class ViewIDTest : public InProcessBrowserTest {
public:
ViewIDTest() : root_window_(NULL) {}
diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
index c72d04e..af40ebb 100644
--- a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
+++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc
@@ -313,11 +313,6 @@ GtkWidget* WebIntentPickerGtk::GetServiceButton(size_t index) {
WebIntentPickerGtk::InlineDispositionDelegate::InlineDispositionDelegate() {}
WebIntentPickerGtk::InlineDispositionDelegate::~InlineDispositionDelegate() {}
-TabContents* WebIntentPickerGtk::InlineDispositionDelegate::OpenURLFromTab(
- TabContents* source,
- const OpenURLParams& params) {
- return NULL;
-}
bool WebIntentPickerGtk::InlineDispositionDelegate::IsPopupOrPanel(
const TabContents* source) const {
diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.h b/chrome/browser/ui/gtk/web_intent_picker_gtk.h
index 9c434ed..ccf2571 100644
--- a/chrome/browser/ui/gtk/web_intent_picker_gtk.h
+++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.h
@@ -59,8 +59,6 @@ class WebIntentPickerGtk : public WebIntentPicker,
public:
InlineDispositionDelegate();
virtual ~InlineDispositionDelegate();
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
virtual bool IsPopupOrPanel(const TabContents* source) const OVERRIDE;
virtual bool ShouldAddNavigationToHistory(
const history::HistoryAddPageArgs& add_page_args,
diff --git a/chrome/browser/ui/login/login_prompt_browsertest.cc b/chrome/browser/ui/login/login_prompt_browsertest.cc
index ba8dcea..c879992 100644
--- a/chrome/browser/ui/login/login_prompt_browsertest.cc
+++ b/chrome/browser/ui/login/login_prompt_browsertest.cc
@@ -22,6 +22,9 @@
#include "net/base/auth.h"
#include "net/base/mock_host_resolver.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
class LoginPromptBrowserTest : public InProcessBrowserTest {
@@ -247,8 +250,8 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, PrefetchAuthCancels) {
observer.Register(content::Source<NavigationController>(controller));
WindowedLoadStopObserver load_stop_waiter(controller, 1);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
load_stop_waiter.Wait();
EXPECT_TRUE(observer.handlers_.empty());
@@ -282,12 +285,13 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) {
// no_auth_page_2.
WindowedLoadStopObserver load_stop_waiter(controller, 2);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- auth_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ auth_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
auth_needed_waiter.Wait();
WindowedAuthCancelledObserver auth_cancelled_waiter(controller);
- browser()->OpenURL(
- no_auth_page_2, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ no_auth_page_2, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_cancelled_waiter.Wait();
load_stop_waiter.Wait();
EXPECT_TRUE(observer.handlers_.empty());
@@ -298,8 +302,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) {
// As above, we wait for two LOAD_STOP events; one for each navigation.
WindowedLoadStopObserver load_stop_waiter(controller, 2);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- auth_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ auth_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
WindowedAuthCancelledObserver auth_cancelled_waiter(controller);
ASSERT_TRUE(browser()->CanGoBack());
@@ -321,8 +326,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) {
// We wait for two LOAD_STOP events; one for each navigation.
WindowedLoadStopObserver load_stop_waiter(controller, 2);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- auth_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ auth_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
WindowedAuthCancelledObserver auth_cancelled_waiter(controller);
ASSERT_TRUE(browser()->CanGoForward());
@@ -336,8 +342,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth) {
{
WindowedLoadStopObserver load_stop_waiter(controller, 1);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- auth_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ auth_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
WindowedAuthCancelledObserver auth_cancelled_waiter(controller);
LoginHandler* handler = *observer.handlers_.begin();
@@ -371,8 +378,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmCancellation) {
{
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
}
@@ -425,8 +433,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, MultipleRealmConfirmation) {
{
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
}
@@ -473,8 +482,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, IncorrectConfirmation) {
{
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
}
@@ -547,8 +557,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, NoLoginPromptForFavicon) {
{
GURL test_page = test_server()->GetURL(kFaviconTestPage);
WindowedLoadStopObserver load_stop_waiter(controller, 1);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
load_stop_waiter.Wait();
}
@@ -558,8 +569,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, NoLoginPromptForFavicon) {
GURL test_page = test_server()->GetURL(kFaviconResource);
WindowedLoadStopObserver load_stop_waiter(controller, 1);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
ASSERT_EQ(1u, observer.handlers_.size());
@@ -610,8 +622,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, BlockCrossdomainPrompt) {
test_page = test_page.ReplaceComponents(replacements);
WindowedLoadStopObserver load_stop_waiter(controller, 1);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
load_stop_waiter.Wait();
}
@@ -631,8 +644,9 @@ IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, BlockCrossdomainPrompt) {
test_page = test_page.ReplaceComponents(replacements);
WindowedAuthNeededObserver auth_needed_waiter(controller);
- browser()->OpenURL(
- test_page, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_page, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
auth_needed_waiter.Wait();
ASSERT_EQ(1u, observer.handlers_.size());
diff --git a/chrome/browser/ui/panels/panel_settings_menu_model.cc b/chrome/browser/ui/panels/panel_settings_menu_model.cc
index cb079dc..6e36c04 100644
--- a/chrome/browser/ui/panels/panel_settings_menu_model.cc
+++ b/chrome/browser/ui/panels/panel_settings_menu_model.cc
@@ -16,6 +16,9 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::OpenURLParams;
+using content::Referrer;
+
PanelSettingsMenuModel::PanelSettingsMenuModel(Panel* panel)
: ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)),
panel_(panel) {
@@ -75,12 +78,13 @@ void PanelSettingsMenuModel::ExecuteCommand(int command_id) {
Browser* browser = panel_->browser();
switch (command_id) {
- case COMMAND_NAME:
- browser->OpenURL(extension->GetHomepageURL(),
- GURL(),
- NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ case COMMAND_NAME: {
+ OpenURLParams params(
+ extension->GetHomepageURL(), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
break;
+ }
case COMMAND_CONFIGURE:
DCHECK(!extension->options_url().is_empty());
browser->GetProfile()->GetExtensionProcessManager()->OpenOptionsPage(
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 0dd9f97c..f5db878 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -32,7 +32,9 @@
#include "ui/gfx/image/image.h"
#include "webkit/plugins/npapi/plugin_group.h"
+using content::OpenURLParams;
using content::PluginService;
+using content::Referrer;
using content::UserMetricsAction;
using webkit::npapi::PluginGroup;
using webkit::WebPluginInfo;
@@ -129,8 +131,10 @@ void PDFEnableAdobeReaderInfoBarDelegate::OnNo() {
// Launch the url to get the latest Adbobe Reader installer.
void OpenReaderUpdateURL(TabContents* tab) {
- tab->OpenURL(GURL(kReaderUpdateUrl), GURL(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL(kReaderUpdateUrl), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ tab->OpenURL(params);
}
// Opens the PDF using Adobe Reader.
diff --git a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
index 5d321bc..a5bc9c8 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
@@ -11,6 +11,9 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/common/url_constants.h"
+using content::OpenURLParams;
+using content::Referrer;
+
class ToolbarModelTest : public BrowserWithTestWindowTest {
public:
ToolbarModelTest() {}
@@ -20,8 +23,9 @@ class ToolbarModelTest : public BrowserWithTestWindowTest {
const std::string& expected_text,
bool should_display) {
TabContents* contents = browser()->GetTabContentsAt(0);
- browser()->OpenURL(GURL(url), GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ GURL(url), Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
+ false));
// Check while loading.
EXPECT_EQ(should_display, browser()->toolbar_model()->ShouldDisplayURL());
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index a21b870..84cbe24 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -51,6 +51,8 @@
#include "chrome/installer/util/install_util.h"
#endif // defined(OS_WIN)
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
// The amount of vertical space separating the error label at the bottom from
@@ -625,7 +627,9 @@ void AboutChromeView::LinkClicked(views::Link* source, int event_flags) {
}
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
- browser->OpenURL(url, GURL(), NEW_WINDOW, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), NEW_WINDOW, content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
}
#if defined(OS_WIN) && !defined(USE_AURA)
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 61f7c5a..14306ab 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -37,10 +37,10 @@
#include "chrome/common/pref_names.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
-#include "content/browser/tab_contents/page_navigator.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/page_transition_types.h"
#include "grit/generated_resources.h"
@@ -62,6 +62,9 @@
#include "ui/views/widget/tooltip_manager.h"
#include "ui/views/widget/widget.h"
+using content::OpenURLParams;
+using content::PageNavigator;
+using content::Referrer;
using content::UserMetricsAction;
using views::CustomButton;
using views::DropTargetEvent;
@@ -1029,8 +1032,10 @@ void BookmarkBarView::ButtonPressed(views::Button* sender,
Profile* profile = browser_->profile();
if (node->is_url()) {
RecordAppLaunch(profile, node->url());
- page_navigator_->OpenURL(node->url(), GURL(),
- disposition_from_event_flags, content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ OpenURLParams params(
+ node->url(), Referrer(), disposition_from_event_flags,
+ content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
+ page_navigator_->OpenURL(params);
} else {
bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile,
page_navigator_, node, disposition_from_event_flags);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index 2cc33b6..6ad2fca 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -29,7 +29,10 @@
class BookmarkContextMenu;
class Browser;
+
+namespace content {
class PageNavigator;
+}
namespace ui {
class SlideAnimation;
@@ -79,7 +82,7 @@ class BookmarkBarView : public DetachableToolbarView,
// Sets the PageNavigator that is used when the user selects an entry on
// the bookmark bar.
- void SetPageNavigator(PageNavigator* navigator);
+ void SetPageNavigator(content::PageNavigator* navigator);
// Sets whether the containing browser is showing an infobar. This affects
// layout during animation.
@@ -353,7 +356,7 @@ class BookmarkBarView : public DetachableToolbarView,
content::NotificationRegistrar registrar_;
// Used for opening urls.
- PageNavigator* page_navigator_;
+ content::PageNavigator* page_navigator_;
// Model providing details as to the starred entries/folders that should be
// shown. This is owned by the Profile.
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index e384989..014cf2a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -21,8 +21,8 @@
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chrome/test/base/view_event_test_base.h"
-#include "content/browser/tab_contents/page_navigator.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/page_navigator.h"
#include "content/test/test_browser_thread.h"
#include "grit/generated_resources.h"
#include "ui/base/accessibility/accessibility_types.h"
@@ -37,6 +37,9 @@
#include "ui/views/widget/widget.h"
using content::BrowserThread;
+using content::OpenURLParams;
+using content::PageNavigator;
+using content::WebContents;
#if defined(OS_LINUX)
// See http://crbug.com/40040 for details.
@@ -116,18 +119,7 @@ class ViewsDelegateImpl : public views::ViewsDelegate {
// PageNavigator implementation that records the URL.
class TestingPageNavigator : public PageNavigator {
public:
- // Deprecated. Please use the one-argument variant.
- // TODO(adriansc): Remove this function once refactoring has changed
- // all call sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) OVERRIDE {
- return OpenURL(OpenURLParams(url, content::Referrer(), disposition,
- transition, false));
- }
-
- virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE {
+ virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE {
url_ = params.url;
return NULL;
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
index 3a2f842..5a8f993 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.cc
@@ -17,6 +17,8 @@
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/widget/widget.h"
+using content::PageNavigator;
+
////////////////////////////////////////////////////////////////////////////////
// BookmarkContextMenu, public:
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.h b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.h
index 860a2e7..5c90ab0 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu.h
@@ -35,7 +35,7 @@ class BookmarkContextMenu : public BookmarkContextMenuControllerViewsDelegate,
BookmarkContextMenu(
views::Widget* parent_widget,
Profile* profile,
- PageNavigator* page_navigator,
+ content::PageNavigator* page_navigator,
const BookmarkNode* parent,
const std::vector<const BookmarkNode*>& selection,
bool close_on_remove);
@@ -51,7 +51,7 @@ class BookmarkContextMenu : public BookmarkContextMenuControllerViewsDelegate,
}
// Sets the PageNavigator.
- void SetPageNavigator(PageNavigator* navigator);
+ void SetPageNavigator(content::PageNavigator* navigator);
// Overridden from views::MenuDelegate:
virtual void ExecuteCommand(int command_id) OVERRIDE;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
index f9b337e..310c22a 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
@@ -15,11 +15,12 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/views/widget/widget.h"
+using content::PageNavigator;
using content::UserMetricsAction;
BookmarkContextMenuControllerViews::BookmarkContextMenuControllerViews(
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h
index 28d655c..5a7de19 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h
@@ -11,9 +11,12 @@
#include "base/basictypes.h"
#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
-class PageNavigator;
class Profile;
+namespace content {
+class PageNavigator;
+}
+
namespace views {
class Widget;
}
@@ -55,7 +58,7 @@ class BookmarkContextMenuControllerViews : public BaseBookmarkModelObserver {
views::Widget* parent_widget,
BookmarkContextMenuControllerViewsDelegate* delegate,
Profile* profile,
- PageNavigator* navigator,
+ content::PageNavigator* navigator,
const BookmarkNode* parent,
const std::vector<const BookmarkNode*>& selection);
virtual ~BookmarkContextMenuControllerViews();
@@ -68,8 +71,10 @@ class BookmarkContextMenuControllerViews : public BaseBookmarkModelObserver {
Profile* profile() const { return profile_; }
- void set_navigator(PageNavigator* navigator) { navigator_ = navigator; }
- PageNavigator* navigator() const { return navigator_; }
+ void set_navigator(content::PageNavigator* navigator) {
+ navigator_ = navigator;
+ }
+ content::PageNavigator* navigator() const { return navigator_; }
private:
// Overridden from BaseBookmarkModelObserver:
@@ -85,7 +90,7 @@ class BookmarkContextMenuControllerViews : public BaseBookmarkModelObserver {
views::Widget* parent_widget_;
BookmarkContextMenuControllerViewsDelegate* delegate_;
Profile* profile_;
- PageNavigator* navigator_;
+ content::PageNavigator* navigator_;
const BookmarkNode* parent_;
std::vector<const BookmarkNode*> selection_;
BookmarkModel* model_;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc
index 2e244b7..17244f5 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/test/test_browser_thread.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -24,24 +24,16 @@
#endif
using content::BrowserThread;
+using content::OpenURLParams;
+using content::PageNavigator;
+using content::WebContents;
namespace {
// PageNavigator implementation that records the URL.
class TestingPageNavigator : public PageNavigator {
public:
- // Deprecated. Please use one-argument variant.
- // TODO(adriansc): Remove this method once refactoring changed all call
- // sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) OVERRIDE {
- return OpenURL(OpenURLParams(url, content::Referrer(), disposition,
- transition, false));
- }
-
- virtual TabContents* OpenURL(const OpenURLParams& params) OVERRIDE {
+ virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE {
urls_.push_back(params.url);
return NULL;
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
index b356446..4de786d 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -26,6 +26,7 @@
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/widget/widget.h"
+using content::PageNavigator;
using content::UserMetricsAction;
using views::MenuItemView;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
index 1420f2c..af28087 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
@@ -17,9 +17,12 @@
class BookmarkBarView;
class BookmarkMenuDelegate;
class BookmarkNode;
-class PageNavigator;
class Profile;
+namespace content {
+class PageNavigator;
+}
+
namespace ui {
class OSExchangeData;
} // namespace ui
@@ -49,7 +52,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
// Creates a BookmarkMenuController showing the children of |node| starting
// at |start_child_index|.
BookmarkMenuController(Profile* profile,
- PageNavigator* page_navigator,
+ content::PageNavigator* page_navigator,
views::Widget* parent,
const BookmarkNode* node,
int start_child_index);
@@ -69,7 +72,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
views::MenuItemView* context_menu() const;
// Sets the page navigator.
- void SetPageNavigator(PageNavigator* navigator);
+ void SetPageNavigator(content::PageNavigator* navigator);
void set_observer(Observer* observer) { observer_ = observer; }
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 5495b8d..12e218e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/tab_contents/page_navigator.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -26,6 +26,7 @@
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/widget/widget.h"
+using content::PageNavigator;
using content::UserMetricsAction;
using views::MenuItemView;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
index 2d5999c..d10b364 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
@@ -17,9 +17,12 @@
#include "ui/views/controls/menu/menu_delegate.h"
class BookmarkNode;
-class PageNavigator;
class Profile;
+namespace content {
+class PageNavigator;
+}
+
namespace ui {
class OSExchangeData;
}
@@ -48,7 +51,7 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
};
BookmarkMenuDelegate(Profile* profile,
- PageNavigator* navigator,
+ content::PageNavigator* navigator,
views::Widget* parent,
int first_menu_id);
virtual ~BookmarkMenuDelegate();
@@ -62,7 +65,7 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
bookmark_utils::BookmarkLaunchLocation);
// Sets the PageNavigator.
- void SetPageNavigator(PageNavigator* navigator);
+ void SetPageNavigator(content::PageNavigator* navigator);
// Returns the id given to the next menu.
int next_menu_id() const { return next_menu_id_; }
@@ -160,7 +163,7 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
Profile* profile_;
- PageNavigator* page_navigator_;
+ content::PageNavigator* page_navigator_;
// Parent of menus.
views::Widget* parent_;
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index 70fca75..9bb596bf 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -29,6 +29,9 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
// Size of extension icon in top left of dialog.
@@ -299,8 +302,10 @@ void ExtensionInstallDialogView::LinkClicked(views::Link* source,
int event_flags) {
GURL store_url(
extension_urls::GetWebstoreItemDetailURLPrefix() + extension_->id());
- BrowserList::GetLastActive()->OpenURL(
- store_url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ store_url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK,
+ false);
+ BrowserList::GetLastActive()->OpenURL(params);
GetWidget()->Close();
}
diff --git a/chrome/browser/ui/views/instant_confirm_view.cc b/chrome/browser/ui/views/instant_confirm_view.cc
index 42f3c59..488b6c5 100644
--- a/chrome/browser/ui/views/instant_confirm_view.cc
+++ b/chrome/browser/ui/views/instant_confirm_view.cc
@@ -20,6 +20,9 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+using content::OpenURLParams;
+using content::Referrer;
+
InstantConfirmView::InstantConfirmView(Profile* profile) : profile_(profile) {
views::Label* description_label = new views::Label(
l10n_util::GetStringUTF16(IDS_INSTANT_OPT_IN_MESSAGE));
@@ -80,8 +83,10 @@ bool InstantConfirmView::IsModal() const {
void InstantConfirmView::LinkClicked(views::Link* source, int event_flags) {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
- browser->OpenURL(browser::InstantLearnMoreURL(), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED);
+ OpenURLParams params(
+ browser::InstantLearnMoreURL(), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_TYPED, false);
+ browser->OpenURL(params);
}
namespace browser {
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc
index cda225f..6b8e139 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info_bubble_view.cc
@@ -29,6 +29,8 @@
#include "ui/views/layout/grid_layout.h"
#include "ui/views/widget/widget.h"
+using content::OpenURLParams;
+using content::Referrer;
using content::SSLStatus;
namespace {
@@ -309,8 +311,9 @@ void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) {
GURL url = google_util::AppendGoogleLocaleParam(
GURL(chrome::kPageInfoHelpCenterURL));
Browser* browser = BrowserList::GetLastActive();
- browser->OpenURL(
- url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
+ browser->OpenURL(params);
// NOTE: The bubble closes automatically on deactivation as the link opens.
}
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc
index 3479e1e..7449f2d 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -23,6 +23,7 @@
#include "ui/views/controls/link.h"
#include "ui/views/layout/grid_layout.h"
+using content::OpenURLParams;
using content::WebContents;
static const int kPadding = 20;
diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
index 319400e..1f40719 100644
--- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
@@ -43,6 +43,7 @@
#include <gdk/gdkkeysyms.h> // NOLINT
#endif
+using content::OpenURLParams;
using content::UserMetricsAction;
using content::WebContents;
@@ -416,8 +417,9 @@ bool DefaultTabDragController::GetStartedDrag() const {
///////////////////////////////////////////////////////////////////////////////
// DefaultTabDragController, PageNavigator implementation:
-TabContents* DefaultTabDragController::OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) {
+WebContents* DefaultTabDragController::OpenURLFromTab(
+ WebContents* source,
+ const OpenURLParams& params) {
if (source_tab_drag_data()->original_delegate) {
OpenURLParams forward_params = params;
if (params.disposition == CURRENT_TAB)
diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.h b/chrome/browser/ui/views/tabs/default_tab_drag_controller.h
index e08dbc4..bda6490 100644
--- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.h
+++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.h
@@ -114,8 +114,9 @@ class DefaultTabDragController : public TabDragController,
virtual bool GetStartedDrag() const OVERRIDE;
// Overridden from content::WebContentsDelegate:
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void NavigationStateChanged(const TabContents* source,
unsigned changed_flags) OVERRIDE;
virtual void AddNewContents(TabContents* source,
diff --git a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc
index dccdf0d..44c0d19 100644
--- a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc
+++ b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc
@@ -11,6 +11,9 @@
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "content/browser/tab_contents/tab_contents.h"
+using content::OpenURLParams;
+using content::WebContents;
+
// Incognito profiles are not long-lived, so we always want to store a
// non-incognito profile.
//
@@ -28,8 +31,8 @@ void HtmlDialogTabContentsDelegate::Detach() {
profile_ = NULL;
}
-TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab(
- TabContents* source, const OpenURLParams& params) {
+WebContents* HtmlDialogTabContentsDelegate::OpenURLFromTab(
+ WebContents* source, const OpenURLParams& params) {
if (profile_) {
// Specify a NULL browser for navigation. This will cause Navigate()
// to find a browser matching params.profile or create a new one.
diff --git a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h
index 31f7c4a..4aa45f4 100644
--- a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h
+++ b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h
@@ -32,9 +32,9 @@ class HtmlDialogTabContentsDelegate : public content::WebContentsDelegate {
void Detach();
// content::WebContentsDelegate declarations.
-
- virtual TabContents* OpenURLFromTab(TabContents* source,
- const OpenURLParams& params) OVERRIDE;
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
virtual void AddNewContents(TabContents* source,
TabContents* new_contents,
diff --git a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate_unittest.cc b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate_unittest.cc
index b6360243..01d61783 100644
--- a/chrome/browser/ui/webui/html_dialog_tab_contents_delegate_unittest.cc
+++ b/chrome/browser/ui/webui/html_dialog_tab_contents_delegate_unittest.cc
@@ -21,6 +21,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
class TestTabContentsDelegate : public HtmlDialogTabContentsDelegate {
@@ -72,7 +75,7 @@ TEST_F(HtmlDialogTabContentsDelegateTest, DoNothingMethodsTest) {
TEST_F(HtmlDialogTabContentsDelegateTest, OpenURLFromTabTest) {
test_tab_contents_delegate_->OpenURLFromTab(
- NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(),
+ NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(),
NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
// This should create a new foreground tab in the existing browser.
EXPECT_EQ(1, browser()->tab_count());
@@ -95,7 +98,7 @@ TEST_F(HtmlDialogTabContentsDelegateTest, DetachTest) {
EXPECT_EQ(NULL, test_tab_contents_delegate_->profile());
// Now, none of the following calls should do anything.
test_tab_contents_delegate_->OpenURLFromTab(
- NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(),
+ NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(),
NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
test_tab_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB,
gfx::Rect(), false);
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
index feee76c..810ce22 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
@@ -11,6 +11,9 @@
#include "content/public/browser/notification_types.h"
#include "googleurl/src/gurl.h"
+using content::OpenURLParams;
+using content::Referrer;
+
class NewTabUIBrowserTest : public InProcessBrowserTest {
public:
NewTabUIBrowserTest() {
@@ -55,8 +58,9 @@ IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, LoadNTPInExistingProcess) {
ui_test_utils::WindowedNotificationObserver process_exited_observer(
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
content::NotificationService::AllSources());
- browser()->OpenURL(test_server()->GetURL("files/title1.html"), GURL(),
- CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ test_server()->GetURL("files/title1.html"), Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_TYPED, false));
process_exited_observer.Wait();
}
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index 4ddf8b0..380a396 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -42,6 +42,9 @@
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/image/image.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
SkBitmap GetGAIAPictureForNTP(const gfx::Image& image) {
@@ -127,9 +130,10 @@ void NTPLoginHandler::HandleShowSyncLoginUI(const ListValue* args) {
if (username.empty()) {
// The user isn't signed in, show the sync promo.
if (SyncPromoUI::ShouldShowSyncPromo(profile)) {
- web_ui_->tab_contents()->OpenURL(GURL(chrome::kChromeUISyncPromoURL),
- GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL(chrome::kChromeUISyncPromoURL), Referrer(), CURRENT_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED);
}
} else if (args->GetSize() == 4) {
diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc
index 329c03b..5e5f330 100644
--- a/chrome/browser/ui/webui/options/advanced_options_handler.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc
@@ -47,6 +47,8 @@
#endif
using content::DownloadManager;
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
AdvancedOptionsHandler::AdvancedOptionsHandler() {
@@ -474,9 +476,10 @@ void AdvancedOptionsHandler::ShowCloudPrintManagePage(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ManageCloudPrinters"));
// Open a new tab in the current window for the management page.
Profile* profile = Profile::FromWebUI(web_ui_);
- web_ui_->tab_contents()->OpenURL(
- CloudPrintURL(profile).GetCloudPrintServiceManageURL(),
- GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ CloudPrintURL(profile).GetCloudPrintServiceManageURL(), Referrer(),
+ NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
#if !defined(OS_CHROMEOS)
@@ -484,10 +487,11 @@ void AdvancedOptionsHandler::ShowCloudPrintSetupDialog(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_EnableCloudPrintProxy"));
// Open the connector enable page in the current tab.
Profile* profile = Profile::FromWebUI(web_ui_);
- web_ui_->tab_contents()->OpenURL(
+ OpenURLParams params(
CloudPrintURL(profile).GetCloudPrintServiceEnableURL(
CloudPrintProxyServiceFactory::GetForProfile(profile)->proxy_id()),
- GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
void AdvancedOptionsHandler::HandleDisableCloudPrintConnector(
diff --git a/chrome/browser/ui/webui/options/advanced_options_utils_x11.cc b/chrome/browser/ui/webui/options/advanced_options_utils_x11.cc
index 7b68ba3..b5f8e3b 100644
--- a/chrome/browser/ui/webui/options/advanced_options_utils_x11.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_utils_x11.cc
@@ -17,6 +17,8 @@
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
// Command used to configure GNOME 2 proxy settings.
const char* kGNOME2ProxyConfigCommand[] = {"gnome-network-properties", NULL};
@@ -42,8 +44,10 @@ void ShowLinuxProxyConfigUrl(TabContents* tab_contents) {
const char* name = base::nix::GetDesktopEnvironmentName(env.get());
if (name)
LOG(ERROR) << "Could not find " << name << " network settings in $PATH";
- tab_contents->OpenURL(GURL(kLinuxProxyConfigUrl), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL(kLinuxProxyConfigUrl), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ tab_contents->OpenURL(params);
}
// Start the given proxy configuration utility.
diff --git a/chrome/browser/ui/webui/options2/advanced_options_handler2.cc b/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
index 02f8e1b..05d5343 100644
--- a/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
@@ -47,6 +47,8 @@
#endif
using content::DownloadManager;
+using content::OpenURLParams;
+using content::Referrer;
using content::UserMetricsAction;
namespace options2 {
@@ -476,9 +478,10 @@ void AdvancedOptionsHandler::ShowCloudPrintManagePage(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ManageCloudPrinters"));
// Open a new tab in the current window for the management page.
Profile* profile = Profile::FromWebUI(web_ui_);
- web_ui_->tab_contents()->OpenURL(
- CloudPrintURL(profile).GetCloudPrintServiceManageURL(),
- GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ CloudPrintURL(profile).GetCloudPrintServiceManageURL(), Referrer(),
+ NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
#if !defined(OS_CHROMEOS)
@@ -486,10 +489,11 @@ void AdvancedOptionsHandler::ShowCloudPrintSetupDialog(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_EnableCloudPrintProxy"));
// Open the connector enable page in the current tab.
Profile* profile = Profile::FromWebUI(web_ui_);
- web_ui_->tab_contents()->OpenURL(
+ OpenURLParams params(
CloudPrintURL(profile).GetCloudPrintServiceEnableURL(
CloudPrintProxyServiceFactory::GetForProfile(profile)->proxy_id()),
- GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK);
+ Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
void AdvancedOptionsHandler::HandleDisableCloudPrintConnector(
diff --git a/chrome/browser/ui/webui/options2/advanced_options_utils2_x11.cc b/chrome/browser/ui/webui/options2/advanced_options_utils2_x11.cc
index e505da3..1bba134 100644
--- a/chrome/browser/ui/webui/options2/advanced_options_utils2_x11.cc
+++ b/chrome/browser/ui/webui/options2/advanced_options_utils2_x11.cc
@@ -17,6 +17,8 @@
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
namespace options2 {
@@ -44,8 +46,10 @@ void ShowLinuxProxyConfigUrl(TabContents* tab_contents) {
const char* name = base::nix::GetDesktopEnvironmentName(env.get());
if (name)
LOG(ERROR) << "Could not find " << name << " network settings in $PATH";
- tab_contents->OpenURL(GURL(kLinuxProxyConfigUrl), GURL(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL(kLinuxProxyConfigUrl), Referrer(), NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK, false);
+ tab_contents->OpenURL(params);
}
// Start the given proxy configuration utility.
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index 69b9288..1661317 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -58,6 +58,8 @@
#endif
using content::BrowserThread;
+using content::OpenURLParams;
+using content::Referrer;
using printing::Metafile;
namespace {
@@ -543,11 +545,12 @@ void PrintPreviewHandler::HandlePrintWithCloudPrint() {
void PrintPreviewHandler::HandleManageCloudPrint(const ListValue* /*args*/) {
Browser* browser = BrowserList::GetLastActive();
- browser->OpenURL(CloudPrintURL(browser->profile()).
- GetCloudPrintServiceManageURL(),
- GURL(),
- NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK);
+ browser->OpenURL(OpenURLParams(
+ CloudPrintURL(browser->profile()).GetCloudPrintServiceManageURL(),
+ Referrer(),
+ NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK,
+ false));
}
void PrintPreviewHandler::HandleShowSystemDialog(const ListValue* /*args*/) {
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc
index 232f8d0..9ea1b96 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc
@@ -26,6 +26,9 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
+using content::OpenURLParams;
+using content::Referrer;
+
namespace {
// User actions on the sync promo (aka "Sign in to Chrome").
@@ -201,8 +204,9 @@ void SyncPromoHandler::HandleCloseSyncPromo(const base::ListValue* args) {
GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL(
web_ui_->tab_contents()->GetURL());
- web_ui_->tab_contents()->OpenURL(url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
}
void SyncPromoHandler::HandleInitializeSyncPromo(const base::ListValue* args) {
@@ -232,8 +236,9 @@ void SyncPromoHandler::HandleShowAdvancedSettings(
CloseSyncSetup();
std::string url(chrome::kChromeUISettingsURL);
url += chrome::kSyncSetupSubPage;
- web_ui_->tab_contents()->OpenURL(GURL(url), GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_LINK);
+ OpenURLParams params(
+ GURL(url), Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui_->tab_contents()->OpenURL(params);
RecordUserFlowAction(SYNC_PROMO_ADVANCED_CLICKED);
}