Update to API changes of Chrome 52
This commit is contained in:
parent
8f7394a7b7
commit
4e9782897c
9 changed files with 50 additions and 50 deletions
|
@ -174,27 +174,6 @@ bool BrowserContext::IsOffTheRecord() const {
|
|||
return in_memory_;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* BrowserContext::GetRequestContext() {
|
||||
return GetDefaultStoragePartition(this)->GetURLRequestContext();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* BrowserContext::GetMediaRequestContext() {
|
||||
return GetRequestContext();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
BrowserContext::GetMediaRequestContextForRenderProcess(
|
||||
int renderer_child_id) {
|
||||
return GetRequestContext();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
BrowserContext::GetMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory) {
|
||||
return GetRequestContext();
|
||||
}
|
||||
|
||||
content::ResourceContext* BrowserContext::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
@ -238,4 +217,16 @@ BrowserContext::CreateRequestContextForStoragePartition(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
BrowserContext::CreateMediaRequestContext() {
|
||||
return url_request_getter_.get();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter*
|
||||
BrowserContext::CreateMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -42,12 +42,6 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
|||
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
||||
const base::FilePath& partition_path) override;
|
||||
bool IsOffTheRecord() const override;
|
||||
net::URLRequestContextGetter* GetRequestContext() override;
|
||||
net::URLRequestContextGetter* GetMediaRequestContext() override;
|
||||
net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
|
||||
int renderer_child_id) override;
|
||||
net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path, bool in_memory) override;
|
||||
content::ResourceContext* GetResourceContext() override;
|
||||
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
|
||||
content::BrowserPluginGuestManager* GetGuestManager() override;
|
||||
|
@ -64,6 +58,10 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
|||
bool in_memory,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) override;
|
||||
net::URLRequestContextGetter* CreateMediaRequestContext() override;
|
||||
net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
|
||||
const base::FilePath& partition_path,
|
||||
bool in_memory) override;
|
||||
|
||||
URLRequestContextGetter* url_request_context_getter() const {
|
||||
return url_request_getter_.get();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
#if defined(USE_AURA)
|
||||
#include "ui/gfx/screen.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_screen.h"
|
||||
#endif
|
||||
|
||||
|
@ -238,8 +238,8 @@ void BrowserMainParts::PostMainMessageLoopRun() {
|
|||
|
||||
int BrowserMainParts::PreCreateThreads() {
|
||||
#if defined(USE_AURA)
|
||||
gfx::Screen* screen = views::CreateDesktopScreen();
|
||||
gfx::Screen::SetScreenInstance(screen);
|
||||
display::Screen* screen = views::CreateDesktopScreen();
|
||||
display::Screen::SetScreenInstance(screen);
|
||||
#if defined(USE_X11)
|
||||
views::LinuxUI::instance()->UpdateDeviceScaleFactor(
|
||||
screen->GetPrimaryDisplay().device_scale_factor());
|
||||
|
|
|
@ -5,25 +5,22 @@
|
|||
|
||||
#include "browser/inspectable_web_contents_impl.h"
|
||||
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
#include "base/strings/pattern.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "browser/browser_client.h"
|
||||
#include "browser/browser_context.h"
|
||||
#include "browser/browser_main_parts.h"
|
||||
#include "browser/inspectable_web_contents_delegate.h"
|
||||
#include "browser/inspectable_web_contents_view.h"
|
||||
#include "browser/inspectable_web_contents_view_delegate.h"
|
||||
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
|
||||
#include "base/strings/pattern.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/host_zoom_map.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
|
@ -33,7 +30,8 @@
|
|||
#include "net/http/http_response_headers.h"
|
||||
#include "net/url_request/url_fetcher.h"
|
||||
#include "net/url_request/url_fetcher_response_writer.h"
|
||||
#include "ui/gfx/screen.h"
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/display/screen.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
|
@ -214,7 +212,7 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(
|
|||
devtools_bounds_.set_height(600);
|
||||
devtools_bounds_.set_width(800);
|
||||
}
|
||||
gfx::Rect display = gfx::Screen::GetScreen()
|
||||
gfx::Rect display = display::Screen::GetScreen()
|
||||
->GetDisplayNearestWindow(web_contents->GetNativeView()).bounds();
|
||||
if (!IsPointInRect(devtools_bounds_.origin(), display)) {
|
||||
devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2);
|
||||
|
@ -361,7 +359,7 @@ void InspectableWebContentsImpl::ActivateWindow() {
|
|||
}
|
||||
|
||||
void InspectableWebContentsImpl::CloseWindow() {
|
||||
GetDevToolsWebContents()->DispatchBeforeUnload(false);
|
||||
GetDevToolsWebContents()->DispatchBeforeUnload();
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::LoadCompleted() {
|
||||
|
|
|
@ -147,4 +147,12 @@ void MediaCaptureDevicesDispatcher::OnCreatingAudioStream(
|
|||
int render_view_id) {
|
||||
}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured(
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
int page_request_id,
|
||||
content::MediaStreamType stream_type,
|
||||
bool is_secure) {
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -61,6 +61,11 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
|
|||
content::MediaRequestState state) override;
|
||||
void OnCreatingAudioStream(int render_process_id,
|
||||
int render_view_id) override;
|
||||
void OnSetCapturingLinkSecured(int render_process_id,
|
||||
int render_frame_id,
|
||||
int page_request_id,
|
||||
content::MediaStreamType stream_type,
|
||||
bool is_secure) override;
|
||||
|
||||
private:
|
||||
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
|
||||
|
|
|
@ -55,19 +55,19 @@ PlatformNotificationService::PlatformNotificationService(
|
|||
|
||||
PlatformNotificationService::~PlatformNotificationService() {}
|
||||
|
||||
blink::WebNotificationPermission PlatformNotificationService::CheckPermissionOnUIThread(
|
||||
blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnUIThread(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& origin,
|
||||
int render_process_id) {
|
||||
render_process_id_ = render_process_id;
|
||||
return blink::WebNotificationPermissionAllowed;
|
||||
return blink::mojom::PermissionStatus::GRANTED;
|
||||
}
|
||||
|
||||
blink::WebNotificationPermission PlatformNotificationService::CheckPermissionOnIOThread(
|
||||
blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOThread(
|
||||
content::ResourceContext* resource_context,
|
||||
const GURL& origin,
|
||||
int render_process_id) {
|
||||
return blink::WebNotificationPermissionAllowed;
|
||||
return blink::mojom::PermissionStatus::GRANTED;
|
||||
}
|
||||
|
||||
void PlatformNotificationService::DisplayNotification(
|
||||
|
|
|
@ -20,11 +20,11 @@ class PlatformNotificationService
|
|||
|
||||
protected:
|
||||
// content::PlatformNotificationService:
|
||||
blink::WebNotificationPermission CheckPermissionOnUIThread(
|
||||
blink::mojom::PermissionStatus CheckPermissionOnUIThread(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& origin,
|
||||
int render_process_id) override;
|
||||
blink::WebNotificationPermission CheckPermissionOnIOThread(
|
||||
blink::mojom::PermissionStatus CheckPermissionOnIOThread(
|
||||
content::ResourceContext* resource_context,
|
||||
const GURL& origin,
|
||||
int render_process_id) override;
|
||||
|
|
|
@ -381,7 +381,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
|||
it != protocol_interceptors_.rend();
|
||||
++it) {
|
||||
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
|
||||
std::move(top_job_factory), make_scoped_ptr(*it)));
|
||||
std::move(top_job_factory), base::WrapUnique(*it)));
|
||||
}
|
||||
protocol_interceptors_.weak_clear();
|
||||
|
||||
|
|
Loading…
Reference in a new issue