Commit 1fa2a882 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: Remove features::IsViewsBrowserCocoa() and its last calls.

While here, also remove unused GetAllowOtherViews() / SetAllowOtherViews()
from WebContents and WebContentsView.

Bug: 832676
Change-Id: I18e6385b08599e12e0a8f2d85c06d429e92396c7
Reviewed-on: https://chromium-review.googlesource.com/1251323Reviewed-by: default avatarccameron <ccameron@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595253}
parent bd945756
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
namespace views_mode_controller { namespace views_mode_controller {
bool IsViewsBrowserCocoa() { bool IsViewsBrowserCocoa() {
return features::IsViewsBrowserCocoa(); // TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
return false;
} }
} // namespace views_mode_controller } // namespace views_mode_controller
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
namespace views_mode_controller { namespace views_mode_controller {
// Returns whether a Views-capable browser build should use the Cocoa browser // Returns whether a Views-capable browser build should use the Cocoa browser
// UI. // UI. Always returns false.
// TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
bool IsViewsBrowserCocoa(); bool IsViewsBrowserCocoa();
} // namespace views_mode_controller } // namespace views_mode_controller
......
...@@ -92,7 +92,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac ...@@ -92,7 +92,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// |delegate| should be set at most once. // |delegate| should be set at most once.
CONTENT_EXPORT void SetDelegate( CONTENT_EXPORT void SetDelegate(
NSObject<RenderWidgetHostViewMacDelegate>* delegate); NSObject<RenderWidgetHostViewMacDelegate>* delegate);
void SetAllowPauseForResizeOrRepaint(bool allow);
// RenderWidgetHostView implementation. // RenderWidgetHostView implementation.
void InitAsChild(gfx::NativeView parent_view) override; void InitAsChild(gfx::NativeView parent_view) override;
......
...@@ -217,13 +217,9 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, ...@@ -217,13 +217,9 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// startup raciness and decrease latency. // startup raciness and decrease latency.
needs_begin_frames_ = needs_begin_frames; needs_begin_frames_ = needs_begin_frames;
UpdateNeedsBeginFramesInternal(); UpdateNeedsBeginFramesInternal();
if (features::IsViewsBrowserCocoa())
ui::CATransactionCoordinator::Get().AddPreCommitObserver(this);
} }
RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
if (features::IsViewsBrowserCocoa())
ui::CATransactionCoordinator::Get().RemovePreCommitObserver(this);
if (popup_parent_host_view_) { if (popup_parent_host_view_) {
DCHECK(!popup_parent_host_view_->popup_child_host_view_ || DCHECK(!popup_parent_host_view_->popup_child_host_view_ ||
popup_parent_host_view_->popup_child_host_view_ == this); popup_parent_host_view_->popup_child_host_view_ == this);
...@@ -308,11 +304,6 @@ void RenderWidgetHostViewMac::SetDelegate( ...@@ -308,11 +304,6 @@ void RenderWidgetHostViewMac::SetDelegate(
[cocoa_view() setResponderDelegate:delegate]; [cocoa_view() setResponderDelegate:delegate];
} }
void RenderWidgetHostViewMac::SetAllowPauseForResizeOrRepaint(bool allow) {
// TODO: Remove SetAllowPauseForResizeOrRepaint and SetAllowOtherViews, since
// they aren't used anymore.
}
ui::TextInputType RenderWidgetHostViewMac::GetTextInputType() { ui::TextInputType RenderWidgetHostViewMac::GetTextInputType() {
if (!GetActiveWidget()) if (!GetActiveWidget())
return ui::TEXT_INPUT_TYPE_NONE; return ui::TEXT_INPUT_TYPE_NONE;
...@@ -409,9 +400,6 @@ void RenderWidgetHostViewMac::UpdateNSViewAndDisplayProperties() { ...@@ -409,9 +400,6 @@ void RenderWidgetHostViewMac::UpdateNSViewAndDisplayProperties() {
LOG(ERROR) << "Failed to create display link."; LOG(ERROR) << "Failed to create display link.";
} }
if (features::IsViewsBrowserCocoa())
ui::CATransactionCoordinator::Get().Synchronize();
// During auto-resize it is the responsibility of the caller to ensure that // During auto-resize it is the responsibility of the caller to ensure that
// the NSView and RenderWidgetHostImpl are kept in sync. // the NSView and RenderWidgetHostImpl are kept in sync.
if (host()->auto_resize_enabled()) if (host()->auto_resize_enabled())
......
...@@ -6229,16 +6229,6 @@ service_manager::InterfaceProvider* WebContentsImpl::GetJavaInterfaces() { ...@@ -6229,16 +6229,6 @@ service_manager::InterfaceProvider* WebContentsImpl::GetJavaInterfaces() {
return java_interfaces_.get(); return java_interfaces_.get();
} }
#elif defined(OS_MACOSX)
void WebContentsImpl::SetAllowOtherViews(bool allow) {
view_->SetAllowOtherViews(allow);
}
bool WebContentsImpl::GetAllowOtherViews() {
return view_->GetAllowOtherViews();
}
#endif #endif
bool WebContentsImpl::CompletedFirstVisuallyNonEmptyPaint() const { bool WebContentsImpl::CompletedFirstVisuallyNonEmptyPaint() const {
......
...@@ -464,9 +464,6 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, ...@@ -464,9 +464,6 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void ActivateNearestFindResult(float x, float y) override; void ActivateNearestFindResult(float x, float y) override;
void RequestFindMatchRects(int current_version) override; void RequestFindMatchRects(int current_version) override;
service_manager::InterfaceProvider* GetJavaInterfaces() override; service_manager::InterfaceProvider* GetJavaInterfaces() override;
#elif defined(OS_MACOSX)
void SetAllowOtherViews(bool allow) override;
bool GetAllowOtherViews() override;
#endif #endif
bool HasRecentInteractiveInputEvent() const override; bool HasRecentInteractiveInputEvent() const override;
......
...@@ -123,13 +123,6 @@ class WebContentsView { ...@@ -123,13 +123,6 @@ class WebContentsView {
virtual void SetOverscrollControllerEnabled(bool enabled) = 0; virtual void SetOverscrollControllerEnabled(bool enabled) = 0;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Allowing other views disables optimizations which assume that only a single
// WebContents is present.
virtual void SetAllowOtherViews(bool allow) = 0;
// Returns true if other views are allowed, false otherwise.
virtual bool GetAllowOtherViews() const = 0;
// If we close the tab while a UI control is in an event-tracking // If we close the tab while a UI control is in an event-tracking
// loop, the control may message freed objects and crash. // loop, the control may message freed objects and crash.
// WebContents::Close() calls IsEventTracking(), and if it returns // WebContents::Close() calls IsEventTracking(), and if it returns
......
...@@ -117,15 +117,6 @@ bool WebContentsViewChildFrame::IsEventTracking() const { ...@@ -117,15 +117,6 @@ bool WebContentsViewChildFrame::IsEventTracking() const {
void WebContentsViewChildFrame::CloseTabAfterEventTracking() { void WebContentsViewChildFrame::CloseTabAfterEventTracking() {
NOTREACHED(); NOTREACHED();
} }
void WebContentsViewChildFrame::SetAllowOtherViews(bool allow) {
NOTREACHED();
}
bool WebContentsViewChildFrame::GetAllowOtherViews() const {
NOTREACHED();
return false;
}
#endif #endif
void WebContentsViewChildFrame::RestoreFocus() { void WebContentsViewChildFrame::RestoreFocus() {
......
...@@ -50,8 +50,6 @@ class WebContentsViewChildFrame : public WebContentsView, ...@@ -50,8 +50,6 @@ class WebContentsViewChildFrame : public WebContentsView,
RenderViewHost* new_host) override; RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override; void SetOverscrollControllerEnabled(bool enabled) override;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
void SetAllowOtherViews(bool allow) override;
bool GetAllowOtherViews() const override;
bool IsEventTracking() const override; bool IsEventTracking() const override;
void CloseTabAfterEventTracking() override; void CloseTabAfterEventTracking() override;
#endif #endif
......
...@@ -117,16 +117,6 @@ gfx::Rect WebContentsViewGuest::GetViewBounds() const { ...@@ -117,16 +117,6 @@ gfx::Rect WebContentsViewGuest::GetViewBounds() const {
return gfx::Rect(size_); return gfx::Rect(size_);
} }
#if defined(OS_MACOSX)
void WebContentsViewGuest::SetAllowOtherViews(bool allow) {
platform_view_->SetAllowOtherViews(allow);
}
bool WebContentsViewGuest::GetAllowOtherViews() const {
return platform_view_->GetAllowOtherViews();
}
#endif
void WebContentsViewGuest::CreateView(const gfx::Size& initial_size, void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
gfx::NativeView context) { gfx::NativeView context) {
platform_view_->CreateView(initial_size, context); platform_view_->CreateView(initial_size, context);
......
...@@ -68,8 +68,6 @@ class WebContentsViewGuest : public WebContentsView, ...@@ -68,8 +68,6 @@ class WebContentsViewGuest : public WebContentsView,
RenderViewHost* new_host) override; RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override; void SetOverscrollControllerEnabled(bool enabled) override;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
void SetAllowOtherViews(bool allow) override;
bool GetAllowOtherViews() const override;
bool IsEventTracking() const override; bool IsEventTracking() const override;
void CloseTabAfterEventTracking() override; void CloseTabAfterEventTracking() override;
#endif #endif
......
...@@ -91,8 +91,6 @@ class WebContentsViewMac : public WebContentsView, ...@@ -91,8 +91,6 @@ class WebContentsViewMac : public WebContentsView,
void FocusThroughTabTraversal(bool reverse) override; void FocusThroughTabTraversal(bool reverse) override;
DropData* GetDropData() const override; DropData* GetDropData() const override;
gfx::Rect GetViewBounds() const override; gfx::Rect GetViewBounds() const override;
void SetAllowOtherViews(bool allow) override;
bool GetAllowOtherViews() const override;
void CreateView(const gfx::Size& initial_size, void CreateView(const gfx::Size& initial_size,
gfx::NativeView context) override; gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget( RenderWidgetHostViewBase* CreateViewForWidget(
...@@ -165,9 +163,6 @@ class WebContentsViewMac : public WebContentsView, ...@@ -165,9 +163,6 @@ class WebContentsViewMac : public WebContentsView,
// Our optional delegate. // Our optional delegate.
std::unique_ptr<WebContentsViewDelegate> delegate_; std::unique_ptr<WebContentsViewDelegate> delegate_;
// Whether to allow other views.
bool allow_other_views_;
// This contains all RenderWidgetHostViewMacs that have been added as child // This contains all RenderWidgetHostViewMacs that have been added as child
// NSViews to this NSView. Note that this list may contain RWHVMacs besides // NSViews to this NSView. Note that this list may contain RWHVMacs besides
// just |web_contents_->GetRenderWidgetHostView()|. The only time that the // just |web_contents_->GetRenderWidgetHostView()|. The only time that the
......
...@@ -105,10 +105,7 @@ WebContentsView* CreateWebContentsView( ...@@ -105,10 +105,7 @@ WebContentsView* CreateWebContentsView(
WebContentsViewMac::WebContentsViewMac(WebContentsImpl* web_contents, WebContentsViewMac::WebContentsViewMac(WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate) WebContentsViewDelegate* delegate)
: web_contents_(web_contents), : web_contents_(web_contents), delegate_(delegate) {}
delegate_(delegate),
allow_other_views_(false) {
}
WebContentsViewMac::~WebContentsViewMac() { WebContentsViewMac::~WebContentsViewMac() {
// This handles the case where a renderer close call was deferred // This handles the case where a renderer close call was deferred
...@@ -322,21 +319,6 @@ gfx::Rect WebContentsViewMac::GetViewBounds() const { ...@@ -322,21 +319,6 @@ gfx::Rect WebContentsViewMac::GetViewBounds() const {
return gfx::ScreenRectFromNSRect(window_bounds); return gfx::ScreenRectFromNSRect(window_bounds);
} }
void WebContentsViewMac::SetAllowOtherViews(bool allow) {
if (allow_other_views_ == allow)
return;
allow_other_views_ = allow;
RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>(
web_contents_->GetRenderWidgetHostView());
if (view)
view->SetAllowPauseForResizeOrRepaint(!allow_other_views_);
}
bool WebContentsViewMac::GetAllowOtherViews() const {
return allow_other_views_;
}
void WebContentsViewMac::CreateView( void WebContentsViewMac::CreateView(
const gfx::Size& initial_size, gfx::NativeView context) { const gfx::Size& initial_size, gfx::NativeView context) {
WebContentsViewCocoa* view = WebContentsViewCocoa* view =
...@@ -369,7 +351,6 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( ...@@ -369,7 +351,6 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
view->SetDelegate(rw_delegate.get()); view->SetDelegate(rw_delegate.get());
} }
view->SetAllowPauseForResizeOrRepaint(!allow_other_views_);
// Add the RenderWidgetHostView to the ui::Layer heirarchy. // Add the RenderWidgetHostView to the ui::Layer heirarchy.
child_views_.push_back(view->GetWeakPtr()); child_views_.push_back(view->GetWeakPtr());
......
...@@ -912,13 +912,6 @@ class WebContents : public PageNavigator, ...@@ -912,13 +912,6 @@ class WebContents : public PageNavigator,
// scoped to this WebContents. This provides access to interfaces implemented // scoped to this WebContents. This provides access to interfaces implemented
// in Java in the browser process to C++ code in the browser process. // in Java in the browser process to C++ code in the browser process.
virtual service_manager::InterfaceProvider* GetJavaInterfaces() = 0; virtual service_manager::InterfaceProvider* GetJavaInterfaces() = 0;
#elif defined(OS_MACOSX)
// Allowing other views disables optimizations which assume that only a single
// WebContents is present.
virtual void SetAllowOtherViews(bool allow) = 0;
// Returns true if other views are allowed, false otherwise.
virtual bool GetAllowOtherViews() = 0;
#endif // OS_ANDROID #endif // OS_ANDROID
// Returns true if the WebContents has completed its first meaningful paint // Returns true if the WebContents has completed its first meaningful paint
......
...@@ -153,14 +153,6 @@ const base::Feature kHostWindowsInAppShimProcess{ ...@@ -153,14 +153,6 @@ const base::Feature kHostWindowsInAppShimProcess{
bool HostWindowsInAppShimProcess() { bool HostWindowsInAppShimProcess() {
return base::FeatureList::IsEnabled(kHostWindowsInAppShimProcess); return base::FeatureList::IsEnabled(kHostWindowsInAppShimProcess);
} }
#if BUILDFLAG(MAC_VIEWS_BROWSER)
bool IsViewsBrowserCocoa() {
// TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
return false;
}
#endif // BUILDFLAG(MAC_VIEWS_BROWSER)
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
const base::Feature kEnableOzoneDrmMojo = {"OzoneDrmMojo", const base::Feature kEnableOzoneDrmMojo = {"OzoneDrmMojo",
......
...@@ -73,14 +73,6 @@ UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess; ...@@ -73,14 +73,6 @@ UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess;
// Returns true if the NSWindows for apps will be created in the app's process, // Returns true if the NSWindows for apps will be created in the app's process,
// and will forward input to the browser process. // and will forward input to the browser process.
UI_BASE_EXPORT bool HostWindowsInAppShimProcess(); UI_BASE_EXPORT bool HostWindowsInAppShimProcess();
#if BUILDFLAG(MAC_VIEWS_BROWSER)
// Returns whether a Views-capable browser build should use the Cocoa browser
// UI. Always returns false.
// TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
UI_BASE_EXPORT bool IsViewsBrowserCocoa();
#endif // BUILDFLAG(MAC_VIEWS_BROWSER)
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
// Use mojo communication in the drm platform instead of paramtraits. Remove // Use mojo communication in the drm platform instead of paramtraits. Remove
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment