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/view.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'views/view.cc') diff --git a/views/view.cc b/views/view.cc index 22cdeb2..fff2386 100644 --- a/views/view.cc +++ b/views/view.cc @@ -6,6 +6,7 @@ #include +#include "base/debug/trace_event.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" @@ -104,6 +105,7 @@ View::View() parent_(NULL), visible_(true), enabled_(true), + painting_enabled_(true), registered_for_visible_bounds_notification_(false), clip_x_(0.0), clip_y_(0.0), @@ -680,7 +682,7 @@ void View::SchedulePaint() { } void View::SchedulePaintInRect(const gfx::Rect& rect) { - if (!IsVisible()) + if (!IsVisible() || !painting_enabled_) return; MarkLayerDirty(); @@ -688,7 +690,8 @@ void View::SchedulePaintInRect(const gfx::Rect& rect) { } void View::Paint(gfx::Canvas* canvas) { - if (!IsVisible()) + TRACE_EVENT0("View", "Paint"); + if (!IsVisible() || !painting_enabled_) return; ScopedCanvas scoped_canvas(NULL); @@ -1168,7 +1171,7 @@ void View::PaintComposite() { } void View::SchedulePaintInternal(const gfx::Rect& rect) { - if (parent_ && parent_->IsVisible()) { + if (parent_ && parent_->IsVisible() && painting_enabled_) { // Translate the requested paint rect to the parent's coordinate system // then pass this notification up to the parent. parent_->SchedulePaintInternal(ConvertRectToParent(rect)); -- cgit v1.1