diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 8a95fa546..784bbab4b 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '128896', + 'chromium_revision': '130586', } diff --git a/include/cef_application_mac.h b/include/cef_application_mac.h index 50040af22..0eb2c201c 100644 --- a/include/cef_application_mac.h +++ b/include/cef_application_mac.h @@ -38,10 +38,13 @@ #ifdef BUILDING_CEF_SHARED // Use the existing CrAppProtocol definition. -#include "base/message_pump_mac.h" +#import "base/message_pump_mac.h" // Use the existing CrAppControlProtocol definition. -#include "base/mac/scoped_sending_event.h" +#import "base/mac/scoped_sending_event.h" + +// Use the existing UnderlayableSurface definition. +#import "ui/base/cocoa/underlay_opengl_hosting_window.h" // Use the existing empty protocol definitions. #import "base/mac/cocoa_protocols.h" @@ -51,17 +54,23 @@ #import #import -// Copy of CrAppProtocol definition from base/message_pump_mac.h. +// Copy of definition from base/message_pump_mac.h. @protocol CrAppProtocol // Must return true if -[NSApplication sendEvent:] is currently on the stack. - (BOOL)isHandlingSendEvent; @end -// Copy of CrAppControlProtocol definition from base/mac/scoped_sending_event.h. +// Copy of definition from base/mac/scoped_sending_event.h. @protocol CrAppControlProtocol - (void)setHandlingSendEvent:(BOOL)handlingSendEvent; @end +// Copy of definition from ui/base/cocoa/underlay_opengl_hosting_window.h. +@protocol UnderlayableSurface +- (void)underlaySurfaceAdded; +- (void)underlaySurfaceRemoved; +@end + // The Mac OS X 10.6 SDK introduced new protocols used for delegates. These // protocol defintions were not present in earlier releases of the Mac OS X // SDK. In order to support building against the new SDK, which requires @@ -103,6 +112,11 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) @protocol CefAppProtocol @end +// All CEF windows should implement this protocol to be informed explicitly +// about underlay surfaces. +@protocol CefUnderlayableSurface +@end + // Controls the state of |isHandlingSendEvent| in the event loop so that it is // reset properly. class CefScopedSendingEvent { diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index aa91c21d0..4a89aaa56 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -7,7 +7,6 @@ #include #include "libcef/browser/browser_host_impl.h" -#include "libcef/browser/browser_main.h" #include "libcef/browser/download_manager_delegate.h" #include "libcef/browser/resource_context.h" #include "libcef/browser/thread_util.h" @@ -19,7 +18,7 @@ #include "base/logging.h" #include "base/path_service.h" #include "base/threading/thread.h" -#include "content/browser/download/download_manager_impl.h" +#include "content/public/browser/download_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/geolocation_permission_context.h" #include "content/public/browser/speech_recognition_preferences.h" @@ -190,9 +189,9 @@ class CefSpeechRecognitionPreferences } // namespace -CefBrowserContext::CefBrowserContext( - CefBrowserMainParts* main_parts) - : main_parts_(main_parts) { +CefBrowserContext::CefBrowserContext() { + InitWhileIOAllowed(); + // Initialize the request context getter. url_request_getter_ = new CefURLRequestContextGetter( GetPath(), @@ -207,10 +206,7 @@ CefBrowserContext::~CefBrowserContext() { } } -FilePath CefBrowserContext::GetPath() { - if (!path_.empty()) - return path_; - +void CefBrowserContext::InitWhileIOAllowed() { #if defined(OS_WIN) CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_)); path_ = path_.Append(std::wstring(L"cef_data")); @@ -229,7 +225,9 @@ FilePath CefBrowserContext::GetPath() { if (!file_util::PathExists(path_)) file_util::CreateDirectory(path_); +} +FilePath CefBrowserContext::GetPath() { return path_; } @@ -240,8 +238,8 @@ bool CefBrowserContext::IsOffTheRecord() const { content::DownloadManager* CefBrowserContext::GetDownloadManager() { if (!download_manager_.get()) { download_manager_delegate_ = new CefDownloadManagerDelegate(); - download_manager_ = new DownloadManagerImpl(download_manager_delegate_, - NULL); + download_manager_ = + content::DownloadManager::Create(download_manager_delegate_, NULL); download_manager_delegate_->SetDownloadManager(download_manager_.get()); download_manager_->Init(this); } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 1556cf81b..232d06469 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -12,22 +12,21 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_context.h" -class DownloadManager; - namespace content { class DownloadManagerDelegate; class ResourceContext; class SpeechRecognitionPreferences; } -class CefBrowserMainParts; class CefDownloadManagerDelegate; class CefBrowserContext : public content::BrowserContext { public: - explicit CefBrowserContext(CefBrowserMainParts* main_parts); + CefBrowserContext(); virtual ~CefBrowserContext(); + void InitWhileIOAllowed(); + // BrowserContext methods. virtual FilePath GetPath() OVERRIDE; virtual bool IsOffTheRecord() const OVERRIDE; @@ -56,8 +55,6 @@ class CefBrowserContext : public content::BrowserContext { scoped_refptr speech_recognition_preferences_; - CefBrowserMainParts* main_parts_; - DISALLOW_COPY_AND_ASSIGN(CefBrowserContext); }; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 5998ffbd0..52c47bece 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -22,6 +22,7 @@ #include "base/bind_helpers.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/resource_request_info_impl.h" +#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_details.h" @@ -124,12 +125,12 @@ CefRefPtr CefBrowserHostImpl::Create( const CefWindowInfo& window_info, const CefBrowserSettings& settings, CefRefPtr client, - TabContents* tab_contents, + content::WebContents* web_contents, CefWindowHandle opener) { CEF_REQUIRE_UIT(); - if (tab_contents == NULL) { - tab_contents = new TabContents( + if (web_contents == NULL) { + web_contents = content::WebContents::Create( _Context->browser_context(), NULL, MSG_ROUTING_NONE, @@ -138,7 +139,7 @@ CefRefPtr CefBrowserHostImpl::Create( } CefRefPtr browser = - new CefBrowserHostImpl(window_info, settings, client, tab_contents, + new CefBrowserHostImpl(window_info, settings, client, web_contents, opener); if (!browser->PlatformCreateWindow()) return NULL; @@ -267,8 +268,8 @@ void CefBrowserHostImpl::SetFocus(bool enable) { return; if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get()) - tab_contents_->Focus(); + if (web_contents_.get()) + web_contents_->Focus(); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::SetFocus, this, enable)); @@ -302,8 +303,8 @@ bool CefBrowserHostImpl::CanGoBack() { void CefBrowserHostImpl::GoBack() { if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get() && tab_contents_->GetController().CanGoBack()) - tab_contents_->GetController().GoBack(); + if (web_contents_.get() && web_contents_->GetController().CanGoBack()) + web_contents_->GetController().GoBack(); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoBack, this)); @@ -317,8 +318,8 @@ bool CefBrowserHostImpl::CanGoForward() { void CefBrowserHostImpl::GoForward() { if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get() && tab_contents_->GetController().CanGoForward()) - tab_contents_->GetController().GoForward(); + if (web_contents_.get() && web_contents_->GetController().CanGoForward()) + web_contents_->GetController().GoForward(); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::GoForward, this)); @@ -332,8 +333,8 @@ bool CefBrowserHostImpl::IsLoading() { void CefBrowserHostImpl::Reload() { if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get()) - tab_contents_->GetController().Reload(true); + if (web_contents_.get()) + web_contents_->GetController().Reload(true); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::Reload, this)); @@ -342,8 +343,8 @@ void CefBrowserHostImpl::Reload() { void CefBrowserHostImpl::ReloadIgnoreCache() { if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get()) - tab_contents_->GetController().ReloadIgnoringCache(true); + if (web_contents_.get()) + web_contents_->GetController().ReloadIgnoringCache(true); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::ReloadIgnoreCache, this)); @@ -352,8 +353,8 @@ void CefBrowserHostImpl::ReloadIgnoreCache() { void CefBrowserHostImpl::StopLoad() { if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get()) - tab_contents_->Stop(); + if (web_contents_.get()) + web_contents_->Stop(); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::StopLoad, this)); @@ -494,7 +495,7 @@ void CefBrowserHostImpl::DestroyBrowser() { registrar_.reset(NULL); content::WebContentsObserver::Observe(NULL); - tab_contents_.reset(NULL); + web_contents_.reset(NULL); DetachAllFrames(); @@ -506,14 +507,14 @@ void CefBrowserHostImpl::DestroyBrowser() { gfx::NativeView CefBrowserHostImpl::GetContentView() const { CEF_REQUIRE_UIT(); - if (!tab_contents_.get()) + if (!web_contents_.get()) return NULL; - return tab_contents_->GetNativeView(); + return web_contents_->GetNativeView(); } -TabContents* CefBrowserHostImpl::GetTabContents() const { +content::WebContents* CefBrowserHostImpl::GetWebContents() const { CEF_REQUIRE_UIT(); - return tab_contents_.get(); + return web_contents_.get(); } net::URLRequestContextGetter* CefBrowserHostImpl::GetRequestContext() { @@ -560,8 +561,8 @@ void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) { Send(new CefMsg_LoadRequest(routing_id(), request)); - if (tab_contents_.get()) - tab_contents_->Focus(); + if (web_contents_.get()) + web_contents_->Focus(); } void CefBrowserHostImpl::LoadRequest(int64 frame_id, @@ -594,7 +595,7 @@ void CefBrowserHostImpl::LoadURL(int64 frame_id, const std::string& url) { if (frame_id == CefFrameHostImpl::kMainFrameId) { // Go through the navigation controller. if (CEF_CURRENTLY_ON_UIT()) { - if (tab_contents_.get()) { + if (web_contents_.get()) { GURL gurl = GURL(url); if (!gurl.is_valid() && !gurl.has_scheme()) { @@ -612,12 +613,12 @@ void CefBrowserHostImpl::LoadURL(int64 frame_id, const std::string& url) { // Update the loading URL. OnLoadingURLChange(gurl); - tab_contents_->GetController().LoadURL( + web_contents_->GetController().LoadURL( gurl, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); - tab_contents_->Focus(); + web_contents_->Focus(); } } else { CEF_POST_TASK(CEF_UIT, @@ -752,14 +753,14 @@ content::WebContents* CefBrowserHostImpl::OpenURLFromTab( } void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source) { - int current_index = tab_contents_->GetController().GetCurrentEntryIndex(); - int max_index = tab_contents_->GetController().GetEntryCount() - 1; + int current_index = web_contents_->GetController().GetCurrentEntryIndex(); + int max_index = web_contents_->GetController().GetEntryCount() - 1; bool is_loading, can_go_back, can_go_forward; { base::AutoLock lock_scope(state_lock_); - is_loading = is_loading_ = tab_contents_->IsLoading(); + is_loading = is_loading_ = web_contents_->IsLoading(); can_go_back = can_go_back_ = (current_index > 0); can_go_forward = can_go_forward_ = (current_index < max_index); } @@ -777,7 +778,8 @@ bool CefBrowserHostImpl::ShouldCreateWebContents( content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name) { + const string16& frame_name, + const GURL& target_url) { // Start with the current browser window's client and settings. pending_client_ = client_; pending_settings_ = settings_; @@ -830,8 +832,8 @@ void CefBrowserHostImpl::WebContentsCreated( opener = GetBrowserForContents(source_contents)->GetWindowHandle(); CefRefPtr browser = CefBrowserHostImpl::Create( - pending_window_info_, pending_settings_, pending_client_, - static_cast(new_contents), opener); + pending_window_info_, pending_settings_, pending_client_, new_contents, + opener); if (browser.get() && !pending_url_.empty()) browser->LoadURL(CefFrameHostImpl::kMainFrameId, pending_url_); @@ -1062,14 +1064,14 @@ void CefBrowserHostImpl::Observe(int type, CefBrowserHostImpl::CefBrowserHostImpl(const CefWindowInfo& window_info, const CefBrowserSettings& settings, CefRefPtr client, - TabContents* tab_contents, + content::WebContents* web_contents, CefWindowHandle opener) - : content::WebContentsObserver(tab_contents), + : content::WebContentsObserver(web_contents), window_info_(window_info), settings_(settings), client_(client), opener_(opener), - render_process_id_(tab_contents->GetRenderProcessHost()->GetID()), + render_process_id_(web_contents->GetRenderProcessHost()->GetID()), render_view_id_(routing_id()), unique_id_(0), received_page_title_(false), @@ -1080,12 +1082,12 @@ CefBrowserHostImpl::CefBrowserHostImpl(const CefWindowInfo& window_info, queue_messages_(true), main_frame_id_(CefFrameHostImpl::kInvalidFrameId), focused_frame_id_(CefFrameHostImpl::kInvalidFrameId) { - tab_contents_.reset(tab_contents); - tab_contents->SetDelegate(this); + web_contents_.reset(web_contents); + web_contents->SetDelegate(this); registrar_.reset(new content::NotificationRegistrar); registrar_->Add(this, content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED, - content::Source(tab_contents)); + content::Source(web_contents)); placeholder_frame_ = new CefFrameHostImpl(this, CefFrameHostImpl::kInvalidFrameId, true); diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index bf8b6de0e..48f0219c6 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -22,12 +22,15 @@ #include "base/memory/scoped_ptr.h" #include "base/string16.h" #include "base/synchronization/lock.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" +namespace net { +class URLRequest; +} struct Cef_Request_Params; struct Cef_Response_Params; @@ -36,14 +39,14 @@ class SiteInstance; // Implementation of CefBrowser. // -// WebContentsDelegate: Interface for handling TabContents delegations. There is -// a one-to-one relationship between CefBrowserHostImpl and TabContents +// WebContentsDelegate: Interface for handling WebContents delegations. There is +// a one-to-one relationship between CefBrowserHostImpl and WebContents // instances. // -// WebContentsObserver: Interface for observing TabContents notifications and -// IPC messages. There is a one-to-one relationship between TabContents and +// WebContentsObserver: Interface for observing WebContents notifications and +// IPC messages. There is a one-to-one relationship between WebContents and // RenderViewHost instances. IPC messages received by the RenderViewHost will be -// forwarded to this WebContentsObserver implementation via TabContents. IPC +// forwarded to this WebContentsObserver implementation via WebContents. IPC // messages sent using CefBrowserHostImpl::Send() will be forwarded to the // RenderViewHost (after posting to the UI thread if necessary). Use // WebContentsObserver::routing_id() when sending IPC messages. @@ -68,7 +71,7 @@ class CefBrowserHostImpl : public CefBrowserHost, const CefWindowInfo& window_info, const CefBrowserSettings& settings, CefRefPtr client, - TabContents* tab_contents, + content::WebContents* web_contents, CefWindowHandle opener); // Returns the browser associated with the specified RenderViewHost. @@ -127,11 +130,11 @@ class CefBrowserHostImpl : public CefBrowserHost, // native browser window is not longer processing messages. void DestroyBrowser(); - // Returns the native view for the TabContents. + // Returns the native view for the WebContents. gfx::NativeView GetContentView() const; - // Returns a pointer to the TabContents. - TabContents* GetTabContents() const; + // Returns a pointer to the WebContents. + content::WebContents* GetWebContents() const; // Returns the browser-specific request context. net::URLRequestContextGetter* GetRequestContext(); @@ -188,7 +191,8 @@ class CefBrowserHostImpl : public CefBrowserHost, content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name) OVERRIDE; + const string16& frame_name, + const GURL& target_url) OVERRIDE; virtual void WebContentsCreated(content::WebContents* source_contents, int64 source_frame_id, const GURL& target_url, @@ -245,7 +249,7 @@ class CefBrowserHostImpl : public CefBrowserHost, CefBrowserHostImpl(const CefWindowInfo& window_info, const CefBrowserSettings& settings, CefRefPtr client, - TabContents* tab_contents, + content::WebContents* web_contents, CefWindowHandle opener); // Updates and returns an existing frame or creates a new frame. Pass @@ -295,7 +299,7 @@ class CefBrowserHostImpl : public CefBrowserHost, CefWindowInfo window_info_; CefBrowserSettings settings_; CefRefPtr client_; - scoped_ptr tab_contents_; + scoped_ptr web_contents_; CefWindowHandle opener_; // Unique ids used for routing communication to/from the renderer. We keep a diff --git a/libcef/browser/browser_host_impl_gtk.cc b/libcef/browser/browser_host_impl_gtk.cc index a031ee38e..d759e6ffe 100644 --- a/libcef/browser/browser_host_impl_gtk.cc +++ b/libcef/browser/browser_host_impl_gtk.cc @@ -11,6 +11,7 @@ #include "base/bind.h" #include "content/public/browser/web_contents_view.h" +#include "content/public/common/renderer_preferences.h" namespace { @@ -82,13 +83,27 @@ bool CefBrowserHostImpl::PlatformCreateWindow() { AddRef(); // Parent the TabContents to the browser window. - window_info_.widget = tab_contents_->GetView()->GetNativeView(); + window_info_.widget = web_contents_->GetView()->GetNativeView(); gtk_container_add(GTK_CONTAINER(window_info_.parent_widget), window_info_.widget); g_signal_connect(G_OBJECT(window_info_.widget), "destroy", G_CALLBACK(window_destroyed), this); + // As an additional requirement on Linux, we must set the colors for the + // render widgets in webkit. + content::RendererPreferences* prefs = + web_contents_->GetMutableRendererPrefs(); + prefs->focus_ring_color = SkColorSetARGB(255, 229, 151, 0); + prefs->thumb_active_color = SkColorSetRGB(244, 244, 244); + prefs->thumb_inactive_color = SkColorSetRGB(234, 234, 234); + prefs->track_color = SkColorSetRGB(211, 211, 211); + + prefs->active_selection_bg_color = SkColorSetRGB(30, 144, 255); + prefs->active_selection_fg_color = SK_ColorWHITE; + prefs->inactive_selection_bg_color = SkColorSetRGB(200, 200, 200); + prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50); + return true; } diff --git a/libcef/browser/browser_host_impl_mac.mm b/libcef/browser/browser_host_impl_mac.mm index 20c6876eb..c578aaae5 100644 --- a/libcef/browser/browser_host_impl_mac.mm +++ b/libcef/browser/browser_host_impl_mac.mm @@ -8,6 +8,7 @@ #import #include "content/public/browser/web_contents_view.h" +#import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "ui/gfx/rect.h" @@ -38,43 +39,6 @@ @end -// Common base class for CEF browser windows. Contains methods relating to hole -// punching required in order to display OpenGL underlay windows. -@interface CefBrowserWindow : NSWindow { -@private - int underlaySurfaceCount_; -} - -// Informs the window that an underlay surface has been added/removed. The -// window is non-opaque while underlay surfaces are present. -- (void)underlaySurfaceAdded; -- (void)underlaySurfaceRemoved; - -@end - -@implementation CefBrowserWindow - -- (void)underlaySurfaceAdded { - DCHECK_GE(underlaySurfaceCount_, 0); - ++underlaySurfaceCount_; - - // We're having the OpenGL surface render under the window, so the window - // needs to be not opaque. - if (underlaySurfaceCount_ == 1) - [self setOpaque:NO]; -} - -- (void)underlaySurfaceRemoved { - --underlaySurfaceCount_; - DCHECK_GE(underlaySurfaceCount_, 0); - - if (underlaySurfaceCount_ == 0) - [self setOpaque:YES]; -} - -@end - - bool CefBrowserHostImpl::PlatformViewText(const std::string& text) { NOTIMPLEMENTED(); return false; @@ -102,7 +66,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() { contentRect.size.width = window_rect.size.width; contentRect.size.height = window_rect.size.height; - newWnd = [[CefBrowserWindow alloc] + newWnd = [[UnderlayOpenGLHostingWindow alloc] initWithContentRect:window_rect styleMask:(NSTitledWindowMask | NSClosableWindowMask | @@ -129,7 +93,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() { // Parent the TabContents to the browser view. const NSRect bounds = [browser_view bounds]; - NSView* native_view = tab_contents_->GetView()->GetNativeView(); + NSView* native_view = web_contents_->GetView()->GetNativeView(); [browser_view addSubview:native_view]; [native_view setFrame:bounds]; [native_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; diff --git a/libcef/browser/browser_host_impl_win.cc b/libcef/browser/browser_host_impl_win.cc index 2561011a7..4b5de7f0d 100644 --- a/libcef/browser/browser_host_impl_win.cc +++ b/libcef/browser/browser_host_impl_win.cc @@ -129,9 +129,9 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message, case WM_SETFOCUS: if (browser) { - TabContents* tab_contents = browser->GetTabContents(); - if (tab_contents) - tab_contents->Focus(); + content::WebContents* web_contents = browser->GetWebContents(); + if (web_contents) + web_contents->Focus(); } return 0; @@ -179,7 +179,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() { AddRef(); // Parent the TabContents to the browser window. - SetParent(tab_contents_->GetView()->GetNativeView(), window_info_.window); + SetParent(web_contents_->GetView()->GetNativeView(), window_info_.window); // Size the web view window to the browser window. RECT cr; diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index f5701657f..e84256e18 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -55,7 +55,7 @@ int CefBrowserMainParts::PreCreateThreads() { } void CefBrowserMainParts::PreMainMessageLoopRun() { - browser_context_.reset(new CefBrowserContext(this)); + browser_context_.reset(new CefBrowserContext()); PlatformInitialize(); net::NetModule::SetResourceProvider(&ResourceProvider); diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 4c1f4b190..cbf02528a 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -16,6 +16,7 @@ #include "base/file_path.h" #include "content/public/browser/access_token_store.h" #include "content/public/browser/media_observer.h" +#include "content/public/browser/render_process_host.h" #include "content/public/common/content_switches.h" #include "googleurl/src/gurl.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -341,7 +342,9 @@ bool CefContentBrowserClient::CanCreateWindow( const GURL& origin, WindowContainerType container_type, content::ResourceContext* context, - int render_process_id) { + int render_process_id, + bool* no_javascript_access) { + *no_javascript_access = false; return true; } diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 1139cf9fe..26c0bb3cc 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -156,7 +156,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient { const GURL& origin, WindowContainerType container_type, content::ResourceContext* context, - int render_process_id) OVERRIDE; + int render_process_id, + bool* no_javascript_access) OVERRIDE; virtual std::string GetWorkerProcessTitle( const GURL& url, content::ResourceContext* context) OVERRIDE; virtual content::SpeechRecognitionManagerDelegate* diff --git a/libcef/browser/devtools_delegate.cc b/libcef/browser/devtools_delegate.cc index 27c8aeb23..0f5258ac1 100644 --- a/libcef/browser/devtools_delegate.cc +++ b/libcef/browser/devtools_delegate.cc @@ -14,12 +14,12 @@ CefDevToolsDelegate::CefDevToolsDelegate( int port, - net::URLRequestContextGetter* context_getter) - : context_getter_(context_getter) { + net::URLRequestContextGetter* context_getter) { devtools_http_handler_ = content::DevToolsHttpHandler::Start( "127.0.0.1", port, "", + context_getter, this); } @@ -36,11 +36,6 @@ std::string CefDevToolsDelegate::GetDiscoveryPageHTML() { IDR_CEF_DEVTOOLS_DISCOVERY_PAGE).as_string(); } -net::URLRequestContext* -CefDevToolsDelegate::GetURLRequestContext() { - return context_getter_->GetURLRequestContext(); -} - bool CefDevToolsDelegate::BundlesFrontendResources() { return true; } diff --git a/libcef/browser/devtools_delegate.h b/libcef/browser/devtools_delegate.h index c4befed50..ca5d76f64 100644 --- a/libcef/browser/devtools_delegate.h +++ b/libcef/browser/devtools_delegate.h @@ -30,12 +30,10 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate { // DevToolsHttpProtocolHandler::Delegate overrides. virtual std::string GetDiscoveryPageHTML() OVERRIDE; - virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; virtual bool BundlesFrontendResources() OVERRIDE; virtual std::string GetFrontendResourcesBaseURL() OVERRIDE; private: - net::URLRequestContextGetter* context_getter_; content::DevToolsHttpHandler* devtools_http_handler_; DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate); diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index c29fc2dee..1c0475efd 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -14,11 +14,10 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "content/browser/download/download_state_info.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager.h" +#include "content/public/browser/web_contents.h" #include "net/base/net_util.h" using content::BrowserThread; diff --git a/libcef/browser/url_network_delegate.cc b/libcef/browser/url_network_delegate.cc index 5f7713bd1..238a9640f 100644 --- a/libcef/browser/url_network_delegate.cc +++ b/libcef/browser/url_network_delegate.cc @@ -10,6 +10,8 @@ #include "libcef/browser/thread_util.h" #include "libcef/common/request_impl.h" +#include "net/base/net_errors.h" + namespace { class CefAuthCallbackImpl : public CefAuthCallback { diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index 27061c669..b350b7331 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -59,7 +59,7 @@ static NSAutoreleasePool* g_autopool = nil; // Common base class for CEF browser windows. Contains methods relating to hole // punching required in order to display OpenGL underlay windows. -@interface ClientWindow : NSWindow { +@interface ClientWindow : NSWindow { @private int underlaySurfaceCount_; }