IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / aura / compositor_resize_lock.h
blob51787e49393089b8e7c968e53e36eaa83baa7174
1 // Copyright 2013 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.
5 #ifndef CONTENT_BROWSER_AURA_RESIZE_LOCK_AURA_H_
6 #define CONTENT_BROWSER_AURA_RESIZE_LOCK_AURA_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h"
11 #include "content/browser/aura/resize_lock.h"
13 namespace aura { class RootWindow; }
15 namespace ui { class CompositorLock; }
17 namespace content {
19 // Used to prevent further resizes while a resize is pending.
20 class CompositorResizeLock : public ResizeLock {
21 public:
22 CompositorResizeLock(aura::RootWindow* root_window,
23 const gfx::Size new_size,
24 bool defer_compositor_lock,
25 const base::TimeDelta& timeout);
26 virtual ~CompositorResizeLock();
28 virtual bool GrabDeferredLock() OVERRIDE;
29 virtual void UnlockCompositor() OVERRIDE;
31 protected:
32 virtual void LockCompositor() OVERRIDE;
33 void CancelLock();
35 private:
36 aura::RootWindow* root_window_;
37 scoped_refptr<ui::CompositorLock> compositor_lock_;
38 base::WeakPtrFactory<CompositorResizeLock> weak_ptr_factory_;
39 bool cancelled_;
41 DISALLOW_COPY_AND_ASSIGN(CompositorResizeLock);
44 } // namespace content
46 #endif // CONTENT_BROWSER_AURA_RESIZE_LOCK_AURA_H_