diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 22:37:38 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 22:37:38 +0000 |
commit | 2dd50820df6d5c39fbb3f1fc1f1b8a29c30b9d72 (patch) | |
tree | a7e06fb3fd773206ef652d3b12972b321f00f2f6 | |
parent | 2141858324fd45ece7d3e96c60145a71e493fbe0 (diff) | |
download | chromium_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
-rw-r--r-- | chrome/browser/external_tab_container.cc | 2 | ||||
-rw-r--r-- | chrome/browser/native_ui_contents.cc | 2 | ||||
-rw-r--r-- | chrome/browser/vista_frame.cc | 2 | ||||
-rw-r--r-- | chrome/browser/xp_frame.cc | 2 | ||||
-rw-r--r-- | chrome/views/chrome_menu.cc | 2 | ||||
-rw-r--r-- | chrome/views/hwnd_view_container.cc | 2 | ||||
-rw-r--r-- | chrome/views/root_view.cc | 29 | ||||
-rw-r--r-- | chrome/views/root_view.h | 12 |
8 files changed, 22 insertions, 31 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 4ec21f6..ad872d9 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -47,7 +47,7 @@ static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject"; ExternalTabContainer::ExternalTabContainer( AutomationProvider* automation) : automation_(automation), - root_view_(this, true), + root_view_(this), tab_contents_(NULL), external_accel_table_(NULL), external_accel_entry_count_(0), diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc index 3988ae0..e9965dd 100644 --- a/chrome/browser/native_ui_contents.cc +++ b/chrome/browser/native_ui_contents.cc @@ -97,7 +97,7 @@ namespace { class NativeRootView : public ChromeViews::RootView { public: explicit NativeRootView(NativeUIContents* host) - : RootView(host, true), + : RootView(host), host_(host) { } virtual ~NativeRootView() { } diff --git a/chrome/browser/vista_frame.cc b/chrome/browser/vista_frame.cc index 2dba77f..2a910ff 100644 --- a/chrome/browser/vista_frame.cc +++ b/chrome/browser/vista_frame.cc @@ -140,7 +140,7 @@ VistaFrame* VistaFrame::CreateFrame(const gfx::Rect& bounds, VistaFrame::VistaFrame(Browser* browser) : browser_(browser), - root_view_(this, true), + root_view_(this), tabstrip_(NULL), active_bookmark_bar_(NULL), tab_contents_container_(NULL), diff --git a/chrome/browser/xp_frame.cc b/chrome/browser/xp_frame.cc index e9e69dd..dadab61 100644 --- a/chrome/browser/xp_frame.cc +++ b/chrome/browser/xp_frame.cc @@ -339,7 +339,7 @@ XPFrame* XPFrame::CreateFrame(const gfx::Rect& bounds, XPFrame::XPFrame(Browser* browser) : browser_(browser), - root_view_(this, true), + root_view_(this), frame_view_(NULL), tabstrip_(NULL), active_bookmark_bar_(NULL), 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_; |