Fix API changes of Chrome37.
This commit is contained in:
parent
f0e46a4728
commit
dca1c51b32
9 changed files with 30 additions and 86 deletions
|
@ -61,7 +61,7 @@ content::BrowserMainParts* BrowserClient::CreateBrowserMainParts(
|
|||
net::URLRequestContextGetter* BrowserClient::CreateRequestContext(
|
||||
content::BrowserContext* browser_context,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||
auto context = static_cast<BrowserContext*>(browser_context);
|
||||
return context->CreateRequestContext(protocol_handlers, protocol_interceptors.Pass());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class BrowserClient : public content::ContentBrowserClient {
|
|||
virtual net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::BrowserContext* browser_context,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) OVERRIDE;
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) OVERRIDE;
|
||||
|
||||
private:
|
||||
virtual content::BrowserMainParts* CreateBrowserMainParts(
|
||||
|
|
|
@ -101,7 +101,7 @@ void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
|
|||
|
||||
net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||
DCHECK(!url_request_getter_);
|
||||
url_request_getter_ = new URLRequestContextGetter(
|
||||
this,
|
||||
|
@ -120,7 +120,7 @@ net::NetworkDelegate* BrowserContext::CreateNetworkDelegate() {
|
|||
|
||||
net::URLRequestJobFactory* BrowserContext::CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -158,36 +158,6 @@ net::URLRequestContextGetter*
|
|||
return GetRequestContext();
|
||||
}
|
||||
|
||||
void BrowserContext::RequestMidiSysExPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame,
|
||||
bool user_gesture,
|
||||
const MidiSysExPermissionCallback& callback) {
|
||||
callback.Run(false);
|
||||
}
|
||||
|
||||
void BrowserContext::CancelMidiSysExPermissionRequest(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) {
|
||||
}
|
||||
|
||||
void BrowserContext::RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) {
|
||||
callback.Run(false);
|
||||
}
|
||||
|
||||
void BrowserContext::CancelProtectedMediaIdentifierPermissionRequests(int group_id) {
|
||||
}
|
||||
|
||||
content::ResourceContext* BrowserContext::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
@ -198,17 +168,16 @@ content::DownloadManagerDelegate* BrowserContext::GetDownloadManagerDelegate() {
|
|||
return download_manager_delegate_.get();
|
||||
}
|
||||
|
||||
content::GeolocationPermissionContext*
|
||||
BrowserContext::GetGeolocationPermissionContext() {
|
||||
return nullptr;
|
||||
content::BrowserPluginGuestManager* BrowserContext::GetGuestManager() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
quota::SpecialStoragePolicy* BrowserContext::GetSpecialStoragePolicy() {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content::BrowserPluginGuestManagerDelegate* BrowserContext::GetGuestManagerDelegate() {
|
||||
return nullptr;
|
||||
content::PushMessagingService* BrowserContext::GetPushMessagingService() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -26,7 +26,7 @@ class BrowserContext : public content::BrowserContext,
|
|||
|
||||
net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||
|
||||
net::URLRequestContextGetter* url_request_context_getter() const {
|
||||
return url_request_getter_.get();
|
||||
|
@ -42,7 +42,7 @@ class BrowserContext : public content::BrowserContext,
|
|||
virtual net::NetworkDelegate* CreateNetworkDelegate() OVERRIDE;
|
||||
virtual net::URLRequestJobFactory* CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) OVERRIDE;
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors) OVERRIDE;
|
||||
|
||||
virtual base::FilePath GetPath() const OVERRIDE;
|
||||
|
||||
|
@ -61,35 +61,11 @@ class BrowserContext : public content::BrowserContext,
|
|||
virtual net::URLRequestContextGetter*
|
||||
GetMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path, bool in_memory);
|
||||
virtual void RequestMidiSysExPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame,
|
||||
bool user_gesture,
|
||||
const MidiSysExPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelMidiSysExPermissionRequest(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) OVERRIDE;
|
||||
virtual void RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelProtectedMediaIdentifierPermissionRequests(int group_id) OVERRIDE;
|
||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||
virtual content::DownloadManagerDelegate*
|
||||
GetDownloadManagerDelegate() OVERRIDE;
|
||||
virtual content::GeolocationPermissionContext*
|
||||
GetGeolocationPermissionContext() OVERRIDE;
|
||||
virtual content::BrowserPluginGuestManagerDelegate*
|
||||
GetGuestManagerDelegate() OVERRIDE;
|
||||
virtual quota::SpecialStoragePolicy*
|
||||
GetSpecialStoragePolicy() OVERRIDE;
|
||||
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
|
||||
virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE;
|
||||
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
|
||||
virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE;
|
||||
|
||||
base::FilePath path_;
|
||||
scoped_ptr<ResourceContext> resource_context_;
|
||||
|
|
|
@ -68,6 +68,7 @@ class Target : public content::DevToolsTarget {
|
|||
explicit Target(WebContents* web_contents);
|
||||
|
||||
virtual std::string GetId() const OVERRIDE { return id_; }
|
||||
virtual std::string GetParentId() const { return std::string(); }
|
||||
virtual std::string GetType() const OVERRIDE { return kTargetTypePage; }
|
||||
virtual std::string GetTitle() const OVERRIDE { return title_; }
|
||||
virtual std::string GetDescription() const OVERRIDE { return std::string(); }
|
||||
|
@ -134,8 +135,8 @@ DevToolsDelegate::DevToolsDelegate(
|
|||
content::BrowserContext* browser_context)
|
||||
: browser_context_(browser_context) {
|
||||
std::string frontend_url;
|
||||
devtools_http_handler_ =
|
||||
DevToolsHttpHandler::Start(CreateSocketFactory(), frontend_url, this);
|
||||
devtools_http_handler_ = DevToolsHttpHandler::Start(
|
||||
CreateSocketFactory(), frontend_url, this, base::FilePath());
|
||||
}
|
||||
|
||||
DevToolsDelegate::~DevToolsDelegate() {
|
||||
|
|
|
@ -156,8 +156,7 @@ void InspectableWebContentsImpl::ShowDevTools() {
|
|||
embedder_message_dispatcher_.reset(
|
||||
new DevToolsEmbedderMessageDispatcher(this));
|
||||
|
||||
auto create_params = content::WebContents::CreateParams(
|
||||
web_contents_->GetBrowserContext());
|
||||
content::WebContents::CreateParams create_params(web_contents_->GetBrowserContext());
|
||||
devtools_web_contents_.reset(content::WebContents::Create(create_params));
|
||||
|
||||
Observe(devtools_web_contents_.get());
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/cookie_store_factory.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "net/base/host_mapping_rules.h"
|
||||
#include "net/cert/cert_verifier.h"
|
||||
#include "net/cookies/cookie_monster.h"
|
||||
|
@ -33,11 +32,12 @@
|
|||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
#include "net/url_request/data_protocol_handler.h"
|
||||
#include "net/url_request/file_protocol_handler.h"
|
||||
#include "net/url_request/protocol_intercept_job_factory.h"
|
||||
#include "net/url_request/static_http_user_agent_settings.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "net/url_request/url_request_context_storage.h"
|
||||
#include "net/url_request/url_request_intercepting_job_factory.h"
|
||||
#include "net/url_request/url_request_job_factory_impl.h"
|
||||
#include "url/url_constants.h"
|
||||
#include "webkit/browser/quota/special_storage_policy.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
|
@ -75,24 +75,24 @@ const char kProxyServer[] = "proxy-server";
|
|||
|
||||
net::URLRequestJobFactory* URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors) {
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors) {
|
||||
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(new net::URLRequestJobFactoryImpl);
|
||||
|
||||
for (auto it = protocol_handlers->begin(); it != protocol_handlers->end(); ++it)
|
||||
job_factory->SetProtocolHandler(it->first, it->second.release());
|
||||
protocol_handlers->clear();
|
||||
|
||||
job_factory->SetProtocolHandler(content::kDataScheme, new net::DataProtocolHandler);
|
||||
job_factory->SetProtocolHandler(content::kFileScheme, new net::FileProtocolHandler(
|
||||
job_factory->SetProtocolHandler(url::kDataScheme, new net::DataProtocolHandler);
|
||||
job_factory->SetProtocolHandler(url::kFileScheme, new net::FileProtocolHandler(
|
||||
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
|
||||
|
||||
// Set up interceptors in the reverse order.
|
||||
scoped_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
job_factory.PassAs<net::URLRequestJobFactory>();
|
||||
for (content::ProtocolHandlerScopedVector::reverse_iterator i = protocol_interceptors->rbegin();
|
||||
for (content::URLRequestInterceptorScopedVector::reverse_iterator i = protocol_interceptors->rbegin();
|
||||
i != protocol_interceptors->rend(); ++i)
|
||||
top_job_factory.reset(new net::ProtocolInterceptJobFactory(
|
||||
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
|
||||
top_job_factory.Pass(), make_scoped_ptr(*i)));
|
||||
protocol_interceptors->weak_clear();
|
||||
|
||||
|
@ -105,7 +105,7 @@ URLRequestContextGetter::URLRequestContextGetter(
|
|||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors)
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors)
|
||||
: delegate_(delegate),
|
||||
base_path_(base_path),
|
||||
io_loop_(io_loop),
|
||||
|
|
|
@ -35,7 +35,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
virtual net::NetworkDelegate* CreateNetworkDelegate() { return NULL; }
|
||||
virtual net::URLRequestJobFactory* CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector* protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector* protocol_interceptors);
|
||||
};
|
||||
|
||||
URLRequestContextGetter(
|
||||
|
@ -44,7 +44,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors);
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors);
|
||||
virtual ~URLRequestContextGetter();
|
||||
|
||||
// net::URLRequestContextGetter:
|
||||
|
@ -66,7 +66,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
scoped_ptr<net::URLRequestContext> url_request_context_;
|
||||
scoped_ptr<net::HostMappingRules> host_mapping_rules_;
|
||||
content::ProtocolHandlerMap protocol_handlers_;
|
||||
content::ProtocolHandlerScopedVector protocol_interceptors_;
|
||||
content::URLRequestInterceptorScopedVector protocol_interceptors_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
|
||||
};
|
||||
|
|
|
@ -138,7 +138,6 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked) {
|
|||
params.delegate = new DevToolsWindowDelegate(this,
|
||||
devtools_window_web_view_,
|
||||
devtools_window_.get());
|
||||
params.top_level = true;
|
||||
params.bounds = inspectable_web_contents()->GetDevToolsBounds();
|
||||
#if defined(USE_X11)
|
||||
// In X11 the window frame is drawn by the application.
|
||||
|
|
Loading…
Reference in a new issue