Create 2272 release branch for CEF3.

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2272@1993 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2015-01-24 03:26:25 +00:00
parent 0d6bfeb4dd
commit dc47bc006a
1045 changed files with 190843 additions and 0 deletions

View File

@ -0,0 +1,80 @@
diff --git web_contents_impl.cc web_contents_impl.cc
index f9ba939..5555235 100644
--- web_contents_impl.cc
+++ web_contents_impl.cc
@@ -1164,22 +1164,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
params.browser_context, params.site_instance, params.routing_id,
params.main_frame_routing_id);
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
-
- if (browser_plugin_guest_) {
- scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
-
- WebContentsViewGuest* rv = new WebContentsViewGuest(
- this, browser_plugin_guest_.get(), platform_view.Pass(),
- render_view_host_delegate_view_);
- render_view_host_delegate_view_ = rv;
- view_.reset(rv);
- } else {
- // Regular WebContentsView.
- view_.reset(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
+
+ if (!view_) {
+ WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+
+ if (browser_plugin_guest_) {
+ scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
+ this, delegate, &render_view_host_delegate_view_));
+
+ WebContentsViewGuest* rv = new WebContentsViewGuest(
+ this, browser_plugin_guest_.get(), platform_view.Pass(),
+ render_view_host_delegate_view_);
+ render_view_host_delegate_view_ = rv;
+ view_.reset(rv);
+ } else {
+ // Regular WebContentsView.
+ view_.reset(CreateWebContentsView(
+ this, delegate, &render_view_host_delegate_view_));
+ }
}
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -1517,6 +1524,9 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
+ content::WebContentsView* view = NULL;
+ content::RenderViewHostDelegateView* delegate_view = NULL;
+
if (delegate_ &&
!delegate_->ShouldCreateWebContents(this,
route_id,
@@ -1525,7 +1535,9 @@ void WebContentsImpl::CreateNewWindow(
params.frame_name,
params.target_url,
partition_id,
- session_storage_namespace)) {
+ session_storage_namespace,
+ &view,
+ &delegate_view)) {
if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
@@ -1545,6 +1557,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.main_frame_routing_id = main_frame_route_id;
create_params.opener = this;
create_params.opener_suppressed = params.opener_suppressed;
+ create_params.view = view;
+ create_params.delegate_view = delegate_view;
if (params.disposition == NEW_BACKGROUND_TAB)
create_params.initially_hidden = true;

27
patch/patches/build.patch Normal file
View File

@ -0,0 +1,27 @@
diff --git common.gypi common.gypi
index f7d7d3b..b188037 100644
--- common.gypi
+++ common.gypi
@@ -9,6 +9,9 @@
# Variables expected to be overriden on the GYP command line (-D) or by
# ~/.gyp/include.gypi.
'variables': {
+ # Directory for CEF source files. This will be set by cef.gypi.
+ 'cef_directory%' : '',
+
# Putting a variables dict inside another variables dict looks kind of
# weird. This is done so that 'host_arch', 'chromeos', etc are defined as
# variables within the outer variables dict here. This is necessary
diff --git mac/strip_save_dsym mac/strip_save_dsym
index c9cf226..0dedbe3 100755
--- mac/strip_save_dsym
+++ mac/strip_save_dsym
@@ -48,7 +48,7 @@ def macho_archs(macho):
"bundle"]
macho_types_re = "Mach-O (?:64-bit )?(?:" + "|".join(macho_types) + ")"
- file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "--", macho],
+ file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "-L", "--", macho],
stdout=subprocess.PIPE)
archs = []

View File

@ -0,0 +1,30 @@
diff --git ui/browser.cc ui/browser.cc
index 6c926b9..a809f0f 100644
--- ui/browser.cc
+++ ui/browser.cc
@@ -1567,7 +1567,9 @@ bool Browser::ShouldCreateWebContents(
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
- content::SessionStorageNamespace* session_storage_namespace) {
+ content::SessionStorageNamespace* session_storage_namespace,
+ content::WebContentsView** view,
+ content::RenderViewHostDelegateView** delegate_view) {
if (window_container_type == WINDOW_CONTAINER_TYPE_BACKGROUND) {
// If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents(route_id,
diff --git ui/browser.h ui/browser.h
index c9aad25..b682e4e 100644
--- ui/browser.h
+++ ui/browser.h
@@ -587,7 +587,9 @@ class Browser : public TabStripModelObserver,
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
- content::SessionStorageNamespace* session_storage_namespace) override;
+ content::SessionStorageNamespace* session_storage_namespace,
+ content::WebContentsView** view,
+ content::RenderViewHostDelegateView** delegate_view) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_frame_id,
const base::string16& frame_name,

