mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Update to Chromium revision 3a87aecc (#433059)
This commit is contained in:
		@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
 | 
			
		||||
index 4b8d5bc..6a1b374 100644
 | 
			
		||||
index 865b29f..ef44e27 100644
 | 
			
		||||
--- content/browser/renderer_host/browser_compositor_view_mac.h
 | 
			
		||||
+++ content/browser/renderer_host/browser_compositor_view_mac.h
 | 
			
		||||
@@ -56,9 +56,11 @@ class BrowserCompositorMac : public cc::BeginFrameObserver,
 | 
			
		||||
@@ -55,9 +55,11 @@ class BrowserCompositorMac : public cc::BeginFrameObserver,
 | 
			
		||||
 
 | 
			
		||||
   // These will not return nullptr until Destroy is called.
 | 
			
		||||
   DelegatedFrameHost* GetDelegatedFrameHost();
 | 
			
		||||
@@ -15,10 +15,10 @@ index 4b8d5bc..6a1b374 100644
 | 
			
		||||
 
 | 
			
		||||
   void SwapCompositorFrame(uint32_t compositor_frame_sink_id,
 | 
			
		||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
 | 
			
		||||
index 3ec7423..14d5add 100644
 | 
			
		||||
index 4ff716d..aaf17b2 100644
 | 
			
		||||
--- content/browser/renderer_host/browser_compositor_view_mac.mm
 | 
			
		||||
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
 | 
			
		||||
@@ -200,6 +200,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
 | 
			
		||||
@@ -199,6 +199,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
 | 
			
		||||
     g_spare_recyclable_compositors.Get().clear();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ index 3ec7423..14d5add 100644
 | 
			
		||||
 ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
 | 
			
		||||
   if (recyclable_compositor_)
 | 
			
		||||
     return recyclable_compositor_->accelerated_widget_mac();
 | 
			
		||||
@@ -417,8 +423,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
 | 
			
		||||
@@ -416,8 +422,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,22 @@
 | 
			
		||||
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
 | 
			
		||||
index 7122187..19dec1a 100644
 | 
			
		||||
index c628e20..3c4e008d 100644
 | 
			
		||||
--- render_widget_host_view_guest.cc
 | 
			
		||||
+++ render_widget_host_view_guest.cc
 | 
			
		||||
@@ -253,6 +253,9 @@ void RenderWidgetHostViewGuest::Destroy() {
 | 
			
		||||
@@ -253,13 +253,14 @@ void RenderWidgetHostViewGuest::Destroy() {
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {
 | 
			
		||||
+  RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView();
 | 
			
		||||
+  if (rwhv)
 | 
			
		||||
+    return rwhv->GetPhysicalBackingSize();
 | 
			
		||||
   return RenderWidgetHostViewBase::GetPhysicalBackingSize();
 | 
			
		||||
   // We obtain the reference to native view from the owner RenderWidgetHostView.
 | 
			
		||||
   // If the guest is embedded inside a cross-process frame, it is possible to
 | 
			
		||||
   // reach here after the frame is detached in which case there will be no owner
 | 
			
		||||
   // view.
 | 
			
		||||
-  if (!GetOwnerRenderWidgetHostView())
 | 
			
		||||
-    return gfx::Size();
 | 
			
		||||
-  return RenderWidgetHostViewBase::GetPhysicalBackingSize();
 | 
			
		||||
+  return gfx::Size();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 base::string16 RenderWidgetHostViewGuest::GetSelectedText() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
 | 
			
		||||
index 2dc039f..66e45e2 100644
 | 
			
		||||
index d4d4f14..977e24e 100644
 | 
			
		||||
--- browser/browser_plugin/browser_plugin_guest.cc
 | 
			
		||||
+++ browser/browser_plugin/browser_plugin_guest.cc
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 | 
			
		||||
 #include "content/browser/renderer_host/render_widget_host_view_base.h"
 | 
			
		||||
 #include "content/browser/web_contents/web_contents_impl.h"
 | 
			
		||||
@@ -11,7 +11,7 @@ index 2dc039f..66e45e2 100644
 | 
			
		||||
 #include "content/common/browser_plugin/browser_plugin_constants.h"
 | 
			
		||||
 #include "content/common/browser_plugin/browser_plugin_messages.h"
 | 
			
		||||
 #include "content/common/content_constants_internal.h"
 | 
			
		||||
@@ -293,20 +293,19 @@ void BrowserPluginGuest::InitInternal(
 | 
			
		||||
@@ -310,20 +310,19 @@ void BrowserPluginGuest::InitInternal(
 | 
			
		||||
   guest_window_rect_ = params.view_rect;
 | 
			
		||||
 
 | 
			
		||||
   if (owner_web_contents_ != owner_web_contents) {
 | 
			
		||||
@@ -36,7 +36,7 @@ index 2dc039f..66e45e2 100644
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
   RendererPreferences* renderer_prefs =
 | 
			
		||||
@@ -758,11 +757,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
 | 
			
		||||
@@ -796,11 +795,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
 | 
			
		||||
         ->GetWidget()
 | 
			
		||||
         ->Init();
 | 
			
		||||
     GetWebContents()->GetMainFrame()->Init();
 | 
			
		||||
@@ -52,7 +52,7 @@ index 2dc039f..66e45e2 100644
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
diff --git public/browser/browser_plugin_guest_delegate.cc public/browser/browser_plugin_guest_delegate.cc
 | 
			
		||||
index 732df23..25dbc62 100644
 | 
			
		||||
index 8d691ef..eb13b5d 100644
 | 
			
		||||
--- public/browser/browser_plugin_guest_delegate.cc
 | 
			
		||||
+++ public/browser/browser_plugin_guest_delegate.cc
 | 
			
		||||
@@ -4,6 +4,8 @@
 | 
			
		||||
@@ -64,8 +64,8 @@ index 732df23..25dbc62 100644
 | 
			
		||||
 namespace content {
 | 
			
		||||
 
 | 
			
		||||
 bool BrowserPluginGuestDelegate::CanRunInDetachedState() const {
 | 
			
		||||
@@ -36,4 +38,23 @@ bool BrowserPluginGuestDelegate::CanUseCrossProcessFrames() {
 | 
			
		||||
   return true;
 | 
			
		||||
@@ -48,4 +50,23 @@ SiteInstance* BrowserPluginGuestDelegate::GetOwnerSiteInstance() {
 | 
			
		||||
   return nullptr;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+void BrowserPluginGuestDelegate::OnGuestAttached(
 | 
			
		||||
@@ -89,19 +89,18 @@ index 732df23..25dbc62 100644
 | 
			
		||||
+
 | 
			
		||||
 }  // namespace content
 | 
			
		||||
diff --git public/browser/browser_plugin_guest_delegate.h public/browser/browser_plugin_guest_delegate.h
 | 
			
		||||
index 0f805651..fe0385d 100644
 | 
			
		||||
index a32205c..1d93d7b 100644
 | 
			
		||||
--- public/browser/browser_plugin_guest_delegate.h
 | 
			
		||||
+++ public/browser/browser_plugin_guest_delegate.h
 | 
			
		||||
@@ -21,6 +21,8 @@ class Size;
 | 
			
		||||
 namespace content {
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,7 @@ namespace content {
 | 
			
		||||
 class GuestHost;
 | 
			
		||||
+class RenderWidgetHost;
 | 
			
		||||
 class RenderWidgetHost;
 | 
			
		||||
 class SiteInstance;
 | 
			
		||||
+class WebContentsView;
 | 
			
		||||
 
 | 
			
		||||
 // Objects implement this interface to get notified about changes in the guest
 | 
			
		||||
 // WebContents and to provide necessary functionality.
 | 
			
		||||
@@ -87,6 +89,17 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
 | 
			
		||||
@@ -85,6 +86,17 @@ class CONTENT_EXPORT BrowserPluginGuestDelegate {
 | 
			
		||||
   // content module.
 | 
			
		||||
   virtual void SetGuestHost(GuestHost* guest_host) {}
 | 
			
		||||
 
 | 
			
		||||
@@ -118,4 +117,4 @@ index 0f805651..fe0385d 100644
 | 
			
		||||
+
 | 
			
		||||
   // Sets the position of the context menu for the guest contents. The value
 | 
			
		||||
   // reported from the guest renderer should be ignored. The reported value
 | 
			
		||||
   // fromt he guest renderer is incorrect in situations where BrowserPlugin is
 | 
			
		||||
   // from the guest renderer is incorrect in situations where BrowserPlugin is
 | 
			
		||||
 
 | 
			
		||||
@@ -63,10 +63,10 @@ index 4b43013..169ca47 100644
 | 
			
		||||
 content::BrowserContext* GetBrowserContextRedirectedInIncognito(
 | 
			
		||||
     content::BrowserContext* context);
 | 
			
		||||
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
 | 
			
		||||
index ba156c5..0ed578b 100644
 | 
			
		||||
index f715370..fb38098 100644
 | 
			
		||||
--- chrome/browser/profiles/profile_manager.h
 | 
			
		||||
+++ chrome/browser/profiles/profile_manager.h
 | 
			
		||||
@@ -89,7 +89,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
@@ -90,7 +90,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
   // acceptable. Returns null if creation of the new profile fails.
 | 
			
		||||
   // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
 | 
			
		||||
   // make this method private.
 | 
			
		||||
@@ -75,7 +75,7 @@ index ba156c5..0ed578b 100644
 | 
			
		||||
 
 | 
			
		||||
   // Returns total number of profiles available on this machine.
 | 
			
		||||
   size_t GetNumberOfProfiles();
 | 
			
		||||
@@ -117,7 +117,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
@@ -118,7 +118,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
 
 | 
			
		||||
   // Returns true if the profile pointer is known to point to an existing
 | 
			
		||||
   // profile.
 | 
			
		||||
@@ -84,7 +84,7 @@ index ba156c5..0ed578b 100644
 | 
			
		||||
 
 | 
			
		||||
   // Returns the directory where the first created profile is stored,
 | 
			
		||||
   // relative to the user data directory currently in use.
 | 
			
		||||
@@ -126,7 +126,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
@@ -127,7 +127,7 @@ class ProfileManager : public base::NonThreadSafe,
 | 
			
		||||
   // Get the Profile last used (the Profile to which owns the most recently
 | 
			
		||||
   // focused window) with this Chrome build. If no signed profile has been
 | 
			
		||||
   // stored in Local State, hand back the Default profile.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,11 @@
 | 
			
		||||
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
 | 
			
		||||
index 616c9b1..cf1c881 100644
 | 
			
		||||
index bb7757b..532f036 100644
 | 
			
		||||
--- chrome/common/chrome_content_client.cc
 | 
			
		||||
+++ chrome/common/chrome_content_client.cc
 | 
			
		||||
@@ -77,7 +77,7 @@
 | 
			
		||||
@@ -78,7 +78,7 @@
 | 
			
		||||
 #endif
 | 
			
		||||
 
 | 
			
		||||
 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \
 | 
			
		||||
 #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \
 | 
			
		||||
-    !defined(WIDEVINE_CDM_IS_COMPONENT)
 | 
			
		||||
+    !defined(WIDEVINE_CDM_IS_COMPONENT) && defined(WIDEVINE_CDM_VERSION_STRING)
 | 
			
		||||
 #define WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
 | 
			
		||||
index 73ee42f..b30dc83 100644
 | 
			
		||||
index 7d1cf0c..a806826 100644
 | 
			
		||||
--- content/browser/compositor/gpu_process_transport_factory.cc
 | 
			
		||||
+++ content/browser/compositor/gpu_process_transport_factory.cc
 | 
			
		||||
@@ -196,6 +196,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
 | 
			
		||||
@@ -14,10 +14,10 @@ index 73ee42f..b30dc83 100644
 | 
			
		||||
+  }
 | 
			
		||||
+
 | 
			
		||||
 #if defined(USE_AURA)
 | 
			
		||||
   if (shell::ShellIsRemote()) {
 | 
			
		||||
   if (service_manager::ServiceManagerIsRemote()) {
 | 
			
		||||
     NOTREACHED();
 | 
			
		||||
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
 | 
			
		||||
index 6a6b423..4a0d9e4 100644
 | 
			
		||||
index 76f8f38..0fdc07b 100644
 | 
			
		||||
--- ui/compositor/compositor.h
 | 
			
		||||
+++ ui/compositor/compositor.h
 | 
			
		||||
@@ -18,6 +18,7 @@
 | 
			
		||||
@@ -28,7 +28,7 @@ index 6a6b423..4a0d9e4 100644
 | 
			
		||||
 #include "cc/surfaces/surface_sequence.h"
 | 
			
		||||
 #include "cc/trees/layer_tree_host_client.h"
 | 
			
		||||
 #include "cc/trees/layer_tree_host_single_thread_client.h"
 | 
			
		||||
@@ -195,6 +196,17 @@ class COMPOSITOR_EXPORT CompositorLock
 | 
			
		||||
@@ -188,6 +189,17 @@ class COMPOSITOR_EXPORT CompositorLock
 | 
			
		||||
   DISALLOW_COPY_AND_ASSIGN(CompositorLock);
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ index 6a6b423..4a0d9e4 100644
 | 
			
		||||
 // 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
 | 
			
		||||
@@ -218,6 +230,9 @@ class COMPOSITOR_EXPORT Compositor
 | 
			
		||||
@@ -211,6 +223,9 @@ class COMPOSITOR_EXPORT Compositor
 | 
			
		||||
   // Schedules a redraw of the layer tree associated with this compositor.
 | 
			
		||||
   void ScheduleDraw();
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ index 6a6b423..4a0d9e4 100644
 | 
			
		||||
   // 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
 | 
			
		||||
@@ -400,6 +415,8 @@ class COMPOSITOR_EXPORT Compositor
 | 
			
		||||
@@ -393,6 +408,8 @@ class COMPOSITOR_EXPORT Compositor
 | 
			
		||||
 
 | 
			
		||||
   ui::ContextFactory* context_factory_;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
 | 
			
		||||
index bb040a6..c801841 100644
 | 
			
		||||
index 642521f..8fb647f 100644
 | 
			
		||||
--- public/renderer/content_renderer_client.cc
 | 
			
		||||
+++ public/renderer/content_renderer_client.cc
 | 
			
		||||
@@ -100,7 +100,6 @@ bool ContentRendererClient::AllowPopup() {
 | 
			
		||||
@@ -19,10 +19,10 @@ index bb040a6..c801841 100644
 | 
			
		||||
   return false;
 | 
			
		||||
 }
 | 
			
		||||
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
 | 
			
		||||
index 14d8550..92e5b21 100644
 | 
			
		||||
index f2a854f..913e30c 100644
 | 
			
		||||
--- public/renderer/content_renderer_client.h
 | 
			
		||||
+++ public/renderer/content_renderer_client.h
 | 
			
		||||
@@ -208,7 +208,6 @@ class CONTENT_EXPORT ContentRendererClient {
 | 
			
		||||
@@ -204,7 +204,6 @@ class CONTENT_EXPORT ContentRendererClient {
 | 
			
		||||
   // Returns true if a popup window should be allowed.
 | 
			
		||||
   virtual bool AllowPopup();
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ index 14d8550..92e5b21 100644
 | 
			
		||||
   // 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
 | 
			
		||||
@@ -224,6 +223,7 @@ class CONTENT_EXPORT ContentRendererClient {
 | 
			
		||||
@@ -220,6 +219,7 @@ class CONTENT_EXPORT ContentRendererClient {
 | 
			
		||||
                                 blink::WebNavigationPolicy default_policy,
 | 
			
		||||
                                 bool is_redirect);
 | 
			
		||||
 
 | 
			
		||||
@@ -39,10 +39,10 @@ index 14d8550..92e5b21 100644
 | 
			
		||||
   // built in media player for the given |url|. Defaults to false.
 | 
			
		||||
   virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
 | 
			
		||||
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
 | 
			
		||||
index 8880b8d..cab954b 100644
 | 
			
		||||
index 2f79ac0..7e0c73b 100644
 | 
			
		||||
--- renderer/render_frame_impl.cc
 | 
			
		||||
+++ renderer/render_frame_impl.cc
 | 
			
		||||
@@ -5008,7 +5008,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
 | 
			
		||||
@@ -5112,7 +5112,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
 | 
			
		||||
       (pending_navigation_params_ &&
 | 
			
		||||
        !pending_navigation_params_->request_params.redirects.empty());
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@ index 8880b8d..cab954b 100644
 | 
			
		||||
   // The handlenavigation API is deprecated and will be removed once
 | 
			
		||||
   // crbug.com/325351 is resolved.
 | 
			
		||||
   if (GetContentClient()->renderer()->HandleNavigation(
 | 
			
		||||
@@ -5017,7 +5016,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
 | 
			
		||||
@@ -5121,7 +5120,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
 | 
			
		||||
           is_redirect)) {
 | 
			
		||||
     return blink::WebNavigationPolicyIgnore;
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git .gn .gn
 | 
			
		||||
index 585f0d8..9f60467 100644
 | 
			
		||||
index e4b474a..38a41be 100644
 | 
			
		||||
--- .gn
 | 
			
		||||
+++ .gn
 | 
			
		||||
@@ -237,6 +237,7 @@ exec_script_whitelist = [
 | 
			
		||||
@@ -241,6 +241,7 @@ exec_script_whitelist = [
 | 
			
		||||
   "//build/toolchain/win/BUILD.gn",
 | 
			
		||||
   "//build/util/branding.gni",
 | 
			
		||||
   "//build/util/version.gni",
 | 
			
		||||
@@ -11,10 +11,10 @@ index 585f0d8..9f60467 100644
 | 
			
		||||
 
 | 
			
		||||
   # TODO(dgn): Layer violation but breaks the build otherwise, see
 | 
			
		||||
diff --git BUILD.gn BUILD.gn
 | 
			
		||||
index 93699f0..3346d3e 100644
 | 
			
		||||
index 43c7b3d..df225a1 100644
 | 
			
		||||
--- BUILD.gn
 | 
			
		||||
+++ BUILD.gn
 | 
			
		||||
@@ -280,6 +280,7 @@ group("both_gn_and_gyp") {
 | 
			
		||||
@@ -282,6 +282,7 @@ group("both_gn_and_gyp") {
 | 
			
		||||
     # and whether there should be other targets that are iOS-only and missing.
 | 
			
		||||
     deps += [
 | 
			
		||||
       "//cc:cc_unittests",
 | 
			
		||||
@@ -23,11 +23,11 @@ index 93699f0..3346d3e 100644
 | 
			
		||||
       "//chrome/test:unit_tests",
 | 
			
		||||
       "//components:components_browsertests",
 | 
			
		||||
diff --git build/config/win/visual_studio_version.gni build/config/win/visual_studio_version.gni
 | 
			
		||||
index 5bfa9a7..5e6e05d 100644
 | 
			
		||||
index 982fbe8..e757be46 100644
 | 
			
		||||
--- build/config/win/visual_studio_version.gni
 | 
			
		||||
+++ build/config/win/visual_studio_version.gni
 | 
			
		||||
@@ -12,9 +12,8 @@ declare_args() {
 | 
			
		||||
   # Use "2013" for Visual Studio 2013, or "2013e" for the Express version.
 | 
			
		||||
   # Currently always "2015".
 | 
			
		||||
   visual_studio_version = ""
 | 
			
		||||
 
 | 
			
		||||
-  # Directory of the Windows driver kit. If visual_studio_path is empty, this
 | 
			
		||||
@@ -80,7 +80,7 @@ index fbc201e..299156d 100644
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
diff --git build/vs_toolchain.py build/vs_toolchain.py
 | 
			
		||||
index 9c55984..d44d116 100755
 | 
			
		||||
index c768a8a..bb91777 100755
 | 
			
		||||
--- build/vs_toolchain.py
 | 
			
		||||
+++ build/vs_toolchain.py
 | 
			
		||||
@@ -74,11 +74,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
 | 
			
		||||
@@ -103,10 +103,10 @@ index 9c55984..d44d116 100755
 | 
			
		||||
     # directory in order to run binaries locally, but they are needed in order
 | 
			
		||||
     # to create isolates or the mini_installer. Copying them to the output
 | 
			
		||||
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
 | 
			
		||||
index 3e93269..9821a4b 100644
 | 
			
		||||
index c3ac484..13ae760 100644
 | 
			
		||||
--- chrome/chrome_paks.gni
 | 
			
		||||
+++ chrome/chrome_paks.gni
 | 
			
		||||
@@ -233,7 +233,7 @@ template("chrome_paks") {
 | 
			
		||||
@@ -235,7 +235,7 @@ template("chrome_paks") {
 | 
			
		||||
       additional_source_patterns = invoker.additional_locale_source_patterns
 | 
			
		||||
     }
 | 
			
		||||
     input_locales = locales
 | 
			
		||||
@@ -116,10 +116,10 @@ index 3e93269..9821a4b 100644
 | 
			
		||||
     if (is_mac) {
 | 
			
		||||
       output_locales = locales_as_mac_outputs
 | 
			
		||||
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
 | 
			
		||||
index 6994618..4ed3f85 100644
 | 
			
		||||
index 0f37e54..7b81cde 100644
 | 
			
		||||
--- chrome/installer/mini_installer/BUILD.gn
 | 
			
		||||
+++ chrome/installer/mini_installer/BUILD.gn
 | 
			
		||||
@@ -125,7 +125,7 @@ template("generate_mini_installer") {
 | 
			
		||||
@@ -124,7 +124,7 @@ template("generate_mini_installer") {
 | 
			
		||||
     inputs = [
 | 
			
		||||
       "$chrome_dll_file",
 | 
			
		||||
       "$root_out_dir/chrome.exe",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
diff --git resource_ids resource_ids
 | 
			
		||||
index 82347ce..8e09968 100644
 | 
			
		||||
index c500512..0ac0e98 100644
 | 
			
		||||
--- resource_ids
 | 
			
		||||
+++ resource_ids
 | 
			
		||||
@@ -14,6 +14,12 @@
 | 
			
		||||
 {
 | 
			
		||||
   "SRCDIR": "../..",
 | 
			
		||||
@@ -358,5 +358,12 @@
 | 
			
		||||
   # Thinking about appending to the end?
 | 
			
		||||
   # Please read the header and find the right section above instead.
 | 
			
		||||
 
 | 
			
		||||
+  "cef/libcef/resources/cef_resources.grd": {
 | 
			
		||||
+    "includes": [31500],
 | 
			
		||||
@@ -12,6 +12,6 @@ index 82347ce..8e09968 100644
 | 
			
		||||
+  "cef/libcef/resources/cef_strings.grd": {
 | 
			
		||||
+    "messages": [32000],
 | 
			
		||||
+  },
 | 
			
		||||
   "chrome/browser/browser_resources.grd": {
 | 
			
		||||
     "includes": [400],
 | 
			
		||||
     "structures": [850],
 | 
			
		||||
+
 | 
			
		||||
   # Resource ids starting at 31000 are reserved for projects built on Chromium.
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git input_method_win.cc input_method_win.cc
 | 
			
		||||
index 8975069..858bc9b 100644
 | 
			
		||||
index 49efa46..c9eb806 100644
 | 
			
		||||
--- input_method_win.cc
 | 
			
		||||
+++ input_method_win.cc
 | 
			
		||||
@@ -642,8 +642,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
 | 
			
		||||
@@ -664,8 +664,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
 | 
			
		||||
   // receiving keyboard input as long as it is an active window. This works well
 | 
			
		||||
   // even when the |attached_window_handle| becomes active but has not received
 | 
			
		||||
   // WM_FOCUS yet.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git message_loop.cc message_loop.cc
 | 
			
		||||
index 74287b1..7309e88 100644
 | 
			
		||||
index 1581f6c..ecb3149 100644
 | 
			
		||||
--- message_loop.cc
 | 
			
		||||
+++ message_loop.cc
 | 
			
		||||
@@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() {
 | 
			
		||||
@@ -15,7 +15,7 @@ index 74287b1..7309e88 100644
 | 
			
		||||
 #if defined(OS_WIN)
 | 
			
		||||
   if (in_high_res_mode_)
 | 
			
		||||
     Time::ActivateHighResolutionTimer(false);
 | 
			
		||||
@@ -313,6 +307,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
 | 
			
		||||
@@ -319,6 +313,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
 | 
			
		||||
       in_high_res_mode_(false),
 | 
			
		||||
 #endif
 | 
			
		||||
       nestable_tasks_allowed_(true),
 | 
			
		||||
@@ -26,7 +26,7 @@ index 74287b1..7309e88 100644
 | 
			
		||||
       run_loop_(NULL),
 | 
			
		||||
       incoming_task_queue_(new internal::IncomingTaskQueue(this)),
 | 
			
		||||
diff --git message_loop.h message_loop.h
 | 
			
		||||
index 5b1728e..79c4c58 100644
 | 
			
		||||
index ac7a303..b39018b 100644
 | 
			
		||||
--- message_loop.h
 | 
			
		||||
+++ message_loop.h
 | 
			
		||||
@@ -299,6 +299,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
 | 
			
		||||
@@ -46,7 +46,7 @@ index 5b1728e..79c4c58 100644
 | 
			
		||||
   // Can only be called from the thread that owns the MessageLoop.
 | 
			
		||||
   bool is_running() const;
 | 
			
		||||
 
 | 
			
		||||
@@ -437,6 +447,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
 | 
			
		||||
@@ -436,6 +446,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
 | 
			
		||||
   // insider a (accidentally induced?) nested message pump.
 | 
			
		||||
   bool nestable_tasks_allowed_;
 | 
			
		||||
 
 | 
			
		||||
@@ -60,10 +60,10 @@ index 5b1728e..79c4c58 100644
 | 
			
		||||
   // if type_ is TYPE_CUSTOM and pump_ is null.
 | 
			
		||||
   MessagePumpFactoryCallback pump_factory_;
 | 
			
		||||
diff --git message_pump_win.cc message_pump_win.cc
 | 
			
		||||
index b9b2c84..9abef7e 100644
 | 
			
		||||
index f1ec727..4b859c0 100644
 | 
			
		||||
--- message_pump_win.cc
 | 
			
		||||
+++ message_pump_win.cc
 | 
			
		||||
@@ -478,20 +478,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
 | 
			
		||||
@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 bool MessagePumpForUI::ProcessPumpReplacementMessage() {
 | 
			
		||||
@@ -88,7 +88,7 @@ index b9b2c84..9abef7e 100644
 | 
			
		||||
+  bool have_message = false;
 | 
			
		||||
   MSG msg;
 | 
			
		||||
-  const bool have_message =
 | 
			
		||||
-      g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE;
 | 
			
		||||
-      PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE;
 | 
			
		||||
+  // We should not process all window messages if we are in the context of an
 | 
			
		||||
+  // OS modal loop, i.e. in the context of a windows API call like MessageBox.
 | 
			
		||||
+  // This is to ensure that these messages are peeked out by the OS modal loop.
 | 
			
		||||
@@ -102,5 +102,5 @@ index b9b2c84..9abef7e 100644
 | 
			
		||||
 
 | 
			
		||||
-  // Expect no message or a message different than kMsgHaveWork.
 | 
			
		||||
   DCHECK(!have_message || kMsgHaveWork != msg.message ||
 | 
			
		||||
          msg.hwnd != message_hwnd_);
 | 
			
		||||
          msg.hwnd != message_window_.hwnd());
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc
 | 
			
		||||
index dcf7527..46fe51e 100644
 | 
			
		||||
index 049af16..c5130acd 100644
 | 
			
		||||
--- mime_handler_view_guest.cc
 | 
			
		||||
+++ mime_handler_view_guest.cc
 | 
			
		||||
@@ -138,6 +138,8 @@ void MimeHandlerViewGuest::CreateWebContents(
 | 
			
		||||
@@ -179,6 +179,8 @@ void MimeHandlerViewGuest::CreateWebContents(
 | 
			
		||||
   WebContents::CreateParams params(browser_context(),
 | 
			
		||||
                                    guest_site_instance.get());
 | 
			
		||||
   params.guest_delegate = this;
 | 
			
		||||
@@ -11,7 +11,7 @@ index dcf7527..46fe51e 100644
 | 
			
		||||
   callback.Run(WebContents::Create(params));
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -162,6 +164,30 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
 | 
			
		||||
@@ -203,6 +205,30 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
 | 
			
		||||
   return false;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -43,10 +43,10 @@ index dcf7527..46fe51e 100644
 | 
			
		||||
     WebContents* source,
 | 
			
		||||
     const content::OpenURLParams& params) {
 | 
			
		||||
diff --git mime_handler_view_guest.h mime_handler_view_guest.h
 | 
			
		||||
index 87d249e..c6a8ad3 100644
 | 
			
		||||
index d237318..b9cd2ab 100644
 | 
			
		||||
--- mime_handler_view_guest.h
 | 
			
		||||
+++ mime_handler_view_guest.h
 | 
			
		||||
@@ -77,6 +77,15 @@ class MimeHandlerViewGuest :
 | 
			
		||||
@@ -83,6 +83,15 @@ class MimeHandlerViewGuest :
 | 
			
		||||
   bool ShouldHandleFindRequestsForEmbedder() const final;
 | 
			
		||||
   bool ZoomPropagatesFromEmbedderToGuest() const final;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,60 +1,40 @@
 | 
			
		||||
diff --git base/network_delegate.h base/network_delegate.h
 | 
			
		||||
index 6fc19f9..583c8a9 100644
 | 
			
		||||
--- base/network_delegate.h
 | 
			
		||||
+++ base/network_delegate.h
 | 
			
		||||
@@ -37,6 +37,7 @@ namespace net {
 | 
			
		||||
 // of net/base here, because we have a net_base library. Forward declarations
 | 
			
		||||
 // are ok.
 | 
			
		||||
 class CookieOptions;
 | 
			
		||||
+class Filter;
 | 
			
		||||
 class HttpRequestHeaders;
 | 
			
		||||
 class HttpResponseHeaders;
 | 
			
		||||
 class ProxyInfo;
 | 
			
		||||
@@ -116,6 +117,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
 | 
			
		||||
diff --git net/base/network_delegate.h net/base/network_delegate.h
 | 
			
		||||
index 0fccae1..73e33ad 100644
 | 
			
		||||
--- net/base/network_delegate.h
 | 
			
		||||
+++ net/base/network_delegate.h
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
 #include "net/base/completion_callback.h"
 | 
			
		||||
 #include "net/base/net_export.h"
 | 
			
		||||
 #include "net/cookies/canonical_cookie.h"
 | 
			
		||||
+#include "net/filter/source_stream.h"
 | 
			
		||||
 #include "net/proxy/proxy_retry_info.h"
 | 
			
		||||
 
 | 
			
		||||
 class GURL;
 | 
			
		||||
@@ -116,6 +117,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
 | 
			
		||||
       const GURL& target_url,
 | 
			
		||||
       const GURL& referrer_url) const;
 | 
			
		||||
 
 | 
			
		||||
+  // Optionally add a new filter to the filter list. Returns the first filter in
 | 
			
		||||
+  // the list.
 | 
			
		||||
+  virtual Filter* SetupFilter(URLRequest* request,
 | 
			
		||||
+                              Filter* filter_list) {
 | 
			
		||||
+    return filter_list;
 | 
			
		||||
+  }
 | 
			
		||||
+  virtual std::unique_ptr<SourceStream> CreateSourceStream(
 | 
			
		||||
+      net::URLRequest* request,
 | 
			
		||||
+      std::unique_ptr<SourceStream> upstream) { return upstream; }
 | 
			
		||||
+
 | 
			
		||||
  private:
 | 
			
		||||
   // This is the interface for subclasses of NetworkDelegate to implement. These
 | 
			
		||||
   // member functions will be called by the respective public notification
 | 
			
		||||
diff --git filter/filter.h filter/filter.h
 | 
			
		||||
index 91875a2..b6c665f 100644
 | 
			
		||||
--- filter/filter.h
 | 
			
		||||
+++ filter/filter.h
 | 
			
		||||
@@ -59,6 +59,7 @@
 | 
			
		||||
 #include "net/base/net_export.h"
 | 
			
		||||
 #include "net/base/sdch_manager.h"
 | 
			
		||||
diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc
 | 
			
		||||
index b315664..55701edf 100644
 | 
			
		||||
--- net/url_request/url_request_job.cc
 | 
			
		||||
+++ net/url_request/url_request_job.cc
 | 
			
		||||
@@ -494,6 +494,12 @@ void URLRequestJob::NotifyHeadersComplete() {
 | 
			
		||||
     DCHECK(!source_stream_);
 | 
			
		||||
     source_stream_ = SetUpSourceStream();
 | 
			
		||||
 
 | 
			
		||||
+class CefNetworkDelegate;
 | 
			
		||||
 class GURL;
 | 
			
		||||
 
 | 
			
		||||
 namespace net {
 | 
			
		||||
@@ -240,6 +241,7 @@ class NET_EXPORT Filter {
 | 
			
		||||
   FilterType type() const { return type_id_; }
 | 
			
		||||
 
 | 
			
		||||
  protected:
 | 
			
		||||
+  friend class ::CefNetworkDelegate;
 | 
			
		||||
   friend class BrotliUnitTest;
 | 
			
		||||
   friend class GZipUnitTest;
 | 
			
		||||
   friend class SdchFilterChainingTest;
 | 
			
		||||
diff --git url_request/url_request_job.cc url_request/url_request_job.cc
 | 
			
		||||
index f9df570..72b48ec 100644
 | 
			
		||||
--- url_request/url_request_job.cc
 | 
			
		||||
+++ url_request/url_request_job.cc
 | 
			
		||||
@@ -489,6 +489,9 @@ void URLRequestJob::NotifyHeadersComplete() {
 | 
			
		||||
   if (request_->status().is_success())
 | 
			
		||||
     filter_ = SetupFilter();
 | 
			
		||||
 
 | 
			
		||||
+  if (network_delegate_)
 | 
			
		||||
+    filter_.reset(network_delegate_->SetupFilter(request_, filter_.release()));
 | 
			
		||||
+    // Allow the delegate to add a downstream SourceStream for filtering.
 | 
			
		||||
+    if (network_delegate_ && source_stream_) {
 | 
			
		||||
+      source_stream_ = network_delegate_->CreateSourceStream(
 | 
			
		||||
+          request_, std::move(source_stream_));
 | 
			
		||||
+    }
 | 
			
		||||
+
 | 
			
		||||
   if (!filter_.get()) {
 | 
			
		||||
     std::string content_length;
 | 
			
		||||
     request_->GetResponseHeaderByName("content-length", &content_length);
 | 
			
		||||
     if (!source_stream_) {
 | 
			
		||||
       NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
 | 
			
		||||
                                   ERR_CONTENT_DECODING_INIT_FAILED));
 | 
			
		||||
 
 | 
			
		||||
@@ -55,10 +55,10 @@ index c732cee..1c80e81 100644
 | 
			
		||||
 
 | 
			
		||||
 }  // namespace net
 | 
			
		||||
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
 | 
			
		||||
index a3f468d..8d1928f 100644
 | 
			
		||||
index 9b42feb..f7860be 100644
 | 
			
		||||
--- net/http/transport_security_state.cc
 | 
			
		||||
+++ net/http/transport_security_state.cc
 | 
			
		||||
@@ -1374,8 +1374,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
 | 
			
		||||
@@ -1362,8 +1362,10 @@ void TransportSecurityState::SetShouldRequireCTForTesting(bool* required) {
 | 
			
		||||
   g_ct_required_for_testing = *required ? 1 : -1;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -72,10 +72,10 @@ index a3f468d..8d1928f 100644
 | 
			
		||||
   // We consider built-in information to be timely for 10 weeks.
 | 
			
		||||
   return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */;
 | 
			
		||||
diff --git net/http/transport_security_state.h net/http/transport_security_state.h
 | 
			
		||||
index 3326ca2..a2de308 100644
 | 
			
		||||
index fc40b7d..c0b14a4 100644
 | 
			
		||||
--- net/http/transport_security_state.h
 | 
			
		||||
+++ net/http/transport_security_state.h
 | 
			
		||||
@@ -472,6 +472,10 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
@@ -475,6 +475,10 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
   // nullptr to reset.
 | 
			
		||||
   static void SetShouldRequireCTForTesting(bool* required);
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ index 3326ca2..a2de308 100644
 | 
			
		||||
  private:
 | 
			
		||||
   friend class TransportSecurityStateTest;
 | 
			
		||||
   FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPOnly);
 | 
			
		||||
@@ -495,7 +499,7 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
@@ -498,7 +502,7 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
   // IsBuildTimely returns true if the current build is new enough ensure that
 | 
			
		||||
   // built in security information (i.e. HSTS preloading and pinning
 | 
			
		||||
   // information) is timely.
 | 
			
		||||
@@ -95,7 +95,7 @@ index 3326ca2..a2de308 100644
 | 
			
		||||
 
 | 
			
		||||
   // Helper method for actually checking pins.
 | 
			
		||||
   PKPStatus CheckPublicKeyPinsImpl(
 | 
			
		||||
@@ -586,6 +590,8 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
@@ -589,6 +593,8 @@ class NET_EXPORT TransportSecurityState
 | 
			
		||||
   // True if public key pinning bypass is enabled for local trust anchors.
 | 
			
		||||
   bool enable_pkp_bypass_for_local_trust_anchors_;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git url_request.h url_request.h
 | 
			
		||||
index 993afc9..a207f44 100644
 | 
			
		||||
index 9ef191c..2100168 100644
 | 
			
		||||
--- url_request.h
 | 
			
		||||
+++ url_request.h
 | 
			
		||||
@@ -646,10 +646,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
 | 
			
		||||
@@ -655,10 +655,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
 | 
			
		||||
   // Returns the error status of the request.
 | 
			
		||||
   // Do not use! Going to be protected!
 | 
			
		||||
   const URLRequestStatus& status() const { return status_; }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git BUILD.gn BUILD.gn
 | 
			
		||||
index b6b33f1..d80ead9 100644
 | 
			
		||||
index f91ea0e..b57c692 100644
 | 
			
		||||
--- BUILD.gn
 | 
			
		||||
+++ BUILD.gn
 | 
			
		||||
@@ -181,6 +181,10 @@ static_library("pdfium") {
 | 
			
		||||
@@ -183,6 +183,10 @@ static_library("pdfium") {
 | 
			
		||||
   } else {
 | 
			
		||||
     libs += [ "freetype" ]
 | 
			
		||||
   }
 | 
			
		||||
@@ -14,10 +14,10 @@ index b6b33f1..d80ead9 100644
 | 
			
		||||
 
 | 
			
		||||
 static_library("test_support") {
 | 
			
		||||
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
 | 
			
		||||
index 001ebb0..8b2b6cc 100644
 | 
			
		||||
index 334c14c..fd918f3 100644
 | 
			
		||||
--- fpdfsdk/fpdfview.cpp
 | 
			
		||||
+++ fpdfsdk/fpdfview.cpp
 | 
			
		||||
@@ -30,6 +30,7 @@
 | 
			
		||||
@@ -31,6 +31,7 @@
 | 
			
		||||
 #include "fpdfsdk/fsdk_define.h"
 | 
			
		||||
 #include "fpdfsdk/fsdk_pauseadapter.h"
 | 
			
		||||
 #include "fpdfsdk/javascript/ijs_runtime.h"
 | 
			
		||||
@@ -25,8 +25,8 @@ index 001ebb0..8b2b6cc 100644
 | 
			
		||||
 #include "public/fpdf_ext.h"
 | 
			
		||||
 #include "public/fpdf_progressive.h"
 | 
			
		||||
 #include "third_party/base/numerics/safe_conversions_impl.h"
 | 
			
		||||
@@ -299,6 +300,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
 | 
			
		||||
 #endif  // PDF_ENABLE_XFA
 | 
			
		||||
@@ -263,6 +264,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
 | 
			
		||||
 
 | 
			
		||||
   CPDF_ModuleMgr::Destroy();
 | 
			
		||||
   CFX_GEModule::Destroy();
 | 
			
		||||
+  FXJS_Release();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
 | 
			
		||||
index f2eb0d2..4909609 100644
 | 
			
		||||
index 86fcd13..c695975 100644
 | 
			
		||||
--- public/common/common_param_traits_macros.h
 | 
			
		||||
+++ public/common/common_param_traits_macros.h
 | 
			
		||||
@@ -203,6 +203,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
 | 
			
		||||
@@ -201,6 +201,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)
 | 
			
		||||
@@ -11,11 +11,11 @@ index f2eb0d2..4909609 100644
 | 
			
		||||
   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 18a484d..338f2f8 100644
 | 
			
		||||
index da49d44..e42e715 100644
 | 
			
		||||
--- public/common/web_preferences.cc
 | 
			
		||||
+++ public/common/web_preferences.cc
 | 
			
		||||
@@ -175,6 +175,7 @@ WebPreferences::WebPreferences()
 | 
			
		||||
       pinch_overlay_scrollbar_thickness(0),
 | 
			
		||||
@@ -173,6 +173,7 @@ WebPreferences::WebPreferences()
 | 
			
		||||
       spatial_navigation_enabled(false),
 | 
			
		||||
       use_solid_color_scrollbars(false),
 | 
			
		||||
       navigate_on_drag_drop(true),
 | 
			
		||||
+      base_background_color(0xFFFFFFFF),  // Color::white
 | 
			
		||||
@@ -23,11 +23,11 @@ index 18a484d..338f2f8 100644
 | 
			
		||||
       inert_visual_viewport(false),
 | 
			
		||||
       record_whole_document(false),
 | 
			
		||||
diff --git public/common/web_preferences.h public/common/web_preferences.h
 | 
			
		||||
index 5509a57..d32b4cc 100644
 | 
			
		||||
index b853dd3..d2324bd 100644
 | 
			
		||||
--- public/common/web_preferences.h
 | 
			
		||||
+++ public/common/web_preferences.h
 | 
			
		||||
@@ -188,6 +188,7 @@ struct CONTENT_EXPORT WebPreferences {
 | 
			
		||||
   int pinch_overlay_scrollbar_thickness;
 | 
			
		||||
@@ -186,6 +186,7 @@ struct CONTENT_EXPORT WebPreferences {
 | 
			
		||||
   bool spatial_navigation_enabled;
 | 
			
		||||
   bool use_solid_color_scrollbars;
 | 
			
		||||
   bool navigate_on_drag_drop;
 | 
			
		||||
+  uint32_t base_background_color;
 | 
			
		||||
@@ -35,10 +35,10 @@ index 5509a57..d32b4cc 100644
 | 
			
		||||
   bool inert_visual_viewport;
 | 
			
		||||
   bool record_whole_document;
 | 
			
		||||
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
 | 
			
		||||
index 6a461f6..4eba51c 100644
 | 
			
		||||
index 0c11c30..c0ae0af 100644
 | 
			
		||||
--- renderer/render_view_impl.cc
 | 
			
		||||
+++ renderer/render_view_impl.cc
 | 
			
		||||
@@ -1492,6 +1492,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
 | 
			
		||||
@@ -1351,6 +1351,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
 | 
			
		||||
     blink::WebView* web_view,
 | 
			
		||||
     CompositorDependencies* compositor_deps) {
 | 
			
		||||
   ApplyWebPreferences(prefs, web_view);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git prefs_tab_helper.cc prefs_tab_helper.cc
 | 
			
		||||
index 448bb72..aa98dda 100644
 | 
			
		||||
index e20d4e5c..d350a14 100644
 | 
			
		||||
--- prefs_tab_helper.cc
 | 
			
		||||
+++ prefs_tab_helper.cc
 | 
			
		||||
@@ -11,8 +11,8 @@
 | 
			
		||||
@@ -12,7 +12,7 @@ index 448bb72..aa98dda 100644
 | 
			
		||||
 #include "base/strings/string_number_conversions.h"
 | 
			
		||||
 #include "base/strings/string_util.h"
 | 
			
		||||
 #include "base/strings/stringprintf.h"
 | 
			
		||||
@@ -422,12 +422,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
 | 
			
		||||
@@ -429,12 +429,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
 | 
			
		||||
         GetInstance()->GetServiceForBrowserContext(profile, true));
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ index 448bb72..aa98dda 100644
 | 
			
		||||
 
 | 
			
		||||
   PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
 | 
			
		||||
       "PrefWatcher",
 | 
			
		||||
@@ -448,6 +446,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
 | 
			
		||||
@@ -455,6 +453,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
 | 
			
		||||
   }
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,36 @@
 | 
			
		||||
diff --git chrome/browser/ui/cocoa/applescript/tab_applescript.mm chrome/browser/ui/cocoa/applescript/tab_applescript.mm
 | 
			
		||||
index 4552193..dbf30ae 100644
 | 
			
		||||
index cb9d140..528091d 100644
 | 
			
		||||
--- chrome/browser/ui/cocoa/applescript/tab_applescript.mm
 | 
			
		||||
+++ chrome/browser/ui/cocoa/applescript/tab_applescript.mm
 | 
			
		||||
@@ -9,7 +9,9 @@
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
 #include "base/logging.h"
 | 
			
		||||
 #import "base/mac/scoped_nsobject.h"
 | 
			
		||||
 #include "base/strings/sys_string_conversions.h"
 | 
			
		||||
+#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 #include "chrome/browser/printing/print_view_manager.h"
 | 
			
		||||
+#endif
 | 
			
		||||
-#include "chrome/browser/printing/print_view_manager.h"
 | 
			
		||||
 #include "chrome/browser/sessions/session_tab_helper.h"
 | 
			
		||||
 #include "chrome/browser/ui/cocoa/applescript/apple_event_util.h"
 | 
			
		||||
 #include "chrome/browser/ui/cocoa/applescript/error_applescript.h"
 | 
			
		||||
@@ -224,11 +226,15 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id,
 | 
			
		||||
@@ -25,8 +24,13 @@
 | 
			
		||||
 #include "content/public/browser/save_page_type.h"
 | 
			
		||||
 #include "content/public/browser/web_contents.h"
 | 
			
		||||
 #include "content/public/browser/web_contents_delegate.h"
 | 
			
		||||
+#include "printing/features/features.h"
 | 
			
		||||
 #include "url/gurl.h"
 | 
			
		||||
 
 | 
			
		||||
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#include "chrome/browser/printing/print_view_manager.h"
 | 
			
		||||
+#endif
 | 
			
		||||
+
 | 
			
		||||
 using content::NavigationController;
 | 
			
		||||
 using content::NavigationEntry;
 | 
			
		||||
 using content::OpenURLParams;
 | 
			
		||||
@@ -231,11 +235,15 @@ - (void)handlesStopScriptCommand:(NSScriptCommand*)command {
 | 
			
		||||
 
 | 
			
		||||
 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command {
 | 
			
		||||
   AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT);
 | 
			
		||||
+#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   bool initiated =
 | 
			
		||||
       printing::PrintViewManager::FromWebContents(webContents_)->PrintNow();
 | 
			
		||||
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   bool initiated = printing::PrintViewManager::FromWebContents(webContents_)
 | 
			
		||||
                        ->PrintNow(webContents_->GetMainFrame());
 | 
			
		||||
   if (!initiated) {
 | 
			
		||||
     AppleScript::SetError(AppleScript::errInitiatePrinting);
 | 
			
		||||
   }
 | 
			
		||||
@@ -29,215 +41,215 @@ index 4552193..dbf30ae 100644
 | 
			
		||||
 
 | 
			
		||||
 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command {
 | 
			
		||||
diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc
 | 
			
		||||
index 6798e35..215777f 100644
 | 
			
		||||
index 5820bb1..a1a8f08 100644
 | 
			
		||||
--- components/printing/common/print_messages.cc
 | 
			
		||||
+++ components/printing/common/print_messages.cc
 | 
			
		||||
@@ -103,7 +103,6 @@ void PrintMsg_PrintPages_Params::Reset() {
 | 
			
		||||
@@ -105,7 +105,6 @@ void PrintMsg_PrintPages_Params::Reset() {
 | 
			
		||||
   pages = std::vector<int>();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 PrintHostMsg_RequestPrintPreview_Params::
 | 
			
		||||
     PrintHostMsg_RequestPrintPreview_Params()
 | 
			
		||||
     : is_modifiable(false),
 | 
			
		||||
@@ -125,4 +124,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
 | 
			
		||||
@@ -127,4 +126,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
 | 
			
		||||
 PrintHostMsg_SetOptionsFromDocument_Params::
 | 
			
		||||
     ~PrintHostMsg_SetOptionsFromDocument_Params() {
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h
 | 
			
		||||
index a019144..af8839d 100644
 | 
			
		||||
index 3d1e71a..a876c2a 100644
 | 
			
		||||
--- components/printing/common/print_messages.h
 | 
			
		||||
+++ components/printing/common/print_messages.h
 | 
			
		||||
@@ -71,7 +71,6 @@ struct PrintMsg_PrintPages_Params {
 | 
			
		||||
@@ -73,7 +73,6 @@ struct PrintMsg_PrintPages_Params {
 | 
			
		||||
   std::vector<int> pages;
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 struct PrintHostMsg_RequestPrintPreview_Params {
 | 
			
		||||
   PrintHostMsg_RequestPrintPreview_Params();
 | 
			
		||||
   ~PrintHostMsg_RequestPrintPreview_Params();
 | 
			
		||||
@@ -90,7 +89,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
 | 
			
		||||
@@ -92,7 +91,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
 | 
			
		||||
   printing::DuplexMode duplex;
 | 
			
		||||
   printing::PageRanges page_ranges;
 | 
			
		||||
 };
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 #endif  // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
 | 
			
		||||
 
 | 
			
		||||
@@ -177,7 +175,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
 | 
			
		||||
@@ -182,7 +180,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(to)
 | 
			
		||||
 IPC_STRUCT_TRAITS_END()
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(webnode_only)
 | 
			
		||||
@@ -198,7 +195,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
 | 
			
		||||
@@ -203,7 +200,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
 | 
			
		||||
   // Specifies page range to be printed.
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(page_ranges)
 | 
			
		||||
 IPC_STRUCT_TRAITS_END()
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(content_width)
 | 
			
		||||
@@ -218,7 +214,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
 | 
			
		||||
@@ -223,7 +219,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
 | 
			
		||||
   IPC_STRUCT_TRAITS_MEMBER(pages)
 | 
			
		||||
 IPC_STRUCT_TRAITS_END()
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Parameters to describe a rendered document.
 | 
			
		||||
 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
 | 
			
		||||
   // A shared memory handle to metafile data.
 | 
			
		||||
@@ -272,7 +267,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
 | 
			
		||||
@@ -280,7 +275,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
 | 
			
		||||
   // Indicates whether the existing preview data needs to be cleared or not.
 | 
			
		||||
   IPC_STRUCT_MEMBER(bool, clear_preview_data)
 | 
			
		||||
 IPC_STRUCT_END()
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 // Parameters to describe a rendered page.
 | 
			
		||||
 IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
 | 
			
		||||
@@ -311,22 +305,20 @@ IPC_STRUCT_END()
 | 
			
		||||
@@ -319,22 +313,20 @@ IPC_STRUCT_END()
 | 
			
		||||
 
 | 
			
		||||
 // Messages sent from the browser to the renderer.
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Tells the render view to initiate print preview for the entire document.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* selection_only */)
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Tells the RenderFrame to initiate print preview for the entire document.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* has_selection */)
 | 
			
		||||
-#endif
 | 
			
		||||
 
 | 
			
		||||
 // Tells the render frame to initiate printing or print preview for a particular
 | 
			
		||||
 // node, depending on which mode the render frame is in.
 | 
			
		||||
 // Tells the RenderFrame to initiate printing or print preview for a particular
 | 
			
		||||
 // node, depending on which mode the RenderFrame is in.
 | 
			
		||||
 IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#if defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 // Tells the renderer to print the print preview tab's PDF plugin without
 | 
			
		||||
 // showing the print dialog. (This is the final step in the print preview
 | 
			
		||||
 // workflow.)
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview,
 | 
			
		||||
                     base::DictionaryValue /* settings */)
 | 
			
		||||
-#endif  // defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#endif  // defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#endif  // BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 
 | 
			
		||||
 #if defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 // Tells the render view to switch the CSS to print media type, renders every
 | 
			
		||||
@@ -345,13 +337,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked,
 | 
			
		||||
                     bool /* blocked */)
 | 
			
		||||
 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 // Tells the RenderFrame to switch the CSS to print media type, renders every
 | 
			
		||||
@@ -352,13 +344,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
 | 
			
		||||
 // Tells the RenderFrame whether printing is enabled or not.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */)
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Tells the render view to switch the CSS to print media type, renders every
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Tells the RenderFrame to switch the CSS to print media type, renders every
 | 
			
		||||
 // requested pages for print preview using the given |settings|. This gets
 | 
			
		||||
 // called multiple times as the user updates settings.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview,
 | 
			
		||||
                     base::DictionaryValue /* settings */)
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif
 | 
			
		||||
 
 | 
			
		||||
 // Messages sent from the renderer to the browser.
 | 
			
		||||
 
 | 
			
		||||
@@ -411,7 +401,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
 | 
			
		||||
@@ -414,7 +404,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
 | 
			
		||||
                      int /* fd in browser */)  // Used only by Chrome OS.
 | 
			
		||||
 #endif  // defined(OS_ANDROID)
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Asks the browser to do print preview.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
 | 
			
		||||
                     PrintHostMsg_RequestPrintPreview_Params /* params */)
 | 
			
		||||
@@ -445,7 +434,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
 | 
			
		||||
@@ -448,7 +437,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
 | 
			
		||||
 // The memory handle in this message is already valid in the browser process.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
 | 
			
		||||
                     PrintHostMsg_DidPreviewDocument_Params /* params */)
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 // This is sent when there are invalid printer settings.
 | 
			
		||||
 IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
 | 
			
		||||
@@ -454,7 +442,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
 | 
			
		||||
@@ -457,7 +445,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
 | 
			
		||||
                     int /* document cookie */)
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Tell the browser print preview failed.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
 | 
			
		||||
                     int /* document cookie */)
 | 
			
		||||
@@ -481,4 +468,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
 | 
			
		||||
@@ -484,4 +471,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
 | 
			
		||||
 // Notify the browser to set print presets based on source PDF document.
 | 
			
		||||
 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
 | 
			
		||||
                     PrintHostMsg_SetOptionsFromDocument_Params /* params */)
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc
 | 
			
		||||
index 7e9df81..33489d0 100644
 | 
			
		||||
index e343eef..025671c 100644
 | 
			
		||||
--- components/printing/renderer/print_web_view_helper.cc
 | 
			
		||||
+++ components/printing/renderer/print_web_view_helper.cc
 | 
			
		||||
@@ -86,6 +86,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
 | 
			
		||||
@@ -88,6 +88,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
 | 
			
		||||
 
 | 
			
		||||
 #if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 bool g_is_preview_enabled = true;
 | 
			
		||||
+#else
 | 
			
		||||
+bool g_is_preview_enabled = false;
 | 
			
		||||
+#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 const char kPageLoadScriptFormat[] =
 | 
			
		||||
     "document.open(); document.write(%s); document.close();";
 | 
			
		||||
@@ -100,9 +103,6 @@ void ExecuteScript(blink::WebFrame* frame,
 | 
			
		||||
@@ -102,9 +105,6 @@ void ExecuteScript(blink::WebFrame* frame,
 | 
			
		||||
   std::string script = base::StringPrintf(script_format, json.c_str());
 | 
			
		||||
   frame->executeScript(blink::WebString(base::UTF8ToUTF16(script)));
 | 
			
		||||
 }
 | 
			
		||||
-#else
 | 
			
		||||
-bool g_is_preview_enabled = false;
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 int GetDPI(const PrintMsg_Print_Params* print_params) {
 | 
			
		||||
 #if defined(OS_MACOSX)
 | 
			
		||||
@@ -302,7 +302,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -321,7 +321,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
 | 
			
		||||
   return plugin && plugin->supportsPaginatedPrint();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // Returns true if the current destination printer is PRINT_TO_PDF.
 | 
			
		||||
 bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
 | 
			
		||||
   bool print_to_pdf = false;
 | 
			
		||||
@@ -324,7 +323,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -343,7 +342,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
 | 
			
		||||
   }
 | 
			
		||||
   return frame_has_custom_page_size_style;
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 // Disable scaling when either:
 | 
			
		||||
 // - The PDF specifies disabling scaling.
 | 
			
		||||
@@ -378,7 +376,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -397,7 +395,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
 | 
			
		||||
 }
 | 
			
		||||
 #endif
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
 | 
			
		||||
   bool fit_to_paper_size = false;
 | 
			
		||||
   if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
 | 
			
		||||
@@ -421,7 +418,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
 | 
			
		||||
@@ -440,7 +437,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
 | 
			
		||||
   }
 | 
			
		||||
   return blink::WebPrintScalingOptionFitToPrintableArea;
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 PrintMsg_Print_Params CalculatePrintParamsForCss(
 | 
			
		||||
     blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -505,7 +501,6 @@ blink::WebView* FrameReference::view() {
 | 
			
		||||
 // Helper function to scale and round an integer value with a double valued
 | 
			
		||||
 // scaling.
 | 
			
		||||
@@ -559,7 +555,6 @@ blink::WebView* FrameReference::view() {
 | 
			
		||||
   return view_;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 // static - Not anonymous so that platform implementations can use it.
 | 
			
		||||
 void PrintWebViewHelper::PrintHeaderAndFooter(
 | 
			
		||||
     blink::WebCanvas* canvas,
 | 
			
		||||
@@ -563,7 +558,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
 | 
			
		||||
@@ -617,7 +612,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
 | 
			
		||||
 
 | 
			
		||||
   web_view->close();
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 // static - Not anonymous so that platform implementations can use it.
 | 
			
		||||
 float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
 | 
			
		||||
@@ -840,6 +834,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
 | 
			
		||||
@@ -902,6 +896,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderFrame* render_frame,
 | 
			
		||||
       print_for_preview_(false),
 | 
			
		||||
       delegate_(std::move(delegate)),
 | 
			
		||||
       print_node_in_progress_(false),
 | 
			
		||||
@@ -245,91 +257,91 @@ index 7e9df81..33489d0 100644
 | 
			
		||||
       is_loading_(false),
 | 
			
		||||
       is_scripted_preview_delayed_(false),
 | 
			
		||||
       ipc_nesting_level_(0),
 | 
			
		||||
@@ -898,10 +893,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -961,10 +956,8 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
 | 
			
		||||
     return;
 | 
			
		||||
 
 | 
			
		||||
   if (g_is_preview_enabled) {
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     print_preview_context_.InitWithFrame(frame);
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     print_preview_context_.InitWithFrame(web_frame);
 | 
			
		||||
     RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
 | 
			
		||||
-#endif
 | 
			
		||||
   } else {
 | 
			
		||||
 #if defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
     Print(frame, blink::WebNode(), true);
 | 
			
		||||
@@ -925,14 +918,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
 | 
			
		||||
 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
     Print(web_frame, blink::WebNode(), true /* is_scripted? */);
 | 
			
		||||
@@ -988,14 +981,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
 | 
			
		||||
 #endif  // defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#if defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 #endif  // BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_PrintForPrintPreview, OnPrintForPrintPreview)
 | 
			
		||||
-#endif
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_InitiatePrintPreview, OnInitiatePrintPreview)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_PrintPreview, OnPrintPreview)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_PrintingDone, OnPrintingDone)
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked,
 | 
			
		||||
                         SetScriptedPrintBlocked)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
 | 
			
		||||
     IPC_MESSAGE_UNHANDLED(handled = false)
 | 
			
		||||
@@ -987,7 +976,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
 | 
			
		||||
   IPC_END_MESSAGE_MAP()
 | 
			
		||||
@@ -1033,7 +1022,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
 | 
			
		||||
 }
 | 
			
		||||
 #endif  // defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 #endif  // BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 void PrintWebViewHelper::OnPrintForPrintPreview(
 | 
			
		||||
     const base::DictionaryValue& job_settings) {
 | 
			
		||||
   CHECK_LE(ipc_nesting_level_, 1);
 | 
			
		||||
@@ -1052,7 +1040,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
 | 
			
		||||
@@ -1092,7 +1080,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
 | 
			
		||||
     DidFinishPrinting(FAIL_PRINT);
 | 
			
		||||
   }
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
 | 
			
		||||
     const PageSizeMargins& page_layout_in_points,
 | 
			
		||||
@@ -1077,7 +1064,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
 | 
			
		||||
@@ -1117,7 +1104,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
 | 
			
		||||
   ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
 | 
			
		||||
   if (ipc_nesting_level_ > 1)
 | 
			
		||||
     return;
 | 
			
		||||
@@ -1238,7 +1224,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
 | 
			
		||||
@@ -1302,7 +1288,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if !defined(OS_MACOSX) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if !defined(OS_MACOSX) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#if !defined(OS_MACOSX)
 | 
			
		||||
 bool PrintWebViewHelper::RenderPreviewPage(
 | 
			
		||||
     int page_number,
 | 
			
		||||
     const PrintMsg_Print_Params& print_params) {
 | 
			
		||||
@@ -1268,7 +1254,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
			
		||||
@@ -1332,7 +1318,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
			
		||||
   }
 | 
			
		||||
   return PreviewPageRendered(page_number, draft_metafile.get());
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // !defined(OS_MACOSX) && defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // !defined(OS_MACOSX) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+#endif  // !defined(OS_MACOSX)
 | 
			
		||||
 
 | 
			
		||||
 bool PrintWebViewHelper::FinalizePrintReadyDocument() {
 | 
			
		||||
   DCHECK(!is_print_ready_metafile_sent_);
 | 
			
		||||
@@ -1298,7 +1284,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
 | 
			
		||||
@@ -1362,7 +1348,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
 | 
			
		||||
   Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 void PrintWebViewHelper::OnPrintingDone(bool success) {
 | 
			
		||||
   if (ipc_nesting_level_ > 1)
 | 
			
		||||
@@ -1313,7 +1298,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
 | 
			
		||||
   is_scripted_printing_blocked_ = blocked;
 | 
			
		||||
@@ -1377,7 +1362,6 @@ void PrintWebViewHelper::OnSetPrintingEnabled(bool enabled) {
 | 
			
		||||
   is_printing_enabled_ = enabled;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
 | 
			
		||||
   if (ipc_nesting_level_ > 1)
 | 
			
		||||
     return;
 | 
			
		||||
@@ -1324,7 +1308,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
 | 
			
		||||
@@ -1388,7 +1372,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
 | 
			
		||||
   // that instead.
 | 
			
		||||
   auto plugin = delegate_->GetPdfElement(frame);
 | 
			
		||||
   if (!plugin.isNull()) {
 | 
			
		||||
@@ -339,181 +351,181 @@ index 7e9df81..33489d0 100644
 | 
			
		||||
     return;
 | 
			
		||||
   }
 | 
			
		||||
   print_preview_context_.InitWithFrame(frame);
 | 
			
		||||
@@ -1332,7 +1318,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
 | 
			
		||||
@@ -1396,7 +1382,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool has_selection) {
 | 
			
		||||
                           ? PRINT_PREVIEW_USER_INITIATED_SELECTION
 | 
			
		||||
                           : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
 | 
			
		||||
 }
 | 
			
		||||
-#endif
 | 
			
		||||
 
 | 
			
		||||
 bool PrintWebViewHelper::IsPrintingEnabled() {
 | 
			
		||||
   bool result = false;
 | 
			
		||||
@@ -1358,11 +1343,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
 | 
			
		||||
 bool PrintWebViewHelper::IsPrintingEnabled() const {
 | 
			
		||||
   return is_printing_enabled_;
 | 
			
		||||
@@ -1420,11 +1405,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
 | 
			
		||||
 
 | 
			
		||||
   // Make a copy of the node, in case RenderView::OnContextMenuClosed resets
 | 
			
		||||
   // its |context_menu_node_|.
 | 
			
		||||
-  if (g_is_preview_enabled) {
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
+  if (g_is_preview_enabled || force_print_preview_) {
 | 
			
		||||
     print_preview_context_.InitWithNode(node);
 | 
			
		||||
     RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE);
 | 
			
		||||
-#endif
 | 
			
		||||
   } else {
 | 
			
		||||
 #if defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
     blink::WebNode duplicate_node(node);
 | 
			
		||||
@@ -1428,7 +1411,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
 | 
			
		||||
@@ -1490,7 +1473,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
 | 
			
		||||
       }
 | 
			
		||||
       break;
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     case FAIL_PREVIEW:
 | 
			
		||||
       int cookie =
 | 
			
		||||
           print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
 | 
			
		||||
@@ -1440,7 +1422,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
 | 
			
		||||
@@ -1502,7 +1484,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
 | 
			
		||||
       }
 | 
			
		||||
       print_preview_context_.Failed(notify_browser_of_print_failure_);
 | 
			
		||||
       break;
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   }
 | 
			
		||||
   prep_frame_view_.reset();
 | 
			
		||||
   print_pages_params_.reset();
 | 
			
		||||
@@ -1572,7 +1553,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -1634,7 +1615,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 bool PrintWebViewHelper::SetOptionsFromPdfDocument(
 | 
			
		||||
     PrintHostMsg_SetOptionsFromDocument_Params* options) {
 | 
			
		||||
   blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
 | 
			
		||||
@@ -1681,7 +1661,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
 | 
			
		||||
@@ -1743,7 +1723,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
 | 
			
		||||
 
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 #if defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
 bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
 | 
			
		||||
@@ -1790,7 +1769,6 @@ void PrintWebViewHelper::PrintPageInternal(
 | 
			
		||||
@@ -1857,7 +1836,6 @@ void PrintWebViewHelper::PrintPageInternal(
 | 
			
		||||
 
 | 
			
		||||
   MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   if (params.params.display_header_footer) {
 | 
			
		||||
     // TODO(thestig): Figure out why Linux needs this. It is almost certainly
 | 
			
		||||
     // |printingMinimumShrinkFactor| from Blink.
 | 
			
		||||
@@ -1805,7 +1783,6 @@ void PrintWebViewHelper::PrintPageInternal(
 | 
			
		||||
@@ -1872,7 +1850,6 @@ void PrintWebViewHelper::PrintPageInternal(
 | 
			
		||||
                          scale_factor / fudge_factor, page_layout_in_points,
 | 
			
		||||
                          params.params);
 | 
			
		||||
   }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
   float webkit_scale_factor =
 | 
			
		||||
       RenderPageContent(frame, params.page_number, canvas_area, content_area,
 | 
			
		||||
@@ -1841,7 +1818,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
 | 
			
		||||
@@ -1908,7 +1885,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 void PrintWebViewHelper::ShowScriptedPrintPreview() {
 | 
			
		||||
   if (is_scripted_preview_delayed_) {
 | 
			
		||||
     is_scripted_preview_delayed_ = false;
 | 
			
		||||
@@ -1969,7 +1945,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
 | 
			
		||||
@@ -2036,7 +2012,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
 | 
			
		||||
   Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
 | 
			
		||||
   return true;
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
 | 
			
		||||
     : total_page_count_(0),
 | 
			
		||||
diff --git components/printing/renderer/print_web_view_helper.h components/printing/renderer/print_web_view_helper.h
 | 
			
		||||
index dd8d24d..7c73d38 100644
 | 
			
		||||
index 2dad908..fea05fd 100644
 | 
			
		||||
--- components/printing/renderer/print_web_view_helper.h
 | 
			
		||||
+++ components/printing/renderer/print_web_view_helper.h
 | 
			
		||||
@@ -138,9 +138,7 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -143,9 +143,7 @@ class PrintWebViewHelper
 | 
			
		||||
     OK,
 | 
			
		||||
     FAIL_PRINT_INIT,
 | 
			
		||||
     FAIL_PRINT,
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     FAIL_PREVIEW,
 | 
			
		||||
-#endif
 | 
			
		||||
   };
 | 
			
		||||
 
 | 
			
		||||
   enum PrintPreviewErrorBuckets {
 | 
			
		||||
@@ -175,10 +173,8 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -181,10 +179,8 @@ class PrintWebViewHelper
 | 
			
		||||
   void OnPrintForSystemDialog();
 | 
			
		||||
   void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
 | 
			
		||||
 #endif  // defined(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   void OnInitiatePrintPreview(bool selection_only);
 | 
			
		||||
 #endif  // BUILDFLAG(ENABLE_BASIC_PRINTING)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   void OnInitiatePrintPreview(bool has_selection);
 | 
			
		||||
   void OnPrintPreview(const base::DictionaryValue& settings);
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   void OnPrintingDone(bool success);
 | 
			
		||||
 
 | 
			
		||||
   // Get |page_size| and |content_area| information from
 | 
			
		||||
@@ -191,7 +187,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -197,7 +193,6 @@ class PrintWebViewHelper
 | 
			
		||||
   // Update |ignore_css_margins_| based on settings.
 | 
			
		||||
   void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   // Prepare frame for creating preview document.
 | 
			
		||||
   void PrepareFrameForPreviewDocument();
 | 
			
		||||
 
 | 
			
		||||
@@ -208,7 +203,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -214,7 +209,6 @@ class PrintWebViewHelper
 | 
			
		||||
 
 | 
			
		||||
   // Finalize the print ready preview document.
 | 
			
		||||
   bool FinalizePrintReadyDocument();
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
   // Enable/Disable window.print calls.  If |blocked| is true window.print
 | 
			
		||||
   // calls will silently fail.  Call with |blocked| set to false to reenable.
 | 
			
		||||
@@ -237,7 +231,6 @@ class PrintWebViewHelper
 | 
			
		||||
   // Enable/Disable printing.
 | 
			
		||||
   void OnSetPrintingEnabled(bool enabled);
 | 
			
		||||
@@ -242,7 +236,6 @@ class PrintWebViewHelper
 | 
			
		||||
                               const blink::WebNode& node,
 | 
			
		||||
                               int* number_of_pages);
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   // Set options for print preset from source PDF document.
 | 
			
		||||
   bool SetOptionsFromPdfDocument(
 | 
			
		||||
       PrintHostMsg_SetOptionsFromDocument_Params* options);
 | 
			
		||||
@@ -248,7 +241,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -253,7 +246,6 @@ class PrintWebViewHelper
 | 
			
		||||
   bool UpdatePrintSettings(blink::WebLocalFrame* frame,
 | 
			
		||||
                            const blink::WebNode& node,
 | 
			
		||||
                            const base::DictionaryValue& passed_job_settings);
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
   // Get final print settings from the user.
 | 
			
		||||
   // Return false if the user cancels or on error.
 | 
			
		||||
@@ -323,7 +315,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -328,7 +320,6 @@ class PrintWebViewHelper
 | 
			
		||||
       const PrintMsg_PrintPages_Params& params,
 | 
			
		||||
       int page_count);
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   // Given the |device| and |canvas| to draw on, prints the appropriate headers
 | 
			
		||||
   // and footers using strings from |header_footer_info| on to the canvas.
 | 
			
		||||
   static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
 | 
			
		||||
@@ -333,7 +324,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -338,7 +329,6 @@ class PrintWebViewHelper
 | 
			
		||||
                                    float webkit_scale_factor,
 | 
			
		||||
                                    const PageSizeMargins& page_layout_in_points,
 | 
			
		||||
                                    const PrintMsg_Print_Params& params);
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
   bool GetPrintFrame(blink::WebLocalFrame** frame);
 | 
			
		||||
   // Script Initiated Printing ------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -345,7 +335,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -348,7 +338,6 @@ class PrintWebViewHelper
 | 
			
		||||
   bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame,
 | 
			
		||||
                                      bool user_initiated);
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
   // Shows scripted print preview when options from plugin are available.
 | 
			
		||||
   void ShowScriptedPrintPreview();
 | 
			
		||||
 
 | 
			
		||||
@@ -361,7 +350,6 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -364,7 +353,6 @@ class PrintWebViewHelper
 | 
			
		||||
   // |metafile| is the rendered page. Otherwise |metafile| is NULL.
 | 
			
		||||
   // Returns true if print preview should continue, false on failure.
 | 
			
		||||
   bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile);
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
   void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
 | 
			
		||||
 
 | 
			
		||||
@@ -514,6 +502,7 @@ class PrintWebViewHelper
 | 
			
		||||
@@ -516,6 +504,7 @@ class PrintWebViewHelper
 | 
			
		||||
   ScriptingThrottler scripting_throttler_;
 | 
			
		||||
 
 | 
			
		||||
   bool print_node_in_progress_;
 | 
			
		||||
@@ -522,37 +534,37 @@ index dd8d24d..7c73d38 100644
 | 
			
		||||
   bool is_loading_;
 | 
			
		||||
   bool is_scripted_preview_delayed_;
 | 
			
		||||
diff --git components/printing/renderer/print_web_view_helper_mac.mm components/printing/renderer/print_web_view_helper_mac.mm
 | 
			
		||||
index 0b13474..4bf7c6b 100644
 | 
			
		||||
index ff49472..b107439 100644
 | 
			
		||||
--- components/printing/renderer/print_web_view_helper_mac.mm
 | 
			
		||||
+++ components/printing/renderer/print_web_view_helper_mac.mm
 | 
			
		||||
@@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal(
 | 
			
		||||
@@ -69,7 +69,6 @@
 | 
			
		||||
   Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 bool PrintWebViewHelper::RenderPreviewPage(
 | 
			
		||||
     int page_number,
 | 
			
		||||
     const PrintMsg_Print_Params& print_params) {
 | 
			
		||||
@@ -105,7 +104,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
			
		||||
@@ -106,7 +105,6 @@
 | 
			
		||||
   }
 | 
			
		||||
   return PreviewPageRendered(page_number, draft_metafile.get());
 | 
			
		||||
 }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
 
 | 
			
		||||
 void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
 | 
			
		||||
                                     int page_number,
 | 
			
		||||
@@ -140,14 +138,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
 | 
			
		||||
@@ -142,14 +140,12 @@
 | 
			
		||||
 
 | 
			
		||||
     MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
 | 
			
		||||
     skia::SetIsPreviewMetafile(*canvas, is_preview);
 | 
			
		||||
-#if defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     if (params.display_header_footer) {
 | 
			
		||||
       PrintHeaderAndFooter(static_cast<blink::WebCanvas*>(canvas),
 | 
			
		||||
                            page_number + 1,
 | 
			
		||||
                            print_preview_context_.total_page_count(), *frame,
 | 
			
		||||
                            scale_factor, page_layout_in_points, params);
 | 
			
		||||
     }
 | 
			
		||||
-#endif  // defined(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
-#endif  // BUILDFLAG(ENABLE_PRINT_PREVIEW)
 | 
			
		||||
     RenderPageContent(frame, page_number, canvas_area, content_area,
 | 
			
		||||
                       scale_factor, static_cast<blink::WebCanvas*>(canvas));
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
 | 
			
		||||
index fbe7feb..d05b2cf 100644
 | 
			
		||||
index 573b5d9..e61cfa0 100644
 | 
			
		||||
--- content/browser/frame_host/render_frame_message_filter.cc
 | 
			
		||||
+++ content/browser/frame_host/render_frame_message_filter.cc
 | 
			
		||||
@@ -490,7 +490,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
 | 
			
		||||
@@ -491,7 +491,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
 | 
			
		||||
   PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter();
 | 
			
		||||
   std::vector<WebPluginInfo> plugins;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git render_view_host_impl.h render_view_host_impl.h
 | 
			
		||||
index f8cce52..cb56120 100644
 | 
			
		||||
index e8890aa..910a25b 100644
 | 
			
		||||
--- render_view_host_impl.h
 | 
			
		||||
+++ render_view_host_impl.h
 | 
			
		||||
@@ -203,6 +203,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
 | 
			
		||||
@@ -167,6 +167,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
 | 
			
		||||
   void set_is_swapped_out(bool is_swapped_out) {
 | 
			
		||||
     is_swapped_out_ = is_swapped_out;
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
 | 
			
		||||
index be346a8..16683e7 100644
 | 
			
		||||
index 689ae2c..52e405d 100644
 | 
			
		||||
--- render_widget_host_view_mac.mm
 | 
			
		||||
+++ render_widget_host_view_mac.mm
 | 
			
		||||
@@ -461,9 +461,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
 | 
			
		||||
@@ -462,9 +462,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
 | 
			
		||||
   // Paint this view host with |background_color_| when there is no content
 | 
			
		||||
   // ready to draw.
 | 
			
		||||
   background_layer_.reset([[CALayer alloc] init]);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								patch/patches/render_widget_latency_2060.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								patch/patches/render_widget_latency_2060.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
diff --git content/browser/renderer_host/input/render_widget_host_latency_tracker.cc content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
 | 
			
		||||
index a8d3ac2..908d0e5d 100644
 | 
			
		||||
--- content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
 | 
			
		||||
+++ content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
 | 
			
		||||
@@ -96,7 +96,6 @@ void UpdateLatencyCoordinates(const WebInputEvent& event,
 | 
			
		||||
 #define CONFIRM_VALID_TIMING(start, end)     \
 | 
			
		||||
   DCHECK(!start.first_event_time.is_null()); \
 | 
			
		||||
   DCHECK(!end.last_event_time.is_null());    \
 | 
			
		||||
-  DCHECK_GE(end.last_event_time, start.first_event_time);
 | 
			
		||||
 
 | 
			
		||||
 // Touch/wheel to scroll latency that is mostly under 1 second.
 | 
			
		||||
 #define UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY(name, start, end)         \
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git renderer_preferences_util.cc renderer_preferences_util.cc
 | 
			
		||||
index aa4f1c2..cdf2fd9 100644
 | 
			
		||||
index c20a01d..ceeb3eb 100644
 | 
			
		||||
--- renderer_preferences_util.cc
 | 
			
		||||
+++ renderer_preferences_util.cc
 | 
			
		||||
@@ -30,7 +30,8 @@
 | 
			
		||||
@@ -31,7 +31,8 @@
 | 
			
		||||
 #include "ui/base/cocoa/defaults_utils.h"
 | 
			
		||||
 #endif
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ index aa4f1c2..cdf2fd9 100644
 | 
			
		||||
 #include "chrome/browser/themes/theme_service.h"
 | 
			
		||||
 #include "chrome/browser/themes/theme_service_factory.h"
 | 
			
		||||
 #include "ui/views/linux_ui/linux_ui.h"
 | 
			
		||||
@@ -132,7 +133,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
 | 
			
		||||
@@ -133,7 +134,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
 | 
			
		||||
     prefs->caret_blink_interval = interval.InSecondsF();
 | 
			
		||||
 #endif
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -54,10 +54,10 @@ index bd02cb1..074e77f 100644
 | 
			
		||||
       BrowserContext* browser_context);
 | 
			
		||||
 
 | 
			
		||||
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
 | 
			
		||||
index 5b7ba41..82d8fb1 100644
 | 
			
		||||
index 063b0ef..b05fd26 100644
 | 
			
		||||
--- content/browser/browser_context.cc
 | 
			
		||||
+++ content/browser/browser_context.cc
 | 
			
		||||
@@ -115,7 +115,14 @@ StoragePartition* GetStoragePartitionFromConfig(
 | 
			
		||||
@@ -117,7 +117,14 @@ StoragePartition* GetStoragePartitionFromConfig(
 | 
			
		||||
   if (browser_context->IsOffTheRecord())
 | 
			
		||||
     in_memory = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ index 5b7ba41..82d8fb1 100644
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 void SaveSessionStateOnIOThread(
 | 
			
		||||
@@ -506,6 +513,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
 | 
			
		||||
@@ -516,6 +523,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
 | 
			
		||||
                            : nullptr;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -103,10 +103,10 @@ index c34d15a1..429c0e8 100644
 | 
			
		||||
 
 | 
			
		||||
   BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
 | 
			
		||||
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
 | 
			
		||||
index f952adc..e9998f3 100644
 | 
			
		||||
index 43b5cf5..c387825 100644
 | 
			
		||||
--- content/browser/renderer_host/render_process_host_impl.cc
 | 
			
		||||
+++ content/browser/renderer_host/render_process_host_impl.cc
 | 
			
		||||
@@ -675,7 +675,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
 | 
			
		||||
@@ -649,7 +649,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
 | 
			
		||||
 
 | 
			
		||||
 RenderProcessHostImpl::RenderProcessHostImpl(
 | 
			
		||||
     BrowserContext* browser_context,
 | 
			
		||||
@@ -115,7 +115,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
     bool is_for_guests_only)
 | 
			
		||||
     : fast_shutdown_started_(false),
 | 
			
		||||
       deleting_soon_(false),
 | 
			
		||||
@@ -1024,6 +1024,22 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy() {
 | 
			
		||||
@@ -1001,6 +1001,22 @@ void RenderProcessHostImpl::ResetChannelProxy() {
 | 
			
		||||
 
 | 
			
		||||
 void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
			
		||||
@@ -138,7 +138,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
   AddFilter(new ResourceSchedulerFilter(GetID()));
 | 
			
		||||
   MediaInternals* media_internals = MediaInternals::GetInstance();
 | 
			
		||||
   // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
 | 
			
		||||
@@ -1038,8 +1054,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1015,8 +1031,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
       new RenderMessageFilter(
 | 
			
		||||
           GetID(), GetBrowserContext(), request_context.get(),
 | 
			
		||||
           widget_helper_.get(), media_internals,
 | 
			
		||||
@@ -149,7 +149,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
   AddFilter(render_message_filter.get());
 | 
			
		||||
 
 | 
			
		||||
   render_frame_message_filter_ = new RenderFrameMessageFilter(
 | 
			
		||||
@@ -1070,9 +1086,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1047,9 +1063,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
 
 | 
			
		||||
   resource_message_filter_ = new ResourceMessageFilter(
 | 
			
		||||
       GetID(), PROCESS_TYPE_RENDERER,
 | 
			
		||||
@@ -158,13 +158,13 @@ index f952adc..e9998f3 100644
 | 
			
		||||
       storage_partition_impl_->GetFileSystemContext(),
 | 
			
		||||
-      storage_partition_impl_->GetServiceWorkerContext(),
 | 
			
		||||
+      service_worker_context,
 | 
			
		||||
       storage_partition_impl_->GetHostZoomLevelContext(),
 | 
			
		||||
       get_contexts_callback);
 | 
			
		||||
 
 | 
			
		||||
@@ -1097,14 +1113,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
   AddFilter(resource_message_filter_.get());
 | 
			
		||||
@@ -1072,14 +1088,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
   AddFilter(audio_renderer_host_.get());
 | 
			
		||||
   AddFilter(
 | 
			
		||||
       new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager()));
 | 
			
		||||
   AddFilter(new VideoCaptureHost(media_stream_manager));
 | 
			
		||||
-  AddFilter(new AppCacheDispatcherHost(
 | 
			
		||||
-      storage_partition_impl_->GetAppCacheService(), GetID()));
 | 
			
		||||
+  AddFilter(new AppCacheDispatcherHost(app_cache_service, GetID()));
 | 
			
		||||
@@ -179,7 +179,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
       blob_storage_context.get()));
 | 
			
		||||
 
 | 
			
		||||
 #if defined(ENABLE_WEBRTC)
 | 
			
		||||
@@ -1150,14 +1164,13 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1125,14 +1139,13 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
 
 | 
			
		||||
   scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
 | 
			
		||||
       new CacheStorageDispatcherHost();
 | 
			
		||||
@@ -196,7 +196,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
   AddFilter(service_worker_filter.get());
 | 
			
		||||
 
 | 
			
		||||
   AddFilter(new SharedWorkerMessageFilter(
 | 
			
		||||
@@ -1165,12 +1178,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1140,12 +1153,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
       WorkerStoragePartition(
 | 
			
		||||
           storage_partition_impl_->GetURLRequestContext(),
 | 
			
		||||
           storage_partition_impl_->GetMediaURLRequestContext(),
 | 
			
		||||
@@ -212,7 +212,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
       message_port_message_filter_.get()));
 | 
			
		||||
 
 | 
			
		||||
 #if defined(ENABLE_WEBRTC)
 | 
			
		||||
@@ -1185,11 +1198,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1160,11 +1173,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
       GetID(), storage_partition_impl_->GetQuotaManager(),
 | 
			
		||||
       GetContentClient()->browser()->CreateQuotaPermissionContext()));
 | 
			
		||||
 
 | 
			
		||||
@@ -225,7 +225,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
       resource_context, service_worker_context, browser_context);
 | 
			
		||||
   AddFilter(notification_message_filter_.get());
 | 
			
		||||
 
 | 
			
		||||
@@ -1198,7 +1208,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
@@ -1173,7 +1183,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
 | 
			
		||||
   AddFilter(new HistogramMessageFilter());
 | 
			
		||||
   AddFilter(new MemoryMessageFilter(this));
 | 
			
		||||
   AddFilter(new PushMessagingMessageFilter(
 | 
			
		||||
@@ -233,10 +233,10 @@ index f952adc..e9998f3 100644
 | 
			
		||||
+      GetID(), service_worker_context));
 | 
			
		||||
 #if defined(OS_ANDROID)
 | 
			
		||||
   AddFilter(new ScreenOrientationMessageFilterAndroid());
 | 
			
		||||
 #endif
 | 
			
		||||
@@ -1208,6 +1218,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
 | 
			
		||||
   std::unique_ptr<shell::InterfaceRegistry> registry(
 | 
			
		||||
       new shell::InterfaceRegistry);
 | 
			
		||||
   synchronous_compositor_filter_ =
 | 
			
		||||
@@ -1186,6 +1196,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
 | 
			
		||||
   auto registry = base::MakeUnique<service_manager::InterfaceRegistry>(
 | 
			
		||||
       service_manager::mojom::kServiceManager_ConnectorSpec);
 | 
			
		||||
 
 | 
			
		||||
+  // Cast to the derived type from StoragePartitionImpl.
 | 
			
		||||
+  auto platform_notification_context =
 | 
			
		||||
@@ -246,7 +246,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
   channel_->AddAssociatedInterface(
 | 
			
		||||
       base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest,
 | 
			
		||||
                  base::Unretained(this)));
 | 
			
		||||
@@ -1239,8 +1254,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
 | 
			
		||||
@@ -1224,8 +1239,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
 | 
			
		||||
   AddUIThreadInterface(
 | 
			
		||||
       registry.get(),
 | 
			
		||||
       base::Bind(&PlatformNotificationContextImpl::CreateService,
 | 
			
		||||
@@ -256,7 +256,7 @@ index f952adc..e9998f3 100644
 | 
			
		||||
                  GetID()));
 | 
			
		||||
   AddUIThreadInterface(
 | 
			
		||||
       registry.get(),
 | 
			
		||||
@@ -1395,6 +1409,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
 | 
			
		||||
@@ -1399,6 +1413,7 @@ void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
 | 
			
		||||
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
			
		||||
   DCHECK(!is_worker_ref_count_disabled_);
 | 
			
		||||
   is_worker_ref_count_disabled_ = true;
 | 
			
		||||
@@ -265,18 +265,18 @@ index f952adc..e9998f3 100644
 | 
			
		||||
     return;
 | 
			
		||||
   service_worker_ref_count_ = 0;
 | 
			
		||||
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
 | 
			
		||||
index f07c487e..aae8a3e 100644
 | 
			
		||||
index 93c9fd0..968b230 100644
 | 
			
		||||
--- content/browser/renderer_host/render_process_host_impl.h
 | 
			
		||||
+++ content/browser/renderer_host/render_process_host_impl.h
 | 
			
		||||
@@ -73,7 +73,6 @@ class RenderWidgetHostImpl;
 | 
			
		||||
 class RenderWidgetHostViewFrameSubscriber;
 | 
			
		||||
@@ -66,7 +66,6 @@ class RenderWidgetHelper;
 | 
			
		||||
 class RenderWidgetHost;
 | 
			
		||||
 class ResourceMessageFilter;
 | 
			
		||||
 class StoragePartition;
 | 
			
		||||
-class StoragePartitionImpl;
 | 
			
		||||
 
 | 
			
		||||
 namespace mojom {
 | 
			
		||||
 class StoragePartitionService;
 | 
			
		||||
@@ -109,7 +108,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
 | 
			
		||||
@@ -102,7 +101,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
 | 
			
		||||
       public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
 | 
			
		||||
  public:
 | 
			
		||||
   RenderProcessHostImpl(BrowserContext* browser_context,
 | 
			
		||||
@@ -285,7 +285,7 @@ index f07c487e..aae8a3e 100644
 | 
			
		||||
                         bool is_for_guests_only);
 | 
			
		||||
   ~RenderProcessHostImpl() override;
 | 
			
		||||
 
 | 
			
		||||
@@ -484,7 +483,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
 | 
			
		||||
@@ -493,7 +492,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
 | 
			
		||||
   BrowserContext* browser_context_;
 | 
			
		||||
 
 | 
			
		||||
   // Owned by |browser_context_|.
 | 
			
		||||
@@ -295,7 +295,7 @@ index f07c487e..aae8a3e 100644
 | 
			
		||||
   // The observers watching our lifetime.
 | 
			
		||||
   base::ObserverList<RenderProcessHostObserver> observers_;
 | 
			
		||||
diff --git content/browser/site_instance_impl.cc content/browser/site_instance_impl.cc
 | 
			
		||||
index a55d786..9e0de6a 100644
 | 
			
		||||
index 7980783..e6d5a49 100644
 | 
			
		||||
--- content/browser/site_instance_impl.cc
 | 
			
		||||
+++ content/browser/site_instance_impl.cc
 | 
			
		||||
@@ -116,9 +116,8 @@ RenderProcessHost* SiteInstanceImpl::GetProcess() {
 | 
			
		||||
@@ -311,11 +311,11 @@ index a55d786..9e0de6a 100644
 | 
			
		||||
                                              partition,
 | 
			
		||||
                                              site_.SchemeIs(kGuestScheme));
 | 
			
		||||
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
 | 
			
		||||
index 584f2db..551e350 100644
 | 
			
		||||
index 34dcfa6..5459ec4 100644
 | 
			
		||||
--- content/browser/storage_partition_impl.h
 | 
			
		||||
+++ content/browser/storage_partition_impl.h
 | 
			
		||||
@@ -24,9 +24,7 @@
 | 
			
		||||
 #include "content/browser/notifications/platform_notification_context_impl.h"
 | 
			
		||||
@@ -25,9 +25,7 @@
 | 
			
		||||
 #include "content/browser/payments/payment_app_context.h"
 | 
			
		||||
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
 | 
			
		||||
 #include "content/common/content_export.h"
 | 
			
		||||
-#include "content/common/storage_partition_service.mojom.h"
 | 
			
		||||
@@ -324,19 +324,21 @@ index 584f2db..551e350 100644
 | 
			
		||||
 #include "net/cookies/cookie_store.h"
 | 
			
		||||
 #include "storage/browser/quota/special_storage_policy.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -72,9 +70,8 @@ class CONTENT_EXPORT  StoragePartitionImpl
 | 
			
		||||
@@ -73,10 +71,9 @@ class CONTENT_EXPORT  StoragePartitionImpl
 | 
			
		||||
   HostZoomLevelContext* GetHostZoomLevelContext() override;
 | 
			
		||||
   ZoomLevelDelegate* GetZoomLevelDelegate() override;
 | 
			
		||||
   PlatformNotificationContextImpl* GetPlatformNotificationContext() override;
 | 
			
		||||
-
 | 
			
		||||
-  BackgroundSyncContext* GetBackgroundSyncContext();
 | 
			
		||||
-  PaymentAppContext* GetPaymentAppContext();
 | 
			
		||||
-  BroadcastChannelProvider* GetBroadcastChannelProvider();
 | 
			
		||||
+  BackgroundSyncContext* GetBackgroundSyncContext() override;
 | 
			
		||||
+  PaymentAppContext* GetPaymentAppContext() override;
 | 
			
		||||
+  BroadcastChannelProvider* GetBroadcastChannelProvider() override;
 | 
			
		||||
 
 | 
			
		||||
   // mojom::StoragePartitionService interface.
 | 
			
		||||
   void OpenLocalStorage(
 | 
			
		||||
@@ -109,7 +106,8 @@ class CONTENT_EXPORT  StoragePartitionImpl
 | 
			
		||||
@@ -111,7 +108,8 @@ class CONTENT_EXPORT  StoragePartitionImpl
 | 
			
		||||
   BrowserContext* browser_context() const;
 | 
			
		||||
 
 | 
			
		||||
   // Called by each renderer process once.
 | 
			
		||||
@@ -375,7 +377,7 @@ index 075ae3e..57fb5fd 100644
 | 
			
		||||
 
 | 
			
		||||
   void InitializeOnIOThread();
 | 
			
		||||
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
 | 
			
		||||
index aaa5e23..2309a2a 100644
 | 
			
		||||
index d69bd71..e5da59f 100644
 | 
			
		||||
--- content/public/browser/browser_context.h
 | 
			
		||||
+++ content/public/browser/browser_context.h
 | 
			
		||||
@@ -170,6 +170,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
 | 
			
		||||
@@ -403,7 +405,7 @@ index aaa5e23..2309a2a 100644
 | 
			
		||||
 
 | 
			
		||||
 }  // namespace content
 | 
			
		||||
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
 | 
			
		||||
index 909b370..8c6f09d 100644
 | 
			
		||||
index 909b370..29587b9 100644
 | 
			
		||||
--- content/public/browser/storage_partition.h
 | 
			
		||||
+++ content/public/browser/storage_partition.h
 | 
			
		||||
@@ -13,6 +13,8 @@
 | 
			
		||||
@@ -415,7 +417,7 @@ index 909b370..8c6f09d 100644
 | 
			
		||||
 #include "net/cookies/cookie_store.h"
 | 
			
		||||
 
 | 
			
		||||
 class GURL;
 | 
			
		||||
@@ -41,6 +43,8 @@ class DatabaseTracker;
 | 
			
		||||
@@ -41,12 +43,15 @@ class DatabaseTracker;
 | 
			
		||||
 namespace content {
 | 
			
		||||
 
 | 
			
		||||
 class AppCacheService;
 | 
			
		||||
@@ -424,16 +426,24 @@ index 909b370..8c6f09d 100644
 | 
			
		||||
 class BrowserContext;
 | 
			
		||||
 class CacheStorageContext;
 | 
			
		||||
 class DOMStorageContext;
 | 
			
		||||
@@ -74,6 +78,8 @@ class CONTENT_EXPORT StoragePartition {
 | 
			
		||||
 class HostZoomLevelContext;
 | 
			
		||||
 class HostZoomMap;
 | 
			
		||||
 class IndexedDBContext;
 | 
			
		||||
+class PaymentAppContext;
 | 
			
		||||
 class PlatformNotificationContext;
 | 
			
		||||
 class ServiceWorkerContext;
 | 
			
		||||
 class ZoomLevelDelegate;
 | 
			
		||||
@@ -74,6 +79,9 @@ class CONTENT_EXPORT StoragePartition {
 | 
			
		||||
   virtual HostZoomLevelContext* GetHostZoomLevelContext() = 0;
 | 
			
		||||
   virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0;
 | 
			
		||||
   virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0;
 | 
			
		||||
+  virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
 | 
			
		||||
+  virtual PaymentAppContext* GetPaymentAppContext() = 0;
 | 
			
		||||
+  virtual BroadcastChannelProvider* GetBroadcastChannelProvider() = 0;
 | 
			
		||||
 
 | 
			
		||||
   enum : uint32_t {
 | 
			
		||||
     REMOVE_DATA_MASK_APPCACHE = 1 << 0,
 | 
			
		||||
@@ -166,6 +172,10 @@ class CONTENT_EXPORT StoragePartition {
 | 
			
		||||
@@ -166,6 +174,10 @@ class CONTENT_EXPORT StoragePartition {
 | 
			
		||||
   // unwritten data has been written out to the filesystem.
 | 
			
		||||
   virtual void Flush() = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -460,14 +470,14 @@ index 9b26c41..e9f4a0c 100644
 | 
			
		||||
     "web_ui_url_fetcher.cc",
 | 
			
		||||
     "web_ui_url_fetcher.h",
 | 
			
		||||
diff --git extensions/common/api/BUILD.gn extensions/common/api/BUILD.gn
 | 
			
		||||
index 010da6d..a13ba7a 100644
 | 
			
		||||
index a04e789..bf15551 100644
 | 
			
		||||
--- extensions/common/api/BUILD.gn
 | 
			
		||||
+++ extensions/common/api/BUILD.gn
 | 
			
		||||
@@ -99,6 +99,7 @@ group("api") {
 | 
			
		||||
@@ -35,6 +35,7 @@ group("api") {
 | 
			
		||||
   public_deps = [
 | 
			
		||||
     ":generated_api",
 | 
			
		||||
     ":mojom",
 | 
			
		||||
+    "//content/public/common",
 | 
			
		||||
     "//extensions/features",
 | 
			
		||||
   ]
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git controls/button/menu_button.cc controls/button/menu_button.cc
 | 
			
		||||
index 38fc310..fdd8a13 100644
 | 
			
		||||
index e98dda7..14825f6 100644
 | 
			
		||||
--- controls/button/menu_button.cc
 | 
			
		||||
+++ controls/button/menu_button.cc
 | 
			
		||||
@@ -195,7 +195,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) {
 | 
			
		||||
@@ -11,7 +11,7 @@ index 38fc310..fdd8a13 100644
 | 
			
		||||
                          kMenuMarkerPaddingRight,
 | 
			
		||||
                      0);
 | 
			
		||||
   }
 | 
			
		||||
@@ -322,7 +322,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
 | 
			
		||||
@@ -323,7 +323,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
 | 
			
		||||
   gfx::Size s = size();
 | 
			
		||||
 
 | 
			
		||||
   if (show_menu_marker_) {
 | 
			
		||||
@@ -20,7 +20,7 @@ index 38fc310..fdd8a13 100644
 | 
			
		||||
                 kMenuMarkerPaddingRight);
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -411,4 +411,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
 | 
			
		||||
@@ -412,4 +412,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
 | 
			
		||||
   return monitor_bounds.right() - 1;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ index 38fc310..fdd8a13 100644
 | 
			
		||||
+
 | 
			
		||||
 }  // namespace views
 | 
			
		||||
diff --git controls/button/menu_button.h controls/button/menu_button.h
 | 
			
		||||
index 696a941..ce5abcd 100644
 | 
			
		||||
index c232cc1..cc207f9 100644
 | 
			
		||||
--- controls/button/menu_button.h
 | 
			
		||||
+++ controls/button/menu_button.h
 | 
			
		||||
@@ -54,6 +54,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
 | 
			
		||||
@@ -56,7 +56,7 @@ index 696a941..ce5abcd 100644
 | 
			
		||||
   // The time is used for simulating menu behavior for the menu button; that
 | 
			
		||||
   // is, if the menu is shown and the button is pressed, we need to close the
 | 
			
		||||
diff --git view.h view.h
 | 
			
		||||
index 28171db..747930c 100644
 | 
			
		||||
index bb5ebdf..959645a 100644
 | 
			
		||||
--- view.h
 | 
			
		||||
+++ view.h
 | 
			
		||||
@@ -18,6 +18,7 @@
 | 
			
		||||
@@ -67,7 +67,7 @@ index 28171db..747930c 100644
 | 
			
		||||
 #include "build/build_config.h"
 | 
			
		||||
 #include "ui/accessibility/ax_enums.h"
 | 
			
		||||
 #include "ui/base/accelerators/accelerator.h"
 | 
			
		||||
@@ -113,7 +114,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
 | 
			
		||||
@@ -112,7 +113,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
 | 
			
		||||
                           public ui::LayerOwner,
 | 
			
		||||
                           public ui::AcceleratorTarget,
 | 
			
		||||
                           public ui::EventTarget,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,57 +1,44 @@
 | 
			
		||||
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
 | 
			
		||||
index 852e71f..b765a5b 100644
 | 
			
		||||
--- content/browser/renderer_host/render_widget_host_view_aura.cc
 | 
			
		||||
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
 | 
			
		||||
@@ -769,6 +769,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
 | 
			
		||||
     }
 | 
			
		||||
   }
 | 
			
		||||
 #endif
 | 
			
		||||
+#if defined(OS_LINUX)
 | 
			
		||||
+  if (has_external_parent_ && CanFocus()) {
 | 
			
		||||
+    aura::WindowTreeHost* host = window_->GetHost();
 | 
			
		||||
+    if (host)
 | 
			
		||||
+      host->Show();
 | 
			
		||||
+  }
 | 
			
		||||
+#endif
 | 
			
		||||
   // TODO(wjmaclean): can host_ ever be null?
 | 
			
		||||
   if (host_ && set_focus_on_mouse_down_or_key_event_) {
 | 
			
		||||
     set_focus_on_mouse_down_or_key_event_ = false;
 | 
			
		||||
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
 | 
			
		||||
index 292087d..8d6da47 100644
 | 
			
		||||
index 6408c68..735a253 100644
 | 
			
		||||
--- content/browser/renderer_host/render_widget_host_view_base.cc
 | 
			
		||||
+++ content/browser/renderer_host/render_widget_host_view_base.cc
 | 
			
		||||
@@ -44,6 +44,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
 | 
			
		||||
       current_device_scale_factor_(0),
 | 
			
		||||
       current_display_rotation_(display::Display::ROTATE_0),
 | 
			
		||||
       pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
 | 
			
		||||
       text_input_manager_(nullptr),
 | 
			
		||||
+      has_external_parent_(false),
 | 
			
		||||
       renderer_frame_number_(0),
 | 
			
		||||
       weak_factory_(this) {
 | 
			
		||||
 }
 | 
			
		||||
@@ -324,6 +325,10 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
 | 
			
		||||
@@ -327,6 +328,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
 | 
			
		||||
   DVLOG(1) << "FocusedNodeTouched: " << editable;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+void RenderWidgetHostViewBase::SetHasExternalParent(bool val) {
 | 
			
		||||
+  has_external_parent_ = val;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool RenderWidgetHostViewBase::HasExternalParent() const {
 | 
			
		||||
+  return has_external_parent_;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
 uint32_t RenderWidgetHostViewBase::RendererFrameNumber() {
 | 
			
		||||
   return renderer_frame_number_;
 | 
			
		||||
 }
 | 
			
		||||
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
 | 
			
		||||
index 5e25a02..b81350b 100644
 | 
			
		||||
index 88e7a04..0e6a740 100644
 | 
			
		||||
--- content/browser/renderer_host/render_widget_host_view_base.h
 | 
			
		||||
+++ content/browser/renderer_host/render_widget_host_view_base.h
 | 
			
		||||
@@ -107,6 +107,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
 | 
			
		||||
@@ -107,6 +107,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
 | 
			
		||||
   void EndFrameSubscription() override;
 | 
			
		||||
   void FocusedNodeTouched(const gfx::Point& location_dips_screen,
 | 
			
		||||
                           bool editable) override;
 | 
			
		||||
+  void SetHasExternalParent(bool val) override;
 | 
			
		||||
+  bool HasExternalParent() const override;
 | 
			
		||||
 
 | 
			
		||||
   // This only needs to be overridden by RenderWidgetHostViewBase subclasses
 | 
			
		||||
   // that handle content embedded within other RenderWidgetHostViews.
 | 
			
		||||
@@ -477,6 +478,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
 | 
			
		||||
@@ -488,6 +490,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
 | 
			
		||||
   // destroyed before the RWHV is destroyed.
 | 
			
		||||
   TextInputManager* text_input_manager_;
 | 
			
		||||
 
 | 
			
		||||
@@ -62,17 +49,51 @@ index 5e25a02..b81350b 100644
 | 
			
		||||
  private:
 | 
			
		||||
   void FlushInput();
 | 
			
		||||
 
 | 
			
		||||
diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc
 | 
			
		||||
index 2adb005..222ca88 100644
 | 
			
		||||
--- content/browser/renderer_host/render_widget_host_view_event_handler.cc
 | 
			
		||||
+++ content/browser/renderer_host/render_widget_host_view_event_handler.cc
 | 
			
		||||
@@ -28,6 +28,10 @@
 | 
			
		||||
 #include "ui/events/blink/web_input_event.h"
 | 
			
		||||
 #include "ui/touch_selection/touch_selection_controller.h"
 | 
			
		||||
 
 | 
			
		||||
+#if defined(OS_LINUX)
 | 
			
		||||
+#include "ui/aura/window_tree_host.h"
 | 
			
		||||
+#endif
 | 
			
		||||
+
 | 
			
		||||
 #if defined(OS_WIN)
 | 
			
		||||
 #include "content/browser/frame_host/render_frame_host_impl.h"
 | 
			
		||||
 #include "content/public/common/context_menu_params.h"
 | 
			
		||||
@@ -812,6 +816,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
 | 
			
		||||
     }
 | 
			
		||||
   }
 | 
			
		||||
 #endif
 | 
			
		||||
+#if defined(OS_LINUX)
 | 
			
		||||
+  if (host_view_->HasExternalParent() &&
 | 
			
		||||
+      window_ && window_->delegate()->CanFocus()) {
 | 
			
		||||
+    aura::WindowTreeHost* host = window_->GetHost();
 | 
			
		||||
+    if (host)
 | 
			
		||||
+      host->Show();
 | 
			
		||||
+  }
 | 
			
		||||
+#endif
 | 
			
		||||
   // TODO(wjmaclean): can host_ ever be null?
 | 
			
		||||
   if (host_ && set_focus_on_mouse_down_or_key_event_) {
 | 
			
		||||
     set_focus_on_mouse_down_or_key_event_ = false;
 | 
			
		||||
diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h
 | 
			
		||||
index ff3127b..e666db1 100644
 | 
			
		||||
index f721d17..5b6dfa9 100644
 | 
			
		||||
--- content/public/browser/render_widget_host_view.h
 | 
			
		||||
+++ content/public/browser/render_widget_host_view.h
 | 
			
		||||
@@ -172,6 +172,10 @@ class CONTENT_EXPORT RenderWidgetHostView {
 | 
			
		||||
@@ -171,6 +171,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
 | 
			
		||||
   // when the value has changed.  Views must initially default to false.
 | 
			
		||||
   virtual void SetNeedsBeginFrames(bool needs_begin_frames) = 0;
 | 
			
		||||
 
 | 
			
		||||
+  // Set whether the widget has a external parent view/window outside of the
 | 
			
		||||
+  // Chromium-controlled view/window hierarchy.
 | 
			
		||||
+  virtual void SetHasExternalParent(bool val) = 0;
 | 
			
		||||
+
 | 
			
		||||
+  // Returns true if the widget has a external parent view/window outside of the
 | 
			
		||||
+  // Chromium-controlled view/window hierarchy.
 | 
			
		||||
+  virtual bool HasExternalParent() const = 0;
 | 
			
		||||
+
 | 
			
		||||
 #if defined(OS_MACOSX)
 | 
			
		||||
   // Return the accelerated widget which hosts the CALayers that draw the
 | 
			
		||||
@@ -91,7 +112,7 @@ index f772f64..7d13f9f 100644
 | 
			
		||||
   return host ? host->GetAcceleratedWidget() : NULL;
 | 
			
		||||
 }
 | 
			
		||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 | 
			
		||||
index 964fe4a..b878661 100644
 | 
			
		||||
index 0dea5ca..415836b 100644
 | 
			
		||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 | 
			
		||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 | 
			
		||||
@@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin(
 | 
			
		||||
@@ -116,7 +137,7 @@ index 964fe4a..b878661 100644
 | 
			
		||||
 
 | 
			
		||||
   remove_standard_frame_ = params.remove_standard_frame;
 | 
			
		||||
   has_non_client_view_ = Widget::RequiresNonClientView(params.type);
 | 
			
		||||
@@ -645,6 +650,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const {
 | 
			
		||||
@@ -638,6 +643,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const {
 | 
			
		||||
   return native_widget_delegate_->CanActivate();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +148,7 @@ index 964fe4a..b878661 100644
 | 
			
		||||
 bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const {
 | 
			
		||||
   return wants_mouse_events_when_inactive_;
 | 
			
		||||
 }
 | 
			
		||||
@@ -825,11 +834,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
 | 
			
		||||
@@ -818,11 +827,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
 | 
			
		||||
@@ -146,10 +167,10 @@ index 964fe4a..b878661 100644
 | 
			
		||||
 
 | 
			
		||||
 bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) {
 | 
			
		||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
 | 
			
		||||
index 884df90..518a69c 100644
 | 
			
		||||
index c1ee992..4e5fae7 100644
 | 
			
		||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
 | 
			
		||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
 | 
			
		||||
@@ -138,6 +138,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
 | 
			
		||||
@@ -135,6 +135,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
 | 
			
		||||
   bool CanMaximize() const override;
 | 
			
		||||
   bool CanMinimize() const override;
 | 
			
		||||
   bool CanActivate() const override;
 | 
			
		||||
@@ -157,7 +178,7 @@ index 884df90..518a69c 100644
 | 
			
		||||
   bool WantsMouseEventsWhenInactive() const override;
 | 
			
		||||
   bool WidgetSizeIsClientSize() const override;
 | 
			
		||||
   bool IsModal() const override;
 | 
			
		||||
@@ -252,6 +253,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
 | 
			
		||||
@@ -249,6 +250,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
 | 
			
		||||
   // True if the window should have the frame removed.
 | 
			
		||||
   bool remove_standard_frame_;
 | 
			
		||||
 
 | 
			
		||||
@@ -169,7 +190,7 @@ index 884df90..518a69c 100644
 | 
			
		||||
   // a reference.
 | 
			
		||||
   corewm::TooltipWin* tooltip_;
 | 
			
		||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
 | 
			
		||||
index 816faa3..4c2d702 100644
 | 
			
		||||
index 8550a32..9cdd035 100644
 | 
			
		||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
 | 
			
		||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
 | 
			
		||||
@@ -195,6 +195,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
 | 
			
		||||
@@ -207,7 +228,7 @@ index 816faa3..4c2d702 100644
 | 
			
		||||
   return ToDIPRect(bounds_in_pixels_);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -1208,6 +1213,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
 | 
			
		||||
@@ -1202,6 +1207,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
 | 
			
		||||
@@ -216,7 +237,7 @@ index 816faa3..4c2d702 100644
 | 
			
		||||
   return bounds_in_pixels_;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -1267,6 +1274,8 @@ void DesktopWindowTreeHostX11::SetBounds(
 | 
			
		||||
@@ -1261,6 +1268,8 @@ void DesktopWindowTreeHostX11::SetBounds(
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
 | 
			
		||||
@@ -225,7 +246,7 @@ index 816faa3..4c2d702 100644
 | 
			
		||||
   return bounds_in_pixels_.origin();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -1390,9 +1399,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
 | 
			
		||||
@@ -1386,9 +1395,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
 | 
			
		||||
   attribute_mask |= CWBorderPixel;
 | 
			
		||||
   swa.border_pixel = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -242,7 +263,7 @@ index 816faa3..4c2d702 100644
 | 
			
		||||
                            bounds_in_pixels_.y(), bounds_in_pixels_.width(),
 | 
			
		||||
                            bounds_in_pixels_.height(),
 | 
			
		||||
                            0,  // border width
 | 
			
		||||
@@ -2022,6 +2037,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
 | 
			
		||||
@@ -2019,6 +2034,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
 | 
			
		||||
       }
 | 
			
		||||
       break;
 | 
			
		||||
     }
 | 
			
		||||
@@ -254,10 +275,10 @@ index 816faa3..4c2d702 100644
 | 
			
		||||
     case FocusOut:
 | 
			
		||||
       OnFocusEvent(xev->type == FocusIn, event->xfocus.mode,
 | 
			
		||||
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
 | 
			
		||||
index a4b68b3..bb82659 100644
 | 
			
		||||
index cc2339f..949ea23 100644
 | 
			
		||||
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
 | 
			
		||||
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
 | 
			
		||||
@@ -91,6 +91,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
@@ -90,6 +90,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
   // there is no dialog on the host window.
 | 
			
		||||
   XID GetModalDialog();
 | 
			
		||||
 
 | 
			
		||||
@@ -270,7 +291,7 @@ index a4b68b3..bb82659 100644
 | 
			
		||||
  protected:
 | 
			
		||||
   // Overridden from DesktopWindowTreeHost:
 | 
			
		||||
   void Init(aura::Window* content_window,
 | 
			
		||||
@@ -301,6 +307,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
@@ -298,6 +304,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
   // The bounds of |xwindow_|.
 | 
			
		||||
   gfx::Rect bounds_in_pixels_;
 | 
			
		||||
 
 | 
			
		||||
@@ -280,7 +301,7 @@ index a4b68b3..bb82659 100644
 | 
			
		||||
   // 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_in_pixels_|. Window managers tend to send a Configure
 | 
			
		||||
@@ -340,6 +349,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
@@ -337,6 +346,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
   // Whether we used an ARGB visual for our window.
 | 
			
		||||
   bool use_argb_visual_;
 | 
			
		||||
 
 | 
			
		||||
@@ -291,7 +312,7 @@ index a4b68b3..bb82659 100644
 | 
			
		||||
   DesktopDragDropClientAuraX11* drag_drop_client_;
 | 
			
		||||
 
 | 
			
		||||
   std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_;
 | 
			
		||||
@@ -427,6 +440,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
@@ -424,6 +437,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
 | 
			
		||||
 
 | 
			
		||||
   XID modal_dialog_xid_;
 | 
			
		||||
 
 | 
			
		||||
@@ -302,7 +323,7 @@ index a4b68b3..bb82659 100644
 | 
			
		||||
   base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_;
 | 
			
		||||
 
 | 
			
		||||
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
 | 
			
		||||
index 68e6acd..07eb1fc 100644
 | 
			
		||||
index 4c21064..2ff6833 100644
 | 
			
		||||
--- ui/views/widget/widget.cc
 | 
			
		||||
+++ ui/views/widget/widget.cc
 | 
			
		||||
@@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type)
 | 
			
		||||
@@ -350,10 +371,10 @@ index 68e6acd..07eb1fc 100644
 | 
			
		||||
   // 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 ui/views/widget/widget.h ui/views/widget/widget.h
 | 
			
		||||
index 1e62c09..551518e 100644
 | 
			
		||||
index 0c7ab33..a958c3a 100644
 | 
			
		||||
--- ui/views/widget/widget.h
 | 
			
		||||
+++ ui/views/widget/widget.h
 | 
			
		||||
@@ -234,12 +234,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
@@ -233,12 +233,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
     // rendered, and that the client area should be equivalent to the window
 | 
			
		||||
     // area. Only used on some platforms (Windows and Linux).
 | 
			
		||||
     bool remove_standard_frame;
 | 
			
		||||
@@ -371,7 +392,7 @@ index 1e62c09..551518e 100644
 | 
			
		||||
     // Used only by mus and is necessitated by mus not being a NativeView.
 | 
			
		||||
     ui::Window* parent_mus = nullptr;
 | 
			
		||||
     // Specifies the initial bounds of the Widget. Default is empty, which means
 | 
			
		||||
@@ -753,6 +758,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
@@ -752,6 +757,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
   bool movement_disabled() const { return movement_disabled_; }
 | 
			
		||||
   void set_movement_disabled(bool disabled) { movement_disabled_ = disabled; }
 | 
			
		||||
 
 | 
			
		||||
@@ -382,7 +403,7 @@ index 1e62c09..551518e 100644
 | 
			
		||||
   // Returns the work area bounds of the screen the Widget belongs to.
 | 
			
		||||
   gfx::Rect GetWorkAreaBoundsInScreen() const;
 | 
			
		||||
 
 | 
			
		||||
@@ -971,6 +980,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
@@ -970,6 +979,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
 | 
			
		||||
   // disabled.
 | 
			
		||||
   bool movement_disabled_;
 | 
			
		||||
 
 | 
			
		||||
@@ -410,7 +431,7 @@ index b843416..8b81a51 100644
 | 
			
		||||
     }
 | 
			
		||||
     case Widget::InitParams::TYPE_CONTROL:
 | 
			
		||||
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
 | 
			
		||||
index 020d0a1..4a613f7 100644
 | 
			
		||||
index 6f80d3e..158a43a 100644
 | 
			
		||||
--- ui/views/win/hwnd_message_handler.cc
 | 
			
		||||
+++ ui/views/win/hwnd_message_handler.cc
 | 
			
		||||
@@ -850,6 +850,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
 | 
			
		||||
@@ -422,7 +443,7 @@ index 020d0a1..4a613f7 100644
 | 
			
		||||
   SetWindowLong(hwnd(), GWL_STYLE, style);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -2472,8 +2474,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
 | 
			
		||||
@@ -2508,8 +2510,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
 | 
			
		||||
     active_mouse_tracking_flags_ = 0;
 | 
			
		||||
   } else if (event.type() == ui::ET_MOUSEWHEEL) {
 | 
			
		||||
     // Reroute the mouse wheel to the window under the pointer if applicable.
 | 
			
		||||
@@ -438,10 +459,10 @@ index 020d0a1..4a613f7 100644
 | 
			
		||||
 
 | 
			
		||||
   // There are cases where the code handling the message destroys the window,
 | 
			
		||||
diff --git ui/views/win/hwnd_message_handler_delegate.h ui/views/win/hwnd_message_handler_delegate.h
 | 
			
		||||
index 14021805..c4843c8 100644
 | 
			
		||||
index f5328c4..0ee7915 100644
 | 
			
		||||
--- ui/views/win/hwnd_message_handler_delegate.h
 | 
			
		||||
+++ ui/views/win/hwnd_message_handler_delegate.h
 | 
			
		||||
@@ -59,6 +59,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
 | 
			
		||||
@@ -56,6 +56,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
 | 
			
		||||
   virtual bool CanMinimize() const = 0;
 | 
			
		||||
   virtual bool CanActivate() const = 0;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -29,10 +29,10 @@ index e639319..5f75a9a 100644
 | 
			
		||||
   void EnterFullscreenModeForTab(content::WebContents* contents,
 | 
			
		||||
                                  const GURL& origin) final;
 | 
			
		||||
diff --git chrome/browser/prerender/prerender_contents.cc chrome/browser/prerender/prerender_contents.cc
 | 
			
		||||
index 4ded1cb..ce3306b 100644
 | 
			
		||||
index c3e60e0..93365f5c 100644
 | 
			
		||||
--- chrome/browser/prerender/prerender_contents.cc
 | 
			
		||||
+++ chrome/browser/prerender/prerender_contents.cc
 | 
			
		||||
@@ -141,7 +141,9 @@ class PrerenderContents::WebContentsDelegateImpl
 | 
			
		||||
@@ -139,7 +139,9 @@ class PrerenderContents::WebContentsDelegateImpl
 | 
			
		||||
       const std::string& frame_name,
 | 
			
		||||
       const GURL& target_url,
 | 
			
		||||
       const std::string& partition_id,
 | 
			
		||||
@@ -44,10 +44,10 @@ index 4ded1cb..ce3306b 100644
 | 
			
		||||
     // window.opener property, terminate prerendering.
 | 
			
		||||
     prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW);
 | 
			
		||||
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
 | 
			
		||||
index 869fbec..7ca4f52 100644
 | 
			
		||||
index bbb37ff..484eda3 100644
 | 
			
		||||
--- chrome/browser/ui/browser.cc
 | 
			
		||||
+++ chrome/browser/ui/browser.cc
 | 
			
		||||
@@ -1588,7 +1588,9 @@ bool Browser::ShouldCreateWebContents(
 | 
			
		||||
@@ -1589,7 +1589,9 @@ bool Browser::ShouldCreateWebContents(
 | 
			
		||||
     const std::string& frame_name,
 | 
			
		||||
     const GURL& target_url,
 | 
			
		||||
     const std::string& partition_id,
 | 
			
		||||
@@ -59,7 +59,7 @@ index 869fbec..7ca4f52 100644
 | 
			
		||||
     // If a BackgroundContents is created, suppress the normal WebContents.
 | 
			
		||||
     return !MaybeCreateBackgroundContents(
 | 
			
		||||
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
 | 
			
		||||
index 5410f5a..a6aaef1 100644
 | 
			
		||||
index 6cdff54..0efcaa2 100644
 | 
			
		||||
--- chrome/browser/ui/browser.h
 | 
			
		||||
+++ chrome/browser/ui/browser.h
 | 
			
		||||
@@ -619,7 +619,9 @@ class Browser : public TabStripModelObserver,
 | 
			
		||||
@@ -74,10 +74,10 @@ index 5410f5a..a6aaef1 100644
 | 
			
		||||
                           int opener_render_process_id,
 | 
			
		||||
                           int opener_render_frame_id,
 | 
			
		||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
 | 
			
		||||
index d7a0cbb..7883136 100644
 | 
			
		||||
index 8850f6a..1a3719e 100644
 | 
			
		||||
--- content/browser/web_contents/web_contents_impl.cc
 | 
			
		||||
+++ content/browser/web_contents/web_contents_impl.cc
 | 
			
		||||
@@ -1577,6 +1577,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
 | 
			
		||||
@@ -1572,6 +1572,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
 | 
			
		||||
   std::string unique_name;
 | 
			
		||||
   frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
 | 
			
		||||
 
 | 
			
		||||
@@ -90,7 +90,7 @@ index d7a0cbb..7883136 100644
 | 
			
		||||
   WebContentsViewDelegate* delegate =
 | 
			
		||||
       GetContentClient()->browser()->GetWebContentsViewDelegate(this);
 | 
			
		||||
 
 | 
			
		||||
@@ -1607,6 +1613,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
 | 
			
		||||
@@ -1602,6 +1608,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
 | 
			
		||||
                                          std::move(view_),
 | 
			
		||||
                                          &render_view_host_delegate_view_));
 | 
			
		||||
   }
 | 
			
		||||
@@ -98,7 +98,7 @@ index d7a0cbb..7883136 100644
 | 
			
		||||
   CHECK(render_view_host_delegate_view_);
 | 
			
		||||
   CHECK(view_.get());
 | 
			
		||||
 
 | 
			
		||||
@@ -2060,11 +2067,14 @@ void WebContentsImpl::CreateNewWindow(
 | 
			
		||||
@@ -2063,11 +2070,14 @@ void WebContentsImpl::CreateNewWindow(
 | 
			
		||||
       static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
 | 
			
		||||
   CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,7 @@ index d7a0cbb..7883136 100644
 | 
			
		||||
     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
 | 
			
		||||
@@ -2088,6 +2098,8 @@ void WebContentsImpl::CreateNewWindow(
 | 
			
		||||
@@ -2096,6 +2106,8 @@ void WebContentsImpl::CreateNewWindow(
 | 
			
		||||
   create_params.opener_render_process_id = render_process_id;
 | 
			
		||||
   create_params.opener_render_frame_id = params.opener_render_frame_id;
 | 
			
		||||
   create_params.opener_suppressed = params.opener_suppressed;
 | 
			
		||||
@@ -139,21 +139,22 @@ index fa0afb5..d677b31 100644
 | 
			
		||||
 
 | 
			
		||||
 WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
 | 
			
		||||
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
 | 
			
		||||
index 8c66b2a..ed523c7 100644
 | 
			
		||||
index af944f7..cde1d7b 100644
 | 
			
		||||
--- content/public/browser/web_contents.h
 | 
			
		||||
+++ content/public/browser/web_contents.h
 | 
			
		||||
@@ -59,8 +59,10 @@ class PageState;
 | 
			
		||||
@@ -59,9 +59,11 @@ class PageState;
 | 
			
		||||
 class RenderFrameHost;
 | 
			
		||||
 class RenderProcessHost;
 | 
			
		||||
 class RenderViewHost;
 | 
			
		||||
+class RenderViewHostDelegateView;
 | 
			
		||||
 class RenderWidgetHost;
 | 
			
		||||
 class RenderWidgetHostView;
 | 
			
		||||
 class WebContentsDelegate;
 | 
			
		||||
+class WebContentsView;
 | 
			
		||||
 struct CustomContextMenuContext;
 | 
			
		||||
 struct DropData;
 | 
			
		||||
 struct Manifest;
 | 
			
		||||
@@ -161,6 +163,10 @@ class WebContents : public PageNavigator,
 | 
			
		||||
@@ -162,6 +164,10 @@ class WebContents : public PageNavigator,
 | 
			
		||||
     // Note that the pre-created renderer process may not be used if the first
 | 
			
		||||
     // navigation requires a dedicated or privileged process, such as a WebUI.
 | 
			
		||||
     bool initialize_renderer;
 | 
			
		||||
@@ -165,10 +166,10 @@ index 8c66b2a..ed523c7 100644
 | 
			
		||||
 
 | 
			
		||||
   // Creates a new WebContents.
 | 
			
		||||
diff --git content/public/browser/web_contents_delegate.cc content/public/browser/web_contents_delegate.cc
 | 
			
		||||
index d107135..2d290e1 100644
 | 
			
		||||
index b86ec61..2d1ddb2 100644
 | 
			
		||||
--- content/public/browser/web_contents_delegate.cc
 | 
			
		||||
+++ content/public/browser/web_contents_delegate.cc
 | 
			
		||||
@@ -148,7 +148,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
 | 
			
		||||
@@ -144,7 +144,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
 | 
			
		||||
     const std::string& frame_name,
 | 
			
		||||
     const GURL& target_url,
 | 
			
		||||
     const std::string& partition_id,
 | 
			
		||||
@@ -180,13 +181,13 @@ index d107135..2d290e1 100644
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
 | 
			
		||||
index 62ef1de..824b0e1 100644
 | 
			
		||||
index 2beb83c..b02f4f1 100644
 | 
			
		||||
--- content/public/browser/web_contents_delegate.h
 | 
			
		||||
+++ content/public/browser/web_contents_delegate.h
 | 
			
		||||
@@ -45,9 +45,11 @@ class JavaScriptDialogManager;
 | 
			
		||||
@@ -42,9 +42,11 @@ class ColorChooser;
 | 
			
		||||
 class JavaScriptDialogManager;
 | 
			
		||||
 class PageState;
 | 
			
		||||
 class RenderFrameHost;
 | 
			
		||||
 class RenderViewHost;
 | 
			
		||||
+class RenderViewHostDelegateView;
 | 
			
		||||
 class SessionStorageNamespace;
 | 
			
		||||
 class WebContents;
 | 
			
		||||
@@ -195,7 +196,7 @@ index 62ef1de..824b0e1 100644
 | 
			
		||||
 struct ColorSuggestion;
 | 
			
		||||
 struct ContextMenuParams;
 | 
			
		||||
 struct DropData;
 | 
			
		||||
@@ -314,7 +316,9 @@ class CONTENT_EXPORT WebContentsDelegate {
 | 
			
		||||
@@ -303,7 +305,9 @@ class CONTENT_EXPORT WebContentsDelegate {
 | 
			
		||||
       const std::string& frame_name,
 | 
			
		||||
       const GURL& target_url,
 | 
			
		||||
       const std::string& partition_id,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
 | 
			
		||||
index f1a79c4..021a083 100644
 | 
			
		||||
index 1c0863b..a0f06f4 100644
 | 
			
		||||
--- Source/web/ChromeClientImpl.cpp
 | 
			
		||||
+++ Source/web/ChromeClientImpl.cpp
 | 
			
		||||
@@ -892,7 +892,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
 | 
			
		||||
@@ -893,7 +893,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
 | 
			
		||||
 PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame,
 | 
			
		||||
                                            HTMLSelectElement& select) {
 | 
			
		||||
   notifyPopupOpeningObservers();
 | 
			
		||||
@@ -12,10 +12,10 @@ index f1a79c4..021a083 100644
 | 
			
		||||
 
 | 
			
		||||
   DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
 | 
			
		||||
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
 | 
			
		||||
index 966246f..a528578 100644
 | 
			
		||||
index 8e1ca8b..83589b6 100644
 | 
			
		||||
--- Source/web/WebViewImpl.cpp
 | 
			
		||||
+++ Source/web/WebViewImpl.cpp
 | 
			
		||||
@@ -405,6 +405,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
 | 
			
		||||
@@ -379,6 +379,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
 | 
			
		||||
       m_enableFakePageScaleAnimationForTesting(false),
 | 
			
		||||
       m_fakePageScaleAnimationPageScaleFactor(0),
 | 
			
		||||
       m_fakePageScaleAnimationUseAnchor(false),
 | 
			
		||||
@@ -23,7 +23,7 @@ index 966246f..a528578 100644
 | 
			
		||||
       m_doingDragAndDrop(false),
 | 
			
		||||
       m_ignoreInputEvents(false),
 | 
			
		||||
       m_compositorDeviceScaleFactorOverride(0),
 | 
			
		||||
@@ -4249,8 +4250,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
 | 
			
		||||
@@ -3727,8 +3728,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
 | 
			
		||||
   m_devToolsEmulator->mainFrameScrollOrScaleChanged();
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -37,12 +37,12 @@ index 966246f..a528578 100644
 | 
			
		||||
+  return m_shouldUseExternalPopupMenus;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 void WebViewImpl::startDragging(LocalFrame* frame,
 | 
			
		||||
 void WebViewImpl::setIgnoreInputEvents(bool newValue) {
 | 
			
		||||
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
 | 
			
		||||
index 8e74ed5..6a37808 100644
 | 
			
		||||
index d002c0d..74cbb22 100644
 | 
			
		||||
--- Source/web/WebViewImpl.h
 | 
			
		||||
+++ Source/web/WebViewImpl.h
 | 
			
		||||
@@ -380,7 +380,8 @@ class WEB_EXPORT WebViewImpl final
 | 
			
		||||
@@ -375,7 +375,8 @@ class WEB_EXPORT WebViewImpl final
 | 
			
		||||
 
 | 
			
		||||
   // Returns true if popup menus should be rendered by the browser, false if
 | 
			
		||||
   // they should be rendered by WebKit (which is the default).
 | 
			
		||||
@@ -52,20 +52,20 @@ index 8e74ed5..6a37808 100644
 | 
			
		||||
 
 | 
			
		||||
   bool shouldAutoResize() const { return m_shouldAutoResize; }
 | 
			
		||||
 
 | 
			
		||||
@@ -685,6 +686,8 @@ class WEB_EXPORT WebViewImpl final
 | 
			
		||||
@@ -654,6 +655,8 @@ class WEB_EXPORT WebViewImpl final
 | 
			
		||||
   float m_fakePageScaleAnimationPageScaleFactor;
 | 
			
		||||
   bool m_fakePageScaleAnimationUseAnchor;
 | 
			
		||||
 
 | 
			
		||||
+  bool m_shouldUseExternalPopupMenus;
 | 
			
		||||
+
 | 
			
		||||
   // TODO(paulmeyer): Move this to WebWidget once all drag-and-drop functions
 | 
			
		||||
   // are there.
 | 
			
		||||
   bool m_doingDragAndDrop;
 | 
			
		||||
 
 | 
			
		||||
   bool m_ignoreInputEvents;
 | 
			
		||||
diff --git public/web/WebView.h public/web/WebView.h
 | 
			
		||||
index fde211e..fea968a 100644
 | 
			
		||||
index 3127234..e79f0d2 100644
 | 
			
		||||
--- public/web/WebView.h
 | 
			
		||||
+++ public/web/WebView.h
 | 
			
		||||
@@ -443,6 +443,7 @@ class WebView : protected WebWidget {
 | 
			
		||||
@@ -408,6 +408,7 @@ class WebView : protected WebWidget {
 | 
			
		||||
 
 | 
			
		||||
   // Sets whether select popup menus should be rendered by the browser.
 | 
			
		||||
   BLINK_EXPORT static void setUseExternalPopupMenus(bool);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc
 | 
			
		||||
index 92fa2f1..cc3f54a 100644
 | 
			
		||||
index 1e821dc..76bc9e7 100644
 | 
			
		||||
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc
 | 
			
		||||
+++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc
 | 
			
		||||
@@ -689,9 +689,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady(
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
 | 
			
		||||
index dbd83a1..acf844e 100644
 | 
			
		||||
index 351ceb7..304c765 100644
 | 
			
		||||
--- chrome/app/generated_resources.grd
 | 
			
		||||
+++ chrome/app/generated_resources.grd
 | 
			
		||||
@@ -7082,7 +7082,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
 | 
			
		||||
@@ -7199,7 +7199,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
 | 
			
		||||
         </message>
 | 
			
		||||
       </if>
 | 
			
		||||
       <message name="IDS_PLUGIN_BLOCKED_BY_POLICY" desc="The placeholder text for a plugin blocked by enterprise policy.">
 | 
			
		||||
@@ -12,7 +12,7 @@ index dbd83a1..acf844e 100644
 | 
			
		||||
       <if expr="chromeos">
 | 
			
		||||
         <message name="IDS_NACL_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plugin.">
 | 
			
		||||
diff --git components/plugins/renderer/loadable_plugin_placeholder.cc components/plugins/renderer/loadable_plugin_placeholder.cc
 | 
			
		||||
index 9bc0478..d0263d3 100644
 | 
			
		||||
index 1f38fdb..03e0f60 100644
 | 
			
		||||
--- components/plugins/renderer/loadable_plugin_placeholder.cc
 | 
			
		||||
+++ components/plugins/renderer/loadable_plugin_placeholder.cc
 | 
			
		||||
@@ -127,11 +127,10 @@ void LoadablePluginPlaceholder::ReplacePlugin(blink::WebPlugin* new_plugin) {
 | 
			
		||||
@@ -30,13 +30,13 @@ index 9bc0478..d0263d3 100644
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
diff --git components/plugins/renderer/webview_plugin.cc components/plugins/renderer/webview_plugin.cc
 | 
			
		||||
index af1d919..0429d59 100644
 | 
			
		||||
index 8d45c42..2a2ec9a 100644
 | 
			
		||||
--- components/plugins/renderer/webview_plugin.cc
 | 
			
		||||
+++ components/plugins/renderer/webview_plugin.cc
 | 
			
		||||
@@ -17,7 +17,9 @@
 | 
			
		||||
 #include "content/public/renderer/render_view.h"
 | 
			
		||||
@@ -18,7 +18,9 @@
 | 
			
		||||
 #include "gin/converter.h"
 | 
			
		||||
 #include "skia/ext/platform_canvas.h"
 | 
			
		||||
 #include "third_party/WebKit/public/platform/WebInputEvent.h"
 | 
			
		||||
+#include "third_party/WebKit/public/platform/WebSize.h"
 | 
			
		||||
 #include "third_party/WebKit/public/platform/WebURL.h"
 | 
			
		||||
+#include "third_party/WebKit/public/platform/WebURLRequest.h"
 | 
			
		||||
@@ -87,15 +87,15 @@ index af1d919..0429d59 100644
 | 
			
		||||
+    for (std::list<std::string>::iterator it = data_.begin(); it != data_.end();
 | 
			
		||||
+         ++it) {
 | 
			
		||||
+      plugin->didReceiveData(
 | 
			
		||||
+          it->c_str(), base::checked_cast<int, size_t>(it->length()));
 | 
			
		||||
+          it->c_str(), base::checked_cast<int>(it->length()));
 | 
			
		||||
+      total_bytes += it->length();
 | 
			
		||||
+    }
 | 
			
		||||
+    UMA_HISTOGRAM_MEMORY_KB(
 | 
			
		||||
+        "PluginDocument.Memory",
 | 
			
		||||
+        (base::checked_cast<int, size_t>(total_bytes / 1024)));
 | 
			
		||||
+        (base::checked_cast<int>(total_bytes / 1024)));
 | 
			
		||||
+    UMA_HISTOGRAM_COUNTS(
 | 
			
		||||
+        "PluginDocument.NumChunks",
 | 
			
		||||
+        (base::checked_cast<int, size_t>(data_.size())));
 | 
			
		||||
+        (base::checked_cast<int>(data_.size())));
 | 
			
		||||
+  }
 | 
			
		||||
+  // We need to transfer the |focused_| to new plugin after it loaded.
 | 
			
		||||
+  if (focused_) {
 | 
			
		||||
@@ -143,7 +143,7 @@ index af1d919..0429d59 100644
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 bool WebViewPlugin::acceptsLoadDrops() { return false; }
 | 
			
		||||
@@ -277,9 +315,8 @@ void WebViewPlugin::scheduleAnimation() {
 | 
			
		||||
@@ -279,9 +317,8 @@ void WebViewPlugin::scheduleAnimation() {
 | 
			
		||||
   }
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -155,7 +155,7 @@ index af1d919..0429d59 100644
 | 
			
		||||
     return;
 | 
			
		||||
 
 | 
			
		||||
   v8::Isolate* isolate = blink::mainThreadIsolate();
 | 
			
		||||
@@ -291,7 +328,7 @@ void WebViewPlugin::PluginWebFrameClient::didClearWindowObject(
 | 
			
		||||
@@ -293,7 +330,7 @@ void WebViewPlugin::PluginWebFrameClient::didClearWindowObject(
 | 
			
		||||
   v8::Local<v8::Object> global = context->Global();
 | 
			
		||||
 
 | 
			
		||||
   global->Set(gin::StringToV8(isolate, "plugin"),
 | 
			
		||||
@@ -165,7 +165,7 @@ index af1d919..0429d59 100644
 | 
			
		||||
 
 | 
			
		||||
 void WebViewPlugin::OnDestruct() {}
 | 
			
		||||
diff --git components/plugins/renderer/webview_plugin.h components/plugins/renderer/webview_plugin.h
 | 
			
		||||
index 086fa6d..6f69dec 100644
 | 
			
		||||
index fdb1cf9..97e3995 100644
 | 
			
		||||
--- components/plugins/renderer/webview_plugin.h
 | 
			
		||||
+++ components/plugins/renderer/webview_plugin.h
 | 
			
		||||
@@ -42,6 +42,7 @@ class Size;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user