Remove unused ResizeCorner code from BrowserView

ResizeCorner was disabled in 2009 due to page cycler performance regressions.

BUG=232971
TEST=compiles, existing browser tests, and you can still resize the window and content paints correctly

Review URL: https://chromiumcodereview.appspot.com/14362005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195241 0039d316-1c4b-4281-b951-d872f2087c98
parent 7f112d23
...@@ -377,54 +377,6 @@ void BookmarkExtensionBackground::Paint(gfx::Canvas* canvas, ...@@ -377,54 +377,6 @@ void BookmarkExtensionBackground::Paint(gfx::Canvas* canvas,
} }
} }
///////////////////////////////////////////////////////////////////////////////
// ResizeCorner, private:
class ResizeCorner : public views::View {
public:
ResizeCorner() {
EnableCanvasFlippingForRTLUI(true);
}
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
views::Widget* widget = GetWidget();
if (!widget || (widget->IsMaximized() || widget->IsFullscreen()))
return;
gfx::ImageSkia* image = ui::ResourceBundle::GetSharedInstance().
GetImageSkiaNamed(IDR_TEXTAREA_RESIZER);
canvas->DrawImageInt(*image, width() - image->width(),
height() - image->height());
}
static gfx::Size GetSize() {
// This is disabled until we find what makes us slower when we let
// WebKit know that we have a resizer rect...
// int scrollbar_thickness = gfx::scrollbar_size();
// return gfx::Size(scrollbar_thickness, scrollbar_thickness);
return gfx::Size();
}
virtual gfx::Size GetPreferredSize() OVERRIDE {
views::Widget* widget = GetWidget();
return (!widget || widget->IsMaximized() || widget->IsFullscreen()) ?
gfx::Size() : GetSize();
}
virtual void Layout() OVERRIDE {
if (parent()) {
gfx::Size ps = GetPreferredSize();
// No need to handle Right to left text direction here,
// our parent must take care of it for us...
SetBounds(parent()->width() - ps.width(),
parent()->height() - ps.height(), ps.width(), ps.height());
}
}
private:
DISALLOW_COPY_AND_ASSIGN(ResizeCorner);
};
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// BrowserView, public: // BrowserView, public:
...@@ -1175,24 +1127,9 @@ bool BrowserView::IsToolbarVisible() const { ...@@ -1175,24 +1127,9 @@ bool BrowserView::IsToolbarVisible() const {
} }
gfx::Rect BrowserView::GetRootWindowResizerRect() const { gfx::Rect BrowserView::GetRootWindowResizerRect() const {
if (frame_->IsMaximized() || frame_->IsFullscreen()) // Views does not support resizer rects because they caused page cycler
return gfx::Rect(); // performance regressions when they were added. See crrev.com/9654
return gfx::Rect();
// We don't specify a resize corner size if we have a bottom shelf either.
// This is because we take care of drawing the resize corner on top of that
// shelf, so we don't want others to do it for us in this case.
// Currently, the only visible bottom shelf is the download shelf.
// Other tests should be added here if we add more bottom shelves.
if (IsDownloadShelfVisible())
return gfx::Rect();
gfx::Rect client_rect = contents_split_->bounds();
gfx::Size resize_corner_size = ResizeCorner::GetSize();
int x = client_rect.width() - resize_corner_size.width();
if (base::i18n::IsRTL())
x = 0;
return gfx::Rect(x, client_rect.height() - resize_corner_size.height(),
resize_corner_size.width(), resize_corner_size.height());
} }
void BrowserView::DisableInactiveFrame() { void BrowserView::DisableInactiveFrame() {
...@@ -1866,28 +1803,6 @@ bool BrowserView::CanClose() { ...@@ -1866,28 +1803,6 @@ bool BrowserView::CanClose() {
} }
int BrowserView::NonClientHitTest(const gfx::Point& point) { int BrowserView::NonClientHitTest(const gfx::Point& point) {
#if defined(OS_WIN) && !defined(USE_AURA)
// The following code is not in the LayoutManager because it's
// independent of layout and also depends on the ResizeCorner which
// is private.
if (!frame_->IsMaximized() && !frame_->IsFullscreen()) {
CRect client_rect;
::GetClientRect(frame_->GetNativeWindow(), &client_rect);
gfx::Size resize_corner_size = ResizeCorner::GetSize();
gfx::Rect resize_corner_rect(client_rect.right - resize_corner_size.width(),
client_rect.bottom - resize_corner_size.height(),
resize_corner_size.width(), resize_corner_size.height());
bool rtl_dir = base::i18n::IsRTL();
if (rtl_dir)
resize_corner_rect.set_x(0);
if (resize_corner_rect.Contains(point)) {
if (rtl_dir)
return HTBOTTOMLEFT;
return HTBOTTOMRIGHT;
}
}
#endif
return GetBrowserViewLayout()->NonClientHitTest(point); return GetBrowserViewLayout()->NonClientHitTest(point);
} }
...@@ -2598,10 +2513,6 @@ void BrowserView::UpdateAcceleratorMetrics( ...@@ -2598,10 +2513,6 @@ void BrowserView::UpdateAcceleratorMetrics(
#endif #endif
} }
gfx::Size BrowserView::GetResizeCornerSize() const {
return ResizeCorner::GetSize();
}
void BrowserView::CreateLauncherIcon() { void BrowserView::CreateLauncherIcon() {
#if defined(USE_ASH) #if defined(USE_ASH)
if (chrome::IsNativeWindowInAsh(GetNativeWindow()) && if (chrome::IsNativeWindowInAsh(GetNativeWindow()) &&
......
...@@ -558,9 +558,6 @@ class BrowserView : public BrowserWindow, ...@@ -558,9 +558,6 @@ class BrowserView : public BrowserWindow,
void UpdateAcceleratorMetrics(const ui::Accelerator& accelerator, void UpdateAcceleratorMetrics(const ui::Accelerator& accelerator,
int command_id); int command_id);
// Exposes resize corner size to BrowserViewLayout.
gfx::Size GetResizeCornerSize() const;
// Create an icon for this window in the launcher (currently only for Ash). // Create an icon for this window in the launcher (currently only for Ash).
void CreateLauncherIcon(); void CreateLauncherIcon();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment