summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 22:37:38 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 22:37:38 +0000
commit2dd50820df6d5c39fbb3f1fc1f1b8a29c30b9d72 (patch)
treea7e06fb3fd773206ef652d3b12972b321f00f2f6 /chrome/views
parent2141858324fd45ece7d3e96c60145a71e493fbe0 (diff)
downloadchromium_src-2dd50820df6d5c39fbb3f1fc1f1b8a29c30b9d72.zip
chromium_src-2dd50820df6d5c39fbb3f1fc1f1b8a29c30b9d72.tar.gz
chromium_src-2dd50820df6d5c39fbb3f1fc1f1b8a29c30b9d72.tar.bz2
Minor cleanup of RootView. Removes unused double_buffered field from
RootView, as well as renaming RootView::ProcessPendingPaint to PaintNow. BUG=1255929 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/chrome_menu.cc2
-rw-r--r--chrome/views/hwnd_view_container.cc2
-rw-r--r--chrome/views/root_view.cc29
-rw-r--r--chrome/views/root_view.h12
4 files changed, 18 insertions, 27 deletions
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index a0c6abb..75736d9 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -550,7 +550,7 @@ class MenuHostRootView : public RootView {
public:
explicit MenuHostRootView(ViewContainer* container,
SubmenuView* submenu)
- : RootView(container, true),
+ : RootView(container),
submenu_(submenu),
forward_drag_to_menu_controller_(true),
suspend_events_(false) {
diff --git a/chrome/views/hwnd_view_container.cc b/chrome/views/hwnd_view_container.cc
index 12c0de4..a9649b5 100644
--- a/chrome/views/hwnd_view_container.cc
+++ b/chrome/views/hwnd_view_container.cc
@@ -818,7 +818,7 @@ void HWNDViewContainer::ChangeSize(UINT size_param, const CSize& size) {
}
RootView* HWNDViewContainer::CreateRootView() {
- return new RootView(this, true);
+ return new RootView(this);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/views/root_view.cc b/chrome/views/root_view.cc
index f0ad017..8145d16 100644
--- a/chrome/views/root_view.cc
+++ b/chrome/views/root_view.cc
@@ -63,7 +63,7 @@ class PaintTask : public Task {
void Run() {
if (root_view_)
- root_view_->ProcessPendingPaint();
+ root_view_->PaintNow();
}
private:
// The target root view.
@@ -80,9 +80,8 @@ const char RootView::kViewClassName[] = "chrome/views/RootView";
//
/////////////////////////////////////////////////////////////////////////////
-RootView::RootView(ViewContainer* view_container, bool double_buffer)
- : double_buffer_(double_buffer),
- view_container_(view_container),
+RootView::RootView(ViewContainer* view_container)
+ : view_container_(view_container),
invalid_rect_(0,0,0,0),
mouse_pressed_handler_(NULL),
mouse_move_handler_(NULL),
@@ -149,18 +148,6 @@ void RootView::SchedulePaint(int x, int y, int w, int h) {
View::SchedulePaint();
}
-void RootView::ProcessPendingPaint() {
- if (pending_paint_task_) {
- pending_paint_task_->Cancel();
- pending_paint_task_ = NULL;
- }
- if (!paint_task_needed_)
- return;
- ViewContainer* vc = GetViewContainer();
- if (vc)
- vc->PaintNow(invalid_rect_);
-}
-
#ifndef NDEBUG
// Sets the value of RootView's |is_processing_paint_| member to true as long
// as ProcessPaint is being called. Sets it to |false| when it returns.
@@ -214,7 +201,15 @@ void RootView::ProcessPaint(ChromeCanvas* canvas) {
}
void RootView::PaintNow() {
- GetViewContainer()->PaintNow(invalid_rect_);
+ if (pending_paint_task_) {
+ pending_paint_task_->Cancel();
+ pending_paint_task_ = NULL;
+ }
+ if (!paint_task_needed_)
+ return;
+ ViewContainer* vc = GetViewContainer();
+ if (vc)
+ vc->PaintNow(invalid_rect_);
}
bool RootView::NeedsPainting(bool urgent) {
diff --git a/chrome/views/root_view.h b/chrome/views/root_view.h
index 545f553..0937db0 100644
--- a/chrome/views/root_view.h
+++ b/chrome/views/root_view.h
@@ -69,7 +69,7 @@ class RootView : public View,
public:
static const char kViewClassName[];
- RootView(ViewContainer* view_container, bool double_buffer);
+ explicit RootView(ViewContainer* view_container);
virtual ~RootView();
@@ -87,7 +87,9 @@ class RootView : public View,
// Paint this RootView and its child Views.
virtual void ProcessPaint(ChromeCanvas* canvas);
- // Paint this View's invalid rect immediately.
+ // If the invalid rect is non-empty and there is a pending paint the RootView
+ // is painted immediately. This is internally invoked as the result of
+ // invoking SchedulePaint.
virtual void PaintNow();
// Whether or not this View needs repainting. If |urgent| is true, this method
@@ -243,9 +245,6 @@ class RootView : public View,
void RegisterViewForVisibleBoundsNotification(View* view);
void UnregisterViewForVisibleBoundsNotification(View* view);
- // Invoked by PaintTask to paint the root view in a non urgent way.
- void ProcessPendingPaint();
-
// Returns the next focusable view or view containing a FocusTraversable (NULL
// if none was found), starting at the starting_view.
// skip_starting_view, can_go_up and can_go_down controls the traversal of
@@ -287,9 +286,6 @@ class RootView : public View,
// If a view is dragging, this returns it. Otherwise returns NULL.
View* GetDragView();
- // Whether or not we're double buffering paints
- bool double_buffer_;
-
// The view currently handing down - drag - up
View* mouse_pressed_handler_;