summaryrefslogtreecommitdiffstats
path: root/views/view.cc
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 15:30:02 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 15:30:02 +0000
commita8f2115c89679dea905482d9c189c1df78cfd26f (patch)
tree4d435c102ff2ef211c3a2ac7312fe29cfe3a2794 /views/view.cc
parentf714d7e35bc942e3704f9a9893834193a96e2219 (diff)
downloadchromium_src-a8f2115c89679dea905482d9c189c1df78cfd26f.zip
chromium_src-a8f2115c89679dea905482d9c189c1df78cfd26f.tar.gz
chromium_src-a8f2115c89679dea905482d9c189c1df78cfd26f.tar.bz2
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
Diffstat (limited to 'views/view.cc')
-rw-r--r--views/view.cc9
1 files changed, 6 insertions, 3 deletions
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 <algorithm>
+#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));