View File

@ -0,0 +1,67 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index c7c867e..5b0ea66 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -106,6 +106,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
+ if (compositor->delegate()) {
+ scoped_ptr<cc::SoftwareOutputDevice> output_device =
+ compositor->delegate()->CreateSoftwareOutputDevice(compositor);
+ if (output_device.get())
+ return output_device;
+ }
+
#if defined(OS_WIN)
return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceWin(
compositor));
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 94cd1a91..b13e64fb 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -13,6 +13,7 @@
#include "base/observer_list.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
+#include "cc/output/software_output_device.h"
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -136,6 +137,17 @@ class COMPOSITOR_EXPORT CompositorLock
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
};
+class COMPOSITOR_EXPORT CompositorDelegate {
+ public:
+ virtual scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
+ ui::Compositor* compositor) {
+ return scoped_ptr<cc::SoftwareOutputDevice>();
+ }
+
+ protected:
+ virtual ~CompositorDelegate() {}
+};
+
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -157,6 +169,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
+ CompositorDelegate* delegate() const { return delegate_; }
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
+
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -310,6 +325,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;
+ CompositorDelegate* delegate_ = nullptr;
+
// The root of the Layer tree drawn by this compositor.
Layer* root_layer_;

View File

@ -0,0 +1,60 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 79b40ac..4babaa9 100644
--- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc
@@ -99,7 +99,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
-#ifdef OS_ANDROID
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
DocumentState* document_state,
@@ -111,7 +110,6 @@ bool ContentRendererClient::HandleNavigation(
bool is_redirect) {
return false;
}
-#endif
bool ContentRendererClient::ShouldFork(blink::WebFrame* frame,
const GURL& url,
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index bd43c62..1d6e189 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -195,7 +195,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
-#ifdef OS_ANDROID
// TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351
@@ -210,7 +209,6 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect);
-#endif
// Returns true if we should fork a new process for the given navigation.
// If |send_referrer| is set to false (which is the default), no referrer
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 7258dbb..8dba5f3 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -3811,7 +3811,6 @@ void RenderFrameImpl::OnCommitNavigation(
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
RenderFrame* render_frame,
const NavigationPolicyInfo& info) {
-#ifdef OS_ANDROID
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
@@ -3826,7 +3825,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
info.isRedirect)) {
return blink::WebNavigationPolicyIgnore;
}
-#endif
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame,
info.urlRequest));

View File

@ -0,0 +1,17 @@
diff --git resource_ids resource_ids
index efd5760..62dd7b0 100644
--- resource_ids
+++ resource_ids
@@ -14,6 +14,12 @@
{
"SRCDIR": "../..",
+ "cef/libcef/resources/cef_resources.grd": {
+ "includes": [27500],
+ },
+ "cef/libcef/resources/cef_strings.grd": {
+ "messages": [28000],
+ },
"chrome/browser/browser_resources.grd": {
"includes": [400],
"structures": [750],

View File

@ -0,0 +1,22 @@
diff --git gyp/generator/ninja.py gyp/generator/ninja.py
index 5cda5c3..bad5ca3 100644
--- gyp/generator/ninja.py
+++ gyp/generator/ninja.py
@@ -743,7 +743,16 @@ class NinjaWriter(object):
for path in copy['files']:
# Normalize the path so trailing slashes don't confuse us.
path = os.path.normpath(path)
- basename = os.path.split(path)[1]
+ (parent_path, basename) = os.path.split(path)
+
+ # Xcode uses .lproj directories for localized resources. Add a special
+ # case to maintain the localization directory component if present.
+ if parent_path != '':
+ parent_basename = os.path.basename(parent_path)
+ (parent_root, parent_ext) = os.path.splitext(parent_basename)
+ if parent_ext == '.lproj':
+ basename = os.path.join(parent_basename, basename)
+
src = self.GypPathToNinja(path, env)
dst = self.GypPathToNinja(os.path.join(copy['destination'], basename),
env)

View File

@ -0,0 +1,12 @@
diff --git message_loop.cc message_loop.cc
index 8180733..927f755 100644
--- message_loop.cc
+++ message_loop.cc
@@ -148,7 +148,6 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current());
- DCHECK(!run_loop_);
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);

