summaryrefslogtreecommitdiffstats
path: root/content/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 /content/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 'content/browser')
-rw-r--r--content/browser/accessibility/renderer_accessibility_browsertest.cc29
-rw-r--r--content/browser/download/download_resource_handler.cc1
-rw-r--r--content/browser/download/download_resource_handler.h4
-rw-r--r--content/browser/renderer_host/async_resource_handler.cc3
-rw-r--r--content/browser/renderer_host/cross_site_resource_handler.cc4
-rw-r--r--content/browser/renderer_host/cross_site_resource_handler.h5
-rw-r--r--content/browser/renderer_host/global_request_id.h40
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.h13
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host.cc3
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host.h16
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_unittest.cc3
-rw-r--r--content/browser/renderer_host/resource_queue.cc3
-rw-r--r--content/browser/renderer_host/resource_queue.h14
-rw-r--r--content/browser/renderer_host/resource_queue_unittest.cc3
-rw-r--r--content/browser/renderer_host/sync_resource_handler.cc4
-rw-r--r--content/browser/ssl/ssl_error_handler.h4
-rw-r--r--content/browser/tab_contents/navigation_controller.cc1
-rw-r--r--content/browser/tab_contents/navigation_controller.h4
-rw-r--r--content/browser/tab_contents/navigation_entry.h8
-rw-r--r--content/browser/tab_contents/page_navigator.cc33
-rw-r--r--content/browser/tab_contents/page_navigator.h75
-rw-r--r--content/browser/tab_contents/tab_contents.cc33
-rw-r--r--content/browser/tab_contents/tab_contents.h13
-rw-r--r--content/browser/tab_contents/web_drag_dest_mac.mm7
-rw-r--r--content/browser/webui/generic_handler.cc7
25 files changed, 102 insertions, 228 deletions
diff --git a/content/browser/accessibility/renderer_accessibility_browsertest.cc b/content/browser/accessibility/renderer_accessibility_browsertest.cc
index 62e406d..0b04b79 100644
--- a/content/browser/accessibility/renderer_accessibility_browsertest.cc
+++ b/content/browser/accessibility/renderer_accessibility_browsertest.cc
@@ -22,6 +22,8 @@
#include "ui/base/win/atl_module.h"
#endif
+using content::OpenURLParams;
+using content::Referrer;
using webkit_glue::WebAccessibility;
namespace {
@@ -131,7 +133,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<body><input type='button' value='push' /><input type='checkbox' />"
"</body></html>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
// Check properties of the root element of the tree.
@@ -193,7 +196,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<input value=\"Hello, world.\"/>"
"</body></html>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
ASSERT_EQ(1U, tree.children.size());
@@ -222,7 +226,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<input value=\"Hello, world.\"/>"
"</body></html>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
ASSERT_EQ(1U, tree.children.size());
@@ -249,7 +254,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<!doctype html>"
"<table border=1><tr><td>1</td><td>2</td></tr></table>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
ASSERT_EQ(1U, tree.children.size());
@@ -290,7 +296,8 @@ IN_PROC_BROWSER_TEST_F(
" }, 1);\n"
"</script>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
base::hash_set<int> ids;
@@ -310,7 +317,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<button>Button 3</button>"
"</body></html>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
ASSERT_EQ(1U, tree.children.size());
@@ -356,7 +364,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
"<!doctype html>"
"<em><code ><h4 ></em>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
base::hash_set<int> ids;
@@ -384,7 +393,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
" </tr>"
"</table>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
const WebAccessibility& table = tree.children[0];
@@ -442,7 +452,8 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
" Some text"
"</div>";
GURL url(url_str);
- browser()->OpenURL(url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
+ browser()->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
const WebAccessibility& tree = GetWebAccessibilityTree();
ASSERT_EQ(1U, tree.children.size());
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 531f209..34d072d 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -17,7 +17,6 @@
#include "content/browser/download/download_request_handle.h"
#include "content/browser/download/download_stats.h"
#include "content/browser/download/interrupt_reasons.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_dispatcher_host_request_info.h"
#include "content/public/browser/browser_thread.h"
diff --git a/content/browser/download/download_resource_handler.h b/content/browser/download/download_resource_handler.h
index 85f669c..5425c51 100644
--- a/content/browser/download/download_resource_handler.h
+++ b/content/browser/download/download_resource_handler.h
@@ -13,8 +13,8 @@
#include "base/timer.h"
#include "content/browser/download/download_id.h"
#include "content/browser/download/download_types.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/resource_handler.h"
+#include "content/public/browser/global_request_id.h"
#include "net/base/net_errors.h"
class DownloadFileManager;
@@ -100,7 +100,7 @@ class DownloadResourceHandler : public ResourceHandler {
void CallStartedCB(net::Error error);
DownloadId download_id_;
- GlobalRequestID global_id_;
+ content::GlobalRequestID global_id_;
int render_view_id_;
scoped_refptr<net::IOBuffer> read_buffer_;
std::string content_disposition_;
diff --git a/content/browser/renderer_host/async_resource_handler.cc b/content/browser/renderer_host/async_resource_handler.cc
index d4b5a15..d463579 100644
--- a/content/browser/renderer_host/async_resource_handler.cc
+++ b/content/browser/renderer_host/async_resource_handler.cc
@@ -12,13 +12,13 @@
#include "base/shared_memory.h"
#include "content/browser/debugger/devtools_netlog_observer.h"
#include "content/browser/host_zoom_map.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_dispatcher_host_request_info.h"
#include "content/browser/renderer_host/resource_message_filter.h"
#include "content/browser/resource_context.h"
#include "content/common/resource_messages.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/common/resource_response.h"
#include "net/base/io_buffer.h"
@@ -27,6 +27,7 @@
#include "webkit/glue/resource_loader_bridge.h"
using base::TimeTicks;
+using content::GlobalRequestID;
namespace {
diff --git a/content/browser/renderer_host/cross_site_resource_handler.cc b/content/browser/renderer_host/cross_site_resource_handler.cc
index a354c10..b93ea22 100644
--- a/content/browser/renderer_host/cross_site_resource_handler.cc
+++ b/content/browser/renderer_host/cross_site_resource_handler.cc
@@ -8,16 +8,18 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/common/resource_response.h"
#include "net/base/io_buffer.h"
#include "net/http/http_response_headers.h"
+using content::GlobalRequestID;
+
namespace {
void OnCrossSiteResponseHelper(int render_process_id,
diff --git a/content/browser/renderer_host/cross_site_resource_handler.h b/content/browser/renderer_host/cross_site_resource_handler.h
index a27a7ee..45e3d15 100644
--- a/content/browser/renderer_host/cross_site_resource_handler.h
+++ b/content/browser/renderer_host/cross_site_resource_handler.h
@@ -10,7 +10,10 @@
#include "net/url_request/url_request_status.h"
class ResourceDispatcherHost;
+
+namespace content {
struct GlobalRequestID;
+}
// Ensures that cross-site responses are delayed until the onunload handler of
// the previous page is allowed to run. This handler wraps an
@@ -60,7 +63,7 @@ class CrossSiteResourceHandler : public ResourceHandler {
void StartCrossSiteTransition(
int request_id,
content::ResourceResponse* response,
- const GlobalRequestID& global_id);
+ const content::GlobalRequestID& global_id);
scoped_refptr<ResourceHandler> next_handler_;
int render_process_host_id_;
diff --git a/content/browser/renderer_host/global_request_id.h b/content/browser/renderer_host/global_request_id.h
deleted file mode 100644
index f9a87db..0000000
--- a/content/browser/renderer_host/global_request_id.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_
-#define CONTENT_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_
-#pragma once
-
-// Uniquely identifies a net::URLRequest.
-struct GlobalRequestID {
- GlobalRequestID() : child_id(-1), request_id(-1) {
- }
-
- GlobalRequestID(int child_id, int request_id)
- : child_id(child_id),
- request_id(request_id) {
- }
-
- // The unique ID of the child process (different from OS's PID).
- int child_id;
-
- // The request ID (unique for the child).
- int request_id;
-
- bool operator<(const GlobalRequestID& other) const {
- if (child_id == other.child_id)
- return request_id < other.request_id;
- return child_id < other.child_id;
- }
- bool operator==(const GlobalRequestID& other) const {
- return child_id == other.child_id &&
- request_id == other.request_id;
- }
- bool operator!=(const GlobalRequestID& other) const {
- return child_id != other.child_id ||
- request_id != other.request_id;
- }
-};
-
-#endif // CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index 7ed56d9..2494f15 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -28,7 +28,6 @@ class SkBitmap;
class TabContents;
class WebKeyboardEvent;
struct ContextMenuParams;
-struct GlobalRequestID;
struct NativeWebKeyboardEvent;
struct ViewHostMsg_CreateWindow_Params;
struct ViewHostMsg_FrameNavigate_Params;
@@ -44,6 +43,7 @@ namespace content {
class BrowserContext;
class WebContents;
struct FileChooserParams;
+struct GlobalRequestID;
struct Referrer;
struct RendererPreferences;
}
@@ -282,11 +282,12 @@ class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener {
int64 source_frame_id) {}
// The page wants to transfer the request to a new renderer.
- virtual void RequestTransferURL(const GURL& url,
- const content::Referrer& referrer,
- WindowOpenDisposition disposition,
- int64 source_frame_id,
- const GlobalRequestID& old_request_id) {}
+ virtual void RequestTransferURL(
+ const GURL& url,
+ const content::Referrer& referrer,
+ WindowOpenDisposition disposition,
+ int64 source_frame_id,
+ const content::GlobalRequestID& old_request_id) {}
// A javascript message, confirmation or prompt should be shown.
virtual void RunJavaScriptMessage(const RenderViewHost* rvh,
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index fbe3825..120f09e 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -35,7 +35,6 @@
#include "content/browser/renderer_host/async_resource_handler.h"
#include "content/browser/renderer_host/buffered_resource_handler.h"
#include "content/browser/renderer_host/cross_site_resource_handler.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/redirect_to_file_resource_handler.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
@@ -54,6 +53,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/download_manager.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/common/content_switches.h"
@@ -85,6 +85,7 @@ using base::Time;
using base::TimeDelta;
using base::TimeTicks;
using content::BrowserThread;
+using content::GlobalRequestID;
using content::ResourceResponse;
using content::WebContents;
using webkit_blob::DeletableFileReference;
diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h
index cdf30b3..5e7e02e 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.h
+++ b/content/browser/renderer_host/resource_dispatcher_host.h
@@ -39,14 +39,15 @@ class ResourceMessageFilter;
class SaveFileManager;
class TabContents;
struct DownloadSaveInfo;
-struct GlobalRequestID;
struct ResourceHostMsg_Request;
struct ViewMsg_SwapOut_Params;
namespace content {
class ResourceContext;
class ResourceDispatcherHostDelegate;
+struct GlobalRequestID;
}
+
namespace net {
class CookieList;
class URLRequestJobFactory;
@@ -212,7 +213,8 @@ class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate {
int* render_view_host_id);
// Retrieves a net::URLRequest. Must be called from the IO thread.
- net::URLRequest* GetURLRequest(const GlobalRequestID& request_id) const;
+ net::URLRequest* GetURLRequest(
+ const content::GlobalRequestID& request_id) const;
void RemovePendingRequest(int process_unique_id, int request_id);
@@ -267,7 +269,7 @@ class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate {
// Marks the request as "parked". This happens if a request is
// redirected cross-site and needs to be resumed by a new render view.
void MarkAsTransferredNavigation(
- const GlobalRequestID& transferred_request_id,
+ const content::GlobalRequestID& transferred_request_id,
net::URLRequest* transferred_request);
private:
@@ -294,7 +296,7 @@ class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate {
bool PauseRequestIfNeeded(ResourceDispatcherHostRequestInfo* info);
// Resumes the given request by calling OnResponseStarted or OnReadCompleted.
- void ResumeRequest(const GlobalRequestID& request_id);
+ void ResumeRequest(const content::GlobalRequestID& request_id);
// Internal function to start reading for the first time.
void StartReading(net::URLRequest* request);
@@ -345,7 +347,8 @@ class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate {
// It may be enhanced in the future to provide some kind of prioritization
// mechanism. We should also consider a hashtable or binary tree if it turns
// out we have a lot of things here.
- typedef std::map<GlobalRequestID, net::URLRequest*> PendingRequestList;
+ typedef std::map<content::GlobalRequestID, net::URLRequest*>
+ PendingRequestList;
// Deletes the pending request identified by the iterator passed in.
// This function will invalidate the iterator passed in. Callers should
@@ -508,7 +511,8 @@ class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate {
// Maps the request ID of request that is being transferred to a new RVH
// to the respective request.
- typedef std::map<GlobalRequestID, net::URLRequest*> TransferredNavigations;
+ typedef std::map<content::GlobalRequestID, net::URLRequest*>
+ TransferredNavigations;
TransferredNavigations transferred_navigations_;
DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost);
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index 8a45b66..4da7eca 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -16,7 +16,6 @@
#include "content/browser/download/download_id_factory.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.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/browser/renderer_host/resource_handler.h"
@@ -24,6 +23,7 @@
#include "content/common/child_process_host_impl.h"
#include "content/common/resource_messages.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
#include "net/base/upload_data.h"
@@ -42,6 +42,7 @@ using content::BrowserThread;
using content::BrowserThreadImpl;
using content::ChildProcessHostImpl;
using content::DownloadManager;
+using content::GlobalRequestID;
// TODO(eroman): Write unit tests for SafeBrowsing that exercise
// SafeBrowsingResourceHandler.
diff --git a/content/browser/renderer_host/resource_queue.cc b/content/browser/renderer_host/resource_queue.cc
index 84fef80..ef0ebe3 100644
--- a/content/browser/renderer_host/resource_queue.cc
+++ b/content/browser/renderer_host/resource_queue.cc
@@ -5,11 +5,12 @@
#include "content/browser/renderer_host/resource_queue.h"
#include "base/stl_util.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/global_request_id.h"
using content::BrowserThread;
+using content::GlobalRequestID;
ResourceQueueDelegate::~ResourceQueueDelegate() {
}
diff --git a/content/browser/renderer_host/resource_queue.h b/content/browser/renderer_host/resource_queue.h
index 1119335..19807db 100644
--- a/content/browser/renderer_host/resource_queue.h
+++ b/content/browser/renderer_host/resource_queue.h
@@ -12,13 +12,16 @@
#include "base/basictypes.h"
#include "content/common/content_export.h"
+namespace content {
+struct GlobalRequestID;
+}
+
namespace net {
class URLRequest;
} // namespace net
class ResourceDispatcherHostRequestInfo;
class ResourceQueue;
-struct GlobalRequestID;
// Makes decisions about delaying or not each net::URLRequest in the queue.
// All methods are called on the IO thread.
@@ -32,7 +35,7 @@ class CONTENT_EXPORT ResourceQueueDelegate {
virtual bool ShouldDelayRequest(
net::URLRequest* request,
const ResourceDispatcherHostRequestInfo& request_info,
- const GlobalRequestID& request_id) = 0;
+ const content::GlobalRequestID& request_id) = 0;
// Called just before ResourceQueue shutdown. After that, the delegate
// should not use the ResourceQueue.
@@ -71,7 +74,7 @@ class CONTENT_EXPORT ResourceQueue {
// Tells the queue that the net::URLRequest object associated with
// |request_id| is no longer valid.
- void RemoveRequest(const GlobalRequestID& request_id);
+ void RemoveRequest(const content::GlobalRequestID& request_id);
// A delegate should call StartDelayedRequests when it wants to allow all
// its delayed requests to start. If it was the last delegate that required
@@ -79,8 +82,9 @@ class CONTENT_EXPORT ResourceQueue {
void StartDelayedRequests(ResourceQueueDelegate* delegate);
private:
- typedef std::map<GlobalRequestID, net::URLRequest*> RequestMap;
- typedef std::map<GlobalRequestID, DelegateSet> InterestedDelegatesMap;
+ typedef std::map<content::GlobalRequestID, net::URLRequest*> RequestMap;
+ typedef std::map<content::GlobalRequestID, DelegateSet>
+ InterestedDelegatesMap;
// The registered delegates. Will not change after the queue has been
// initialized.
diff --git a/content/browser/renderer_host/resource_queue_unittest.cc b/content/browser/renderer_host/resource_queue_unittest.cc
index 54d8644..c16f8d2 100644
--- a/content/browser/renderer_host/resource_queue_unittest.cc
+++ b/content/browser/renderer_host/resource_queue_unittest.cc
@@ -7,9 +7,9 @@
#include "content/browser/browser_thread_impl.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 "googleurl/src/gurl.h"
#include "net/url_request/url_request.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,6 +17,7 @@
using content::BrowserThread;
using content::BrowserThreadImpl;
using content::DummyResourceHandler;
+using content::GlobalRequestID;
namespace {
diff --git a/content/browser/renderer_host/sync_resource_handler.cc b/content/browser/renderer_host/sync_resource_handler.cc
index 3dfb18e..9c165e6 100644
--- a/content/browser/renderer_host/sync_resource_handler.cc
+++ b/content/browser/renderer_host/sync_resource_handler.cc
@@ -6,14 +6,16 @@
#include "base/logging.h"
#include "content/browser/debugger/devtools_netlog_observer.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/common/resource_messages.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "net/base/io_buffer.h"
#include "net/http/http_response_headers.h"
+using content::GlobalRequestID;
+
SyncResourceHandler::SyncResourceHandler(
ResourceMessageFilter* filter,
const GURL& url,
diff --git a/content/browser/ssl/ssl_error_handler.h b/content/browser/ssl/ssl_error_handler.h
index 4074bb6..7daed32 100644
--- a/content/browser/ssl/ssl_error_handler.h
+++ b/content/browser/ssl/ssl_error_handler.h
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/ssl/ssl_manager.h"
#include "content/common/content_export.h"
+#include "content/public/browser/global_request_id.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/resource_type.h"
@@ -100,7 +100,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> {
// The id of the net::URLRequest associated with this object.
// Should only be accessed from the IO thread.
- GlobalRequestID request_id_;
+ content::GlobalRequestID request_id_;
// The ResourceDispatcherHost we are associated with.
ResourceDispatcherHost* resource_dispatcher_host_;
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc
index b12552d..7887714 100644
--- a/content/browser/tab_contents/navigation_controller.cc
+++ b/content/browser/tab_contents/navigation_controller.cc
@@ -31,6 +31,7 @@
#include "net/base/net_util.h"
#include "webkit/glue/webkit_glue.h"
+using content::GlobalRequestID;
using content::UserMetricsAction;
namespace {
diff --git a/content/browser/tab_contents/navigation_controller.h b/content/browser/tab_contents/navigation_controller.h
index aa4d8e0..e0054c8 100644
--- a/content/browser/tab_contents/navigation_controller.h
+++ b/content/browser/tab_contents/navigation_controller.h
@@ -14,9 +14,9 @@
#include "base/memory/linked_ptr.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/browser/ssl/ssl_manager.h"
#include "content/common/content_export.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/navigation_type.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/referrer.h"
@@ -201,7 +201,7 @@ class CONTENT_EXPORT NavigationController {
const content::Referrer& referrer,
content::PageTransition transition,
const std::string& extra_headers,
- const GlobalRequestID& transferred_global_request_id,
+ const content::GlobalRequestID& transferred_global_request_id,
bool is_renderer_initiated);
// Loads the current page if this NavigationController was restored from
diff --git a/content/browser/tab_contents/navigation_entry.h b/content/browser/tab_contents/navigation_entry.h
index f20c047..df33867 100644
--- a/content/browser/tab_contents/navigation_entry.h
+++ b/content/browser/tab_contents/navigation_entry.h
@@ -9,9 +9,9 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-#include "content/browser/renderer_host/global_request_id.h"
#include "content/common/content_export.h"
#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/common/page_type.h"
@@ -162,11 +162,11 @@ class CONTENT_EXPORT NavigationEntry
}
void set_transferred_global_request_id(
- const GlobalRequestID& transferred_global_request_id) {
+ const content::GlobalRequestID& transferred_global_request_id) {
transferred_global_request_id_ = transferred_global_request_id;
}
- GlobalRequestID transferred_global_request_id() const {
+ content::GlobalRequestID transferred_global_request_id() const {
return transferred_global_request_id_;
}
@@ -216,7 +216,7 @@ class CONTENT_EXPORT NavigationEntry
// carries this |transferred_global_request_id_| annotation. Once the request
// is transferred to the new process, this is cleared and the request
// continues as normal.
- GlobalRequestID transferred_global_request_id_;
+ content::GlobalRequestID transferred_global_request_id_;
// Copy and assignment is explicitly allowed for this class.
};
diff --git a/content/browser/tab_contents/page_navigator.cc b/content/browser/tab_contents/page_navigator.cc
deleted file mode 100644
index 4e9e9c3..0000000
--- a/content/browser/tab_contents/page_navigator.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/tab_contents/page_navigator.h"
-
-#include "content/public/common/page_transition_types.h"
-#include "webkit/glue/window_open_disposition.h"
-
-class GURL;
-
-OpenURLParams::OpenURLParams(
- const GURL& url,
- const content::Referrer& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition,
- bool is_renderer_initiated)
- : url(url),
- referrer(referrer),
- disposition(disposition),
- transition(transition),
- is_renderer_initiated(is_renderer_initiated) {
-}
-
-OpenURLParams::OpenURLParams()
- : disposition(UNKNOWN),
- transition(content::PageTransitionFromInt(0)),
- is_renderer_initiated(false) {
-}
-
-OpenURLParams::~OpenURLParams() {
-}
-
diff --git a/content/browser/tab_contents/page_navigator.h b/content/browser/tab_contents/page_navigator.h
deleted file mode 100644
index 4ec0a3b..0000000
--- a/content/browser/tab_contents/page_navigator.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// PageNavigator defines an interface that can be used to express the user's
-// intention to navigate to a particular URL. The implementing class should
-// perform the navigation.
-
-#ifndef CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_
-#define CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_
-#pragma once
-
-#include <string>
-
-#include "content/browser/renderer_host/global_request_id.h"
-#include "content/common/content_export.h"
-#include "content/public/common/page_transition_types.h"
-#include "content/public/common/referrer.h"
-#include "googleurl/src/gurl.h"
-#include "webkit/glue/window_open_disposition.h"
-
-class TabContents;
-
-struct CONTENT_EXPORT OpenURLParams {
- OpenURLParams(const GURL& url,
- const content::Referrer& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition,
- bool is_renderer_initiated);
- ~OpenURLParams();
-
- // The URL/referrer to be opened.
- GURL url;
- content::Referrer referrer;
-
- // The disposition requested by the navigation source.
- WindowOpenDisposition disposition;
-
- // The transition type of navigation.
- content::PageTransition transition;
-
- // Whether this navigation is initiated by the renderer process.
- bool is_renderer_initiated;
-
- // The override encoding of the URL contents to be opened.
- std::string override_encoding;
-
- // Reference to the old request id in case this is a navigation that is being
- // transferred to a new renderer.
- GlobalRequestID transferred_global_request_id;
-
- private:
- OpenURLParams();
-};
-
-class CONTENT_EXPORT PageNavigator {
- public:
- // Deprecated. Please use the one-argument variant instead.
- // TODO(adriansc): Remove this method when refactoring changed all call sites.
- virtual TabContents* OpenURL(const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- content::PageTransition transition) = 0;
-
- // Opens a URL with the given disposition. The transition specifies how this
- // navigation should be recorded in the history system (for example, typed).
- // Returns the TabContents the URL is opened in, or NULL if the URL wasn't
- // opened immediately.
- virtual TabContents* OpenURL(const OpenURLParams& params) = 0;
-
- protected:
- virtual ~PageNavigator() {}
-};
-
-#endif // CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 3330a24..bc17945 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -111,6 +111,8 @@ using content::DevToolsAgentHostRegistry;
using content::DevToolsManagerImpl;
using content::DownloadItem;
using content::DownloadManager;
+using content::GlobalRequestID;
+using content::OpenURLParams;
using content::SSLStatus;
using content::UserMetricsAction;
using content::WebContents;
@@ -762,27 +764,16 @@ void TabContents::WebUISend(RenderViewHost* render_view_host,
delegate_->WebUISend(this, source_url, name, args);
}
-// TODO(adriansc): Remove this method once refactoring changed all call sites.
-TabContents* TabContents::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 OpenURL(OpenURLParams(url, content::Referrer(), disposition,
- transition, false));
-}
+WebContents* TabContents::OpenURL(const OpenURLParams& params) {
+ if (!delegate_)
+ return NULL;
-TabContents* TabContents::OpenURL(const OpenURLParams& params) {
- if (delegate_) {
- TabContents* new_contents = delegate_->OpenURLFromTab(this, params);
- // Notify observers.
- FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- DidOpenURL(params.url, params.referrer,
- params.disposition, params.transition));
- return new_contents;
- }
- return NULL;
+ WebContents* new_contents = delegate_->OpenURLFromTab(this, params);
+ // Notify observers.
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidOpenURL(params.url, params.referrer,
+ params.disposition, params.transition));
+ return new_contents;
}
bool TabContents::NavigateToPendingEntry(
@@ -1921,7 +1912,7 @@ void TabContents::RequestTransferURL(const GURL& url,
WindowOpenDisposition disposition,
int64 source_frame_id,
const GlobalRequestID& old_request_id) {
- TabContents* new_contents = NULL;
+ WebContents* new_contents = NULL;
content::PageTransition transition_type = content::PAGE_TRANSITION_LINK;
if (render_manager_.web_ui()) {
// When we're a Web UI, it will provide a page transition type for us (this
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index d23024d..c249282 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -210,15 +210,8 @@ class CONTENT_EXPORT TabContents
virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE;
// Implementation of 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;
+ virtual content::WebContents* OpenURL(
+ const content::OpenURLParams& params) OVERRIDE;
// RenderViewHostDelegate ----------------------------------------------------
@@ -270,7 +263,7 @@ class CONTENT_EXPORT TabContents
const content::Referrer& referrer,
WindowOpenDisposition disposition,
int64 source_frame_id,
- const GlobalRequestID& transferred_global_request_id) OVERRIDE;
+ const content::GlobalRequestID& transferred_global_request_id) OVERRIDE;
virtual void RunJavaScriptMessage(const RenderViewHost* rvh,
const string16& message,
const string16& default_prompt,
diff --git a/content/browser/tab_contents/web_drag_dest_mac.mm b/content/browser/tab_contents/web_drag_dest_mac.mm
index eeeb3ef..53e0ecc 100644
--- a/content/browser/tab_contents/web_drag_dest_mac.mm
+++ b/content/browser/tab_contents/web_drag_dest_mac.mm
@@ -15,6 +15,8 @@
#include "webkit/glue/window_open_disposition.h"
using WebKit::WebDragOperationsMask;
+using content::OpenURLParams;
+using content::Referrer;
@implementation WebDragDest
@@ -164,8 +166,9 @@ using WebKit::WebDragOperationsMask;
if ([pboard containsURLData]) {
GURL url;
ui::PopulateURLAndTitleFromPasteboard(&url, NULL, pboard, YES);
- tabContents_->OpenURL(url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ tabContents_->OpenURL(OpenURLParams(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK,
+ false));
return YES;
}
return NO;
diff --git a/content/browser/webui/generic_handler.cc b/content/browser/webui/generic_handler.cc
index f8ce3d4..36cf868 100644
--- a/content/browser/webui/generic_handler.cc
+++ b/content/browser/webui/generic_handler.cc
@@ -12,6 +12,8 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "googleurl/src/gurl.h"
+using content::OpenURLParams;
+
GenericHandler::GenericHandler() {
}
@@ -49,8 +51,9 @@ void GenericHandler::HandleNavigateToUrl(const ListValue* args) {
if (disposition == CURRENT_TAB && target_string == "_blank")
disposition = NEW_FOREGROUND_TAB;
- web_ui_->tab_contents()->OpenURL(
- GURL(url_string), GURL(), disposition, content::PAGE_TRANSITION_LINK);
+ web_ui_->tab_contents()->OpenURL(OpenURLParams(
+ GURL(url_string), content::Referrer(), disposition,
+ content::PAGE_TRANSITION_LINK, false));
// This may delete us!
}