OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_ | |
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "base/time/time.h" | |
12 #include "content/browser/renderer_host/resize_lock.h" | |
13 | |
14 namespace aura { | |
15 class WindowTreeHost; | |
16 } | |
17 namespace ui { | |
18 class CompositorLock; | |
19 } | |
20 | |
21 namespace content { | |
22 | |
23 // Used to prevent further resizes while a resize is pending. | |
24 class CompositorResizeLock : public ResizeLock { | |
25 public: | |
26 CompositorResizeLock(aura::WindowTreeHost* host, | |
27 const gfx::Size new_size, | |
28 bool defer_compositor_lock, | |
29 const base::TimeDelta& timeout); | |
30 ~CompositorResizeLock() override; | |
31 | |
32 bool GrabDeferredLock() override; | |
33 void UnlockCompositor() override; | |
34 | |
35 protected: | |
36 void LockCompositor() override; | |
37 void CancelLock(); | |
38 | |
39 private: | |
40 aura::WindowTreeHost* host_; | |
41 scoped_refptr<ui::CompositorLock> compositor_lock_; | |
42 bool cancelled_; | |
43 | |
44 base::WeakPtrFactory<CompositorResizeLock> weak_ptr_factory_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(CompositorResizeLock); | |
47 }; | |
48 | |
49 } // namespace content | |
50 | |
51 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_ | |
OLD | NEW |