From a8f2115c89679dea905482d9c189c1df78cfd26f Mon Sep 17 00:00:00 2001 From: "vollick@chromium.org" Date: Thu, 8 Sep 2011 15:30:02 +0000 Subject: With this CL animated rotations can be triggered by visiting URLs like about:rotate?right. The about handler fires orientation events that the TouchBrowserFrameView is listening for. When notified, the TBFV either rotates itself, or the views desktop (if it is active). The animation code lives in views/animation and knows nothing about sensors. BUG=none TEST=none Review URL: http://codereview.chromium.org/7273073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100148 0039d316-1c4b-4281-b951-d872f2087c98 --- views/paint_lock.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 views/paint_lock.h (limited to 'views/paint_lock.h') diff --git a/views/paint_lock.h b/views/paint_lock.h new file mode 100644 index 0000000..7a6f9bb --- /dev/null +++ b/views/paint_lock.h @@ -0,0 +1,35 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef VIEWS_PAINT_LOCK_H_ +#define VIEWS_PAINT_LOCK_H_ +#pragma once + +#include "base/basictypes.h" + +namespace views { + +class View; + +// Instances of PaintLock can be created to disable painting of the view +// (compositing is not disabled). When the class is destroyed, painting is +// re-enabled. This can be useful during operations like animations, that are +// sensitive to costly paints, and during which only composting, not painting, +// is required. +class PaintLock { + public: + // The paint lock does not own the view. It is an error for the view to be + // destroyed before the lock. + PaintLock(View* view); + ~PaintLock(); + + private: + View* view_; + + DISALLOW_COPY_AND_ASSIGN(PaintLock); +}; + +} // namespace views + +#endif // VIEWS_PAINT_LOCK_H_ -- cgit v1.1