summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 22:33:54 +0000
committerrjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 22:33:54 +0000
commite7ab9a9cab53ba8305ed83374f1ac22bd8c70132 (patch)
tree44491a5c682b78112a16a2e247422a06297fa88c
parentc0a6b27309927a311a2af8f561f8b2c3536c7847 (diff)
downloadchromium_src-e7ab9a9cab53ba8305ed83374f1ac22bd8c70132.zip
chromium_src-e7ab9a9cab53ba8305ed83374f1ac22bd8c70132.tar.gz
chromium_src-e7ab9a9cab53ba8305ed83374f1ac22bd8c70132.tar.bz2
Revert 74344 - BackingStoreSkia: Use skia for painting in RenderWidgetHostViewViews.
Instead of directly painting to X, paint to the skia canvas from RWHVV. This will make it easier to apply transformation to views in a uniform way, without requiring any special-casing for RWHVV. BUG=none TEST=none Review URL: http://codereview.chromium.org/6246129 Patch from Chad Faragher <wyck@chromium.org>. TBR=rjkroege@google.com Review URL: http://codereview.chromium.org/6476012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74352 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/touch/tabs/touch_tab_strip.cc4
-rw-r--r--chrome/browser/ui/touch/tabs/touch_tab_strip.h1
-rw-r--r--chrome/browser/ui/views/frame/glass_browser_frame_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/opaque_browser_frame_view.cc3
-rw-r--r--chrome/browser/ui/views/frame/popup_non_client_frame_view.cc2
-rw-r--r--chrome/browser/ui/views/tabs/base_tab_strip.h4
-rw-r--r--chrome/browser/ui/views/tabs/side_tab_strip.cc4
-rw-r--r--chrome/browser/ui/views/tabs/side_tab_strip.h1
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc4
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.h1
10 files changed, 22 insertions, 4 deletions
diff --git a/chrome/browser/ui/touch/tabs/touch_tab_strip.cc b/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
index b950fb0..ee05a4f 100644
--- a/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
+++ b/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
@@ -35,6 +35,10 @@ TouchTabStrip::~TouchTabStrip() {
////////////////////////////////////////////////////////////////////////////////
// TouchTabStrip, BaseTabStrip implementation:
+int TouchTabStrip::GetPreferredHeight() {
+ return GetPreferredSize().height();
+}
+
void TouchTabStrip::SetBackgroundOffset(const gfx::Point& offset) {
for (int i = 0; i < tab_count(); ++i)
GetTabAtTabDataIndex(i)->set_background_offset(offset);
diff --git a/chrome/browser/ui/touch/tabs/touch_tab_strip.h b/chrome/browser/ui/touch/tabs/touch_tab_strip.h
index 8248493..14426f2 100644
--- a/chrome/browser/ui/touch/tabs/touch_tab_strip.h
+++ b/chrome/browser/ui/touch/tabs/touch_tab_strip.h
@@ -26,6 +26,7 @@ class TouchTabStrip : public BaseTabStrip {
virtual ~TouchTabStrip();
// BaseTabStrip implementation:
+ virtual int GetPreferredHeight();
virtual void SetBackgroundOffset(const gfx::Point& offset);
virtual bool IsPositionInWindowCaption(const gfx::Point& point);
virtual void PrepareForCloseAt(int model_index);
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index c00b647..aa178da 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -105,7 +105,7 @@ gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
return gfx::Rect(tabstrip_x, GetHorizontalTabStripVerticalOffset(false),
std::max(0, tabstrip_width),
- tabstrip->GetPreferredSize().height());
+ tabstrip->GetPreferredHeight());
}
int GlassBrowserFrameView::GetHorizontalTabStripVerticalOffset(
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 2f64aa2..b70715d 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -215,8 +215,7 @@ gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip(
(frame_->GetWindow()->IsMaximized() ?
kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
return gfx::Rect(tabstrip_x, GetHorizontalTabStripVerticalOffset(false),
- std::max(0, tabstrip_width),
- tabstrip->GetPreferredSize().height());
+ std::max(0, tabstrip_width), tabstrip->GetPreferredHeight());
}
int OpaqueBrowserFrameView::GetHorizontalTabStripVerticalOffset(
diff --git a/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc b/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc
index 5beee07..5951efe 100644
--- a/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc
+++ b/chrome/browser/ui/views/frame/popup_non_client_frame_view.cc
@@ -46,7 +46,7 @@ void PopupNonClientFrameView::ResetWindowControls() {
gfx::Rect PopupNonClientFrameView::GetBoundsForTabStrip(
BaseTabStrip* tabstrip) const {
- return gfx::Rect(0, 0, width(), tabstrip->GetPreferredSize().height());
+ return gfx::Rect(0, 0, width(), tabstrip->GetPreferredHeight());
}
int PopupNonClientFrameView::GetHorizontalTabStripVerticalOffset(
diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.h b/chrome/browser/ui/views/tabs/base_tab_strip.h
index 6868608..fbe7b2a 100644
--- a/chrome/browser/ui/views/tabs/base_tab_strip.h
+++ b/chrome/browser/ui/views/tabs/base_tab_strip.h
@@ -32,6 +32,10 @@ class BaseTabStrip : public views::View,
Type type() const { return type_; }
+ // Returns the preferred height of this TabStrip. This is based on the
+ // typical height of its constituent tabs.
+ virtual int GetPreferredHeight() = 0;
+
// Set the background offset used by inactive tabs to match the frame image.
virtual void SetBackgroundOffset(const gfx::Point& offset) = 0;
diff --git a/chrome/browser/ui/views/tabs/side_tab_strip.cc b/chrome/browser/ui/views/tabs/side_tab_strip.cc
index 8eedb75..847d329 100644
--- a/chrome/browser/ui/views/tabs/side_tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/side_tab_strip.cc
@@ -89,6 +89,10 @@ SideTabStrip::~SideTabStrip() {
////////////////////////////////////////////////////////////////////////////////
// SideTabStrip, BaseTabStrip implementation:
+int SideTabStrip::GetPreferredHeight() {
+ return 0;
+}
+
void SideTabStrip::SetBackgroundOffset(const gfx::Point& offset) {
}
diff --git a/chrome/browser/ui/views/tabs/side_tab_strip.h b/chrome/browser/ui/views/tabs/side_tab_strip.h
index 66312b0..830b272 100644
--- a/chrome/browser/ui/views/tabs/side_tab_strip.h
+++ b/chrome/browser/ui/views/tabs/side_tab_strip.h
@@ -19,6 +19,7 @@ class SideTabStrip : public BaseTabStrip {
virtual ~SideTabStrip();
// BaseTabStrip implementation:
+ virtual int GetPreferredHeight();
virtual void SetBackgroundOffset(const gfx::Point& offset);
virtual bool IsPositionInWindowCaption(const gfx::Point& point);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index eca1ef9..e454f0e 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -164,6 +164,10 @@ void TabStrip::MouseMovedOutOfView() {
////////////////////////////////////////////////////////////////////////////////
// TabStrip, BaseTabStrip implementation:
+int TabStrip::GetPreferredHeight() {
+ return GetPreferredSize().height();
+}
+
void TabStrip::SetBackgroundOffset(const gfx::Point& offset) {
for (int i = 0; i < tab_count(); ++i)
GetTabAtTabDataIndex(i)->set_background_offset(offset);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h
index 82f3f35..e50c779 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.h
+++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -56,6 +56,7 @@ class TabStrip : public BaseTabStrip,
virtual void MouseMovedOutOfView();
// BaseTabStrip implementation:
+ virtual int GetPreferredHeight();
virtual void SetBackgroundOffset(const gfx::Point& offset);
virtual bool IsPositionInWindowCaption(const gfx::Point& point);
virtual void PrepareForCloseAt(int model_index);