Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / content / browser / renderer_host / compositor_resize_lock_aura.h
blob1c2be391053ee78cfd197e4f707a91b6d6ec92c7
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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_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/compositor/resize_lock.h"
13 namespace aura {
14 class WindowTreeHost;
16 namespace ui {
17 class CompositorLock;
20 namespace content {
22 // Used to prevent further resizes while a resize is pending.
23 class CompositorResizeLock : public ResizeLock {
24 public:
25 CompositorResizeLock(aura::WindowTreeHost* host,
26 const gfx::Size new_size,
27 bool defer_compositor_lock,
28 const base::TimeDelta& timeout);
29 virtual ~CompositorResizeLock();
31 virtual bool GrabDeferredLock() OVERRIDE;
32 virtual void UnlockCompositor() OVERRIDE;
34 protected:
35 virtual void LockCompositor() OVERRIDE;
36 void CancelLock();
38 private:
39 aura::WindowTreeHost* host_;
40 scoped_refptr<ui::CompositorLock> compositor_lock_;
41 base::WeakPtrFactory<CompositorResizeLock> weak_ptr_factory_;
42 bool cancelled_;
44 DISALLOW_COPY_AND_ASSIGN(CompositorResizeLock);
47 } // namespace content
49 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_