Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2773433003: Fix CompositorResizeLock to do something. (Closed)
Patch Set: resizelock: observer-rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 8941fb367f50bc70df1366ebc81ffc9abe478833..d4e1ce276ecd5bcd0822f7b8eb0eaf9368129b40 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -47,7 +47,6 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h"
-#include "content/browser/renderer_host/resize_lock.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/browser/web_contents/web_contents_view_aura.h"
#include "content/common/host_shared_bitmap_manager.h"
@@ -361,31 +360,23 @@ class FakeDelegatedFrameHostClientAura : public DelegatedFrameHostClientAura {
explicit FakeDelegatedFrameHostClientAura(
RenderWidgetHostViewAura* render_widget_host_view)
: DelegatedFrameHostClientAura(render_widget_host_view) {}
- ~FakeDelegatedFrameHostClientAura() override {}
+ ~FakeDelegatedFrameHostClientAura() override = default;
void DisableResizeLock() { can_create_resize_lock_ = false; }
private:
- // A lock that doesn't actually do anything to the compositor, and does not
- // time out.
- class FakeResizeLock : public ResizeLock {
- public:
- FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock)
- : ResizeLock(new_size, defer_compositor_lock) {}
- };
-
- // DelegatedFrameHostClientAura:
- std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
- bool defer_compositor_lock) override {
- gfx::Size desired_size =
- render_widget_host_view()->GetNativeView()->bounds().size();
- return std::unique_ptr<ResizeLock>(
- new FakeResizeLock(desired_size, defer_compositor_lock));
- }
+ // DelegatedFrameHostClientAura implementation.
bool DelegatedFrameCanCreateResizeLock() const override {
return can_create_resize_lock_;
}
+ // CompositorResizeLockClient implemention. Overrides from
+ // DelegatedFrameHostClientAura, to prevent the lock from timing out.
+ std::unique_ptr<ui::CompositorLock> GetCompositorLock(
+ ui::CompositorLockClient* client) override {
+ return base::MakeUnique<ui::CompositorLock>(nullptr, nullptr);
+ }
+
bool can_create_resize_lock_ = true;
DISALLOW_COPY_AND_ASSIGN(FakeDelegatedFrameHostClientAura);
@@ -398,9 +389,8 @@ class FakeRenderWidgetHostViewAura : public RenderWidgetHostViewAura {
: RenderWidgetHostViewAura(widget, is_guest_view_hack),
delegated_frame_host_client_(
new FakeDelegatedFrameHostClientAura(this)) {
- std::unique_ptr<DelegatedFrameHostClient> client(
- delegated_frame_host_client_);
- InstallDelegatedFrameHostClient(this, std::move(client));
+ InstallDelegatedFrameHostClient(
+ this, base::WrapUnique(delegated_frame_host_client_));
}
~FakeRenderWidgetHostViewAura() override {}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | content/browser/renderer_host/resize_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698