View File

@ -0,0 +1,49 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index a064d53..8abea71 100644
--- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h
@@ -188,6 +188,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(base_background_color)
IPC_STRUCT_TRAITS_MEMBER(cookie_enabled)
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index a5574d3..8e9e391 100644
--- public/common/web_preferences.cc
+++ public/common/web_preferences.cc
@@ -179,6 +179,7 @@ WebPreferences::WebPreferences()
rubber_banding_on_compositor_thread(false),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
+ base_background_color(0xFFFFFFFF), // Color::white
v8_cache_options(V8_CACHE_OPTIONS_DEFAULT),
v8_script_streaming_enabled(false),
v8_script_streaming_mode(V8_SCRIPT_STREAMING_MODE_ALL),
diff --git public/common/web_preferences.h public/common/web_preferences.h
index 78559f2..028a94e 100644
--- public/common/web_preferences.h
+++ public/common/web_preferences.h
@@ -169,6 +169,7 @@ struct CONTENT_EXPORT WebPreferences {
bool rubber_banding_on_compositor_thread;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
+ uint32_t base_background_color;
V8CacheOptions v8_cache_options;
bool v8_script_streaming_enabled;
V8ScriptStreamingMode v8_script_streaming_mode;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 623cb14..5d21fc5 100644
--- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc
@@ -958,6 +958,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->setJavaEnabled(prefs.java_enabled);
+ web_view->setBaseBackgroundColor(prefs.base_background_color);
+
// By default, allow_universal_access_from_file_urls is set to false and thus
// we mitigate attacks from local HTML files by not granting file:// URLs
// universal access. Only test shell will enable this.

View File

@ -0,0 +1,132 @@
diff --git content_browser_client.cc content_browser_client.cc
index 91c8a4d..10c3b28 100644
--- content_browser_client.cc
+++ content_browser_client.cc
@@ -278,6 +278,10 @@ bool ContentBrowserClient::IsFastShutdownPossible() {
return true;
}
+SkColor ContentBrowserClient::GetBaseBackgroundColor(RenderViewHost* rvh) {
+ return SK_ColorWHITE;
+}
+
base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
return base::FilePath();
}
diff --git content_browser_client.h content_browser_client.h
index 627353d..e1805f4 100644
--- content_browser_client.h
+++ content_browser_client.h
@@ -28,6 +28,7 @@
#include "net/url_request/url_request_interceptor.h"
#include "net/url_request/url_request_job_factory.h"
#include "storage/browser/fileapi/file_system_context.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/window_open_disposition.h"
#if defined(OS_POSIX) && !defined(OS_MACOSX)
@@ -499,6 +500,9 @@ class CONTENT_EXPORT ContentBrowserClient {
// Clears browser cookies.
virtual void ClearCookies(RenderViewHost* rvh) {}
+ // Returns the base background color.
+ virtual SkColor GetBaseBackgroundColor(RenderViewHost* rvh);
+
// Returns the default download directory.
// This can be called on any thread.
virtual base::FilePath GetDefaultDownloadDirectory();
diff --git web_contents.cc web_contents.cc
index 7afc338..c014439 100644
--- web_contents.cc
+++ web_contents.cc
@@ -17,7 +17,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
main_frame_routing_id(MSG_ROUTING_NONE),
initially_hidden(false),
guest_delegate(NULL),
- context(NULL) {}
+ context(NULL),
+ view(NULL),
+ delegate_view(NULL) {}
WebContents::CreateParams::CreateParams(
BrowserContext* context, SiteInstance* site)
@@ -29,7 +31,9 @@ WebContents::CreateParams::CreateParams(
main_frame_routing_id(MSG_ROUTING_NONE),
initially_hidden(false),
guest_delegate(NULL),
- context(NULL) {}
+ context(NULL),
+ view(NULL),
+ delegate_view(NULL) {}
WebContents::CreateParams::~CreateParams() {
}
diff --git web_contents.h web_contents.h
index 87becd6..b66d3fb 100644
--- web_contents.h
+++ web_contents.h
@@ -52,9 +52,11 @@ class PageState;
class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
+class RenderViewHostDelegateView;
class RenderWidgetHostView;
class SiteInstance;
class WebContentsDelegate;
+class WebContentsView;
struct CustomContextMenuContext;
struct DropData;
struct Manifest;
@@ -122,6 +124,10 @@ class WebContents : public PageNavigator,
// Used to specify the location context which display the new view should
// belong. This can be NULL if not needed.
gfx::NativeView context;
+
+ // Optionally specify the view and delegate view.
+ content::WebContentsView* view;
+ content::RenderViewHostDelegateView* delegate_view;
};
// Creates a new WebContents.
diff --git web_contents_delegate.cc web_contents_delegate.cc
index e846041..da3c9e6 100644
--- web_contents_delegate.cc
+++ web_contents_delegate.cc
@@ -137,7 +137,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
- SessionStorageNamespace* session_storage_namespace) {
+ SessionStorageNamespace* session_storage_namespace,
+ content::WebContentsView** view,
+ content::RenderViewHostDelegateView** delegate_view) {
return true;
}
diff --git web_contents_delegate.h web_contents_delegate.h
index 344fbaf..adaa39d 100644
--- web_contents_delegate.h
+++ web_contents_delegate.h
@@ -36,9 +36,11 @@ class DownloadItem;
class JavaScriptDialogManager;
class PageState;
class RenderViewHost;
+class RenderViewHostDelegateView;
class SessionStorageNamespace;
class WebContents;
class WebContentsImpl;
+class WebContentsView;
struct ColorSuggestion;
struct ContextMenuParams;
struct DropData;
@@ -314,7 +316,9 @@ class CONTENT_EXPORT WebContentsDelegate {
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
- SessionStorageNamespace* session_storage_namespace);
+ SessionStorageNamespace* session_storage_namespace,
+ content::WebContentsView** view,
+ content::RenderViewHostDelegateView** delegate_view);
// Notifies the delegate about the creation of a new WebContents. This
// typically happens when popups are created.

View File

@ -0,0 +1,22 @@
diff --git render_process_host_impl.cc render_process_host_impl.cc
index c01b1e9..bf2a9e1 100644
--- render_process_host_impl.cc
+++ render_process_host_impl.cc
@@ -2047,6 +2047,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
#endif
RemoveUserData(kSessionStorageHolderKey);
+ mojo_application_host_.reset(new MojoApplicationHost);
+
IDMap<IPC::Listener>::iterator iter(&listeners_);
while (!iter.IsAtEnd()) {
iter.GetCurrentValue()->OnMessageReceived(
@@ -2056,8 +2058,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
iter.Advance();
}
- mojo_application_host_.reset(new MojoApplicationHost);
-
// It's possible that one of the calls out to the observers might have caused
// this object to be no longer needed.
if (delayed_cleanup_needed_)

View File

@ -0,0 +1,49 @@
diff --git spellcheck_factory.cc spellcheck_factory.cc
index 7d7e1df..b623657 100644
--- spellcheck_factory.cc
+++ spellcheck_factory.cc
@@ -15,6 +15,13 @@
#include "content/public/browser/render_process_host.h"
#include "ui/base/l10n/l10n_util.h"
+namespace {
+
+static base::LazyInstance<SpellcheckServiceFactory>::Leaky
+ g_spellcheck_service_factory = LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
// static
SpellcheckService* SpellcheckServiceFactory::GetForContext(
content::BrowserContext* context) {
@@ -37,7 +44,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderProcessId(
// static
SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() {
- return Singleton<SpellcheckServiceFactory>::get();
+ return g_spellcheck_service_factory.Pointer();
}
SpellcheckServiceFactory::SpellcheckServiceFactory()
diff --git spellcheck_factory.h spellcheck_factory.h
index 3e4ad0e..d52b881 100644
--- spellcheck_factory.h
+++ spellcheck_factory.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "base/memory/singleton.h"
+#include "base/lazy_instance.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
class SpellcheckService;
@@ -26,7 +26,7 @@ class SpellcheckServiceFactory : public BrowserContextKeyedServiceFactory {
static SpellcheckServiceFactory* GetInstance();
private:
- friend struct DefaultSingletonTraits<SpellcheckServiceFactory>;
+ friend struct base::DefaultLazyInstanceTraits<SpellcheckServiceFactory>;
SpellcheckServiceFactory();
~SpellcheckServiceFactory() override;

View File

@ -0,0 +1,34 @@
diff --git core/frame/FrameView.cpp core/frame/FrameView.cpp
index 9b2004d..b9a73c7 100644
--- core/frame/FrameView.cpp
+++ core/frame/FrameView.cpp
@@ -144,8 +144,10 @@ FrameView::FrameView(LocalFrame* frame)
if (!m_frame->isMainFrame())
return;
+#if 0
ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
+#endif
}
PassRefPtrWillBeRawPtr<FrameView> FrameView::create(LocalFrame* frame)
diff --git platform/scroll/ScrollbarThemeMacCommon.mm platform/scroll/ScrollbarThemeMacCommon.mm
index 90abb7c..6bb16c6 100644
--- platform/scroll/ScrollbarThemeMacCommon.mm
+++ platform/scroll/ScrollbarThemeMacCommon.mm
@@ -354,10 +354,14 @@ NSScrollerStyle ScrollbarThemeMacCommon::recommendedScrollerStyle()
// static
bool ScrollbarThemeMacCommon::isOverlayAPIAvailable()
{
+#if 0
static bool apiAvailable =
[NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)]
&& [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)];
return apiAvailable;
+#else
+ return false;
+#endif
}
} // namespace blink

View File

@ -0,0 +1,14 @@
diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc
index 714069f..56c7fa5 100644
--- os_exchange_data_provider_aurax11.cc
+++ os_exchange_data_provider_aurax11.cc
@@ -158,7 +158,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,
format_map_.Insert(atom_cache_.GetAtom(kMimeTypeMozillaURL), mem);
// Set a string fallback as well.
- SetString(spec);
+ if (!HasString())
+ SetString(spec);
// Return early if this drag already contains file contents (this implies
// that file contents must be populated before URLs). Nautilus (and possibly

View File

@ -0,0 +1,13 @@
diff --git underlay_opengl_hosting_window.h underlay_opengl_hosting_window.h
index d673c31..806d134 100644
--- underlay_opengl_hosting_window.h
+++ underlay_opengl_hosting_window.h
@@ -12,7 +12,7 @@
// Common base class for windows that host a OpenGL surface that renders under
// the window. Previously contained methods related to hole punching, now just
// contains common asserts.
-UI_BASE_EXPORT
+__attribute__((visibility("default")))
@interface UnderlayOpenGLHostingWindow : NSWindow
@end

View File

@ -0,0 +1,219 @@
diff --git desktop_aura/desktop_screen_win.cc desktop_aura/desktop_screen_win.cc
index a8e088c..838b6a0 100644
--- desktop_aura/desktop_screen_win.cc
+++ desktop_aura/desktop_screen_win.cc
@@ -32,6 +32,8 @@ gfx::Display DesktopScreenWin::GetDisplayMatching(
}
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
+ if (!window)
+ return NULL;
aura::WindowTreeHost* host = window->GetHost();
return host ? host->GetAcceleratedWidget() : NULL;
}
diff --git desktop_aura/desktop_window_tree_host_win.cc desktop_aura/desktop_window_tree_host_win.cc
index b54a643..5a589e5 100644
--- desktop_aura/desktop_window_tree_host_win.cc
+++ desktop_aura/desktop_window_tree_host_win.cc
@@ -133,7 +133,9 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window,
native_widget_delegate_);
HWND parent_hwnd = NULL;
- if (params.parent && params.parent->GetHost())
+ if (params.parent_widget)
+ parent_hwnd = params.parent_widget;
+ else if (params.parent && params.parent->GetHost())
parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
@@ -820,6 +822,7 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
// TODO(beng): inform the native_widget_delegate_.
+ GetWidget()->GetNativeWindow()->Focus();
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnFocus();
@@ -827,6 +830,7 @@ void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
void DesktopWindowTreeHostWin::HandleNativeBlur(HWND focused_window) {
// TODO(beng): inform the native_widget_delegate_.
+ GetWidget()->GetNativeWindow()->Blur();
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnBlur();
diff --git desktop_aura/desktop_window_tree_host_x11.cc desktop_aura/desktop_window_tree_host_x11.cc
index 2809f02..9a79223 100644
--- desktop_aura/desktop_window_tree_host_x11.cc
+++ desktop_aura/desktop_window_tree_host_x11.cc
@@ -152,7 +152,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
window_shape_(NULL),
custom_window_shape_(false),
urgency_hint_set_(false),
- close_widget_factory_(this) {
+ close_widget_factory_(this),
+ xwindow_destroyed_(false) {
}
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
@@ -354,7 +355,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources.
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
- XDestroyWindow(xdisplay_, xwindow_);
+ if (!xwindow_destroyed_)
+ XDestroyWindow(xdisplay_, xwindow_);
xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed();
@@ -448,6 +450,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
}
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
+ if (!screen_bounds_.IsEmpty())
+ return screen_bounds_;
return bounds_;
}
@@ -460,6 +464,8 @@ gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
// Attempts to calculate the rect by asking the NonClientFrameView what it
// thought its GetBoundsForClientView() were broke combobox drop down
// placement.
+ if (!screen_bounds_.IsEmpty())
+ return screen_bounds_;
return bounds_;
}
@@ -883,6 +889,8 @@ void DesktopWindowTreeHostX11::Hide() {
}
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
+ if (!screen_bounds_.IsEmpty())
+ return screen_bounds_;
return bounds_;
}
@@ -938,6 +946,8 @@ void DesktopWindowTreeHostX11::SetBounds(const gfx::Rect& requested_bounds) {
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
+ if (!screen_bounds_.IsEmpty())
+ return screen_bounds_.origin();
return bounds_.origin();
}
@@ -1057,10 +1067,14 @@ void DesktopWindowTreeHostX11::InitX11Window(
}
}
+ gfx::AcceleratedWidget parent_widget = params.parent_widget;
+ if (parent_widget == gfx::kNullAcceleratedWidget)
+ parent_widget = x_root_window_;
+
bounds_ = gfx::Rect(params.bounds.origin(),
AdjustSize(params.bounds.size()));
xwindow_ = XCreateWindow(
- xdisplay_, x_root_window_,
+ xdisplay_, parent_widget,
bounds_.x(), bounds_.y(),
bounds_.width(), bounds_.height(),
0, // border width
@@ -1697,6 +1711,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
+ case DestroyNotify:
+ xwindow_destroyed_ = true;
+ CloseNow();
+ break;
case FocusOut:
if (xev->xfocus.mode != NotifyGrab) {
ReleaseCapture();
diff --git desktop_aura/desktop_window_tree_host_x11.h desktop_aura/desktop_window_tree_host_x11.h
index d6b5cc8..bf20d4c 100644
--- desktop_aura/desktop_window_tree_host_x11.h
+++ desktop_aura/desktop_window_tree_host_x11.h
@@ -85,6 +85,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Deallocates the internal list of open windows.
static void CleanUpWindowList();
+ void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; }
+
protected:
// Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window,
@@ -253,6 +255,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|.
gfx::Rect bounds_;
+ // Override the screen bounds when the host is a child window.
+ gfx::Rect screen_bounds_;
+
// Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real |restored_bounds_|. Window
// managers tend to send a Configure message with the maximized bounds, and
@@ -337,6 +342,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
+ // True if the xwindow has already been destroyed.
+ bool xwindow_destroyed_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
};
diff --git widget.cc widget.cc
index a24f781..52a1755 100644
--- widget.cc
+++ widget.cc
@@ -109,6 +109,7 @@ Widget::InitParams::InitParams()
use_system_default_icon(false),
show_state(ui::SHOW_STATE_DEFAULT),
parent(NULL),
+ parent_widget(gfx::kNullAcceleratedWidget),
native_widget(NULL),
desktop_window_tree_host(NULL),
layer_type(aura::WINDOW_LAYER_TEXTURED),
@@ -132,6 +133,7 @@ Widget::InitParams::InitParams(Type type)
use_system_default_icon(false),
show_state(ui::SHOW_STATE_DEFAULT),
parent(NULL),
+ parent_widget(gfx::kNullAcceleratedWidget),
native_widget(NULL),
desktop_window_tree_host(NULL),
layer_type(aura::WINDOW_LAYER_TEXTURED),
@@ -306,7 +308,7 @@ void Widget::Init(const InitParams& in_params) {
InitParams params = in_params;
params.child |= (params.type == InitParams::TYPE_CONTROL);
- is_top_level_ = !params.child;
+ is_top_level_ = !params.child || params.parent_widget;
if (params.opacity == views::Widget::InitParams::INFER_OPACITY &&
params.type != views::Widget::InitParams::TYPE_WINDOW &&
@@ -367,7 +369,12 @@ void Widget::Init(const InitParams& in_params) {
Minimize();
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
- SetInitialBoundsForFramelessWindow(params.bounds);
+ if (params.parent_widget) {
+ // Set the bounds directly instead of applying an inset.
+ SetBounds(params.bounds);
+ } else {
+ SetInitialBoundsForFramelessWindow(params.bounds);
+ }
}
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git widget.h widget.h
index e0f6180..25f557f 100644
--- widget.h
+++ widget.h
@@ -235,6 +235,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// Whether the widget should be maximized or minimized.
ui::WindowShowState show_state;
gfx::NativeView parent;
+ gfx::AcceleratedWidget parent_widget;
// Specifies the initial bounds of the Widget. Default is empty, which means
// the NativeWidget may specify a default size. If the parent is specified,
// |bounds| is in the parent's coordinate system. If the parent is not

View File

@ -0,0 +1,32 @@
diff --git ThemeMac.mm ThemeMac.mm
index a35aaea..c049569 100644
--- ThemeMac.mm
+++ ThemeMac.mm
@@ -490,7 +490,7 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
[buttonCell drawWithFrame:NSRect(inflatedRect) inView:view];
#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
- if (states & FocusControlState)
+ if (states & FocusState)
[buttonCell _web_drawFocusRingWithFrame:NSRect(inflatedRect) inView:view];
#endif
[buttonCell setControlView:nil];
diff --git WebCoreNSCellExtras.h WebCoreNSCellExtras.h
index 8623826..b9f683d 100644
--- WebCoreNSCellExtras.h
+++ WebCoreNSCellExtras.h
@@ -26,12 +26,12 @@
#import <AppKit/AppKit.h>
#include "platform/PlatformExport.h"
-#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING (!defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
+#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 1
#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
// FIXME: Might want to use this on Mac once we only support OS X 10.8+
-@interface NSCell (WebCoreFocusRingDrawing)
+PLATFORM_EXPORT @interface NSCell (WebCoreFocusRingDrawing)
- (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
@end

View File

@ -0,0 +1,76 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index f59cc5f..70add24 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -741,7 +741,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, PopupMenuClient* client)
{
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return adoptRefWillBeNoop(new ExternalPopupMenu(frame, client, *m_webView));
return adoptRefWillBeNoop(new PopupMenuChromium(frame, client));
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index 8b7320a..75c2644 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -379,6 +379,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false)
+ , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0)
@@ -3971,9 +3972,14 @@ void WebViewImpl::deviceOrPageScaleFactorChanged()
m_page->inspectorController().deviceOrPageScaleFactorChanged();
}
+void WebViewImpl::setUseExternalPopupMenusThisInstance(bool useExternalPopupMenus)
+{
+ m_shouldUseExternalPopupMenus = useExternalPopupMenus;
+}
+
bool WebViewImpl::useExternalPopupMenus()
{
- return shouldUseExternalPopupMenus;
+ return m_shouldUseExternalPopupMenus;
}
void WebViewImpl::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index 5264cf5..f49be43 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -370,7 +370,8 @@ public:
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool useExternalPopupMenus();
+ void setUseExternalPopupMenusThisInstance(bool);
+ bool useExternalPopupMenus();
bool contextMenuAllowed() const
{
@@ -662,6 +663,8 @@ private:
bool m_contextMenuAllowed;
+ bool m_shouldUseExternalPopupMenus;
+
bool m_doingDragAndDrop;
bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h
index 56d3ad8..a5c0f37 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -405,6 +405,7 @@ public:
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Hides any popup (suggestions, selects...) that might be showing.
virtual void hidePopups() = 0;

13
patch/patches/zlib.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git contrib/minizip/unzip.c contrib/minizip/unzip.c
index af59b80..ee3c0fd 100644
--- contrib/minizip/unzip.c
+++ contrib/minizip/unzip.c
@@ -69,7 +69,7 @@
#include <string.h>
#ifndef NOUNCRYPT
- #define NOUNCRYPT
+// #define NOUNCRYPT
#endif
#include "third_party/zlib/zlib.h"