diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 19:41:41 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 19:41:41 +0000 |
commit | 2629d65a605e07b47287af311f85c978c0e009c7 (patch) | |
tree | 659a0173a376d52a57f8adfeeada179ef314a1fa /chrome | |
parent | 961c3ee9e2f89148b9e001ea116e90b5b68681a4 (diff) | |
download | chromium_src-2629d65a605e07b47287af311f85c978c0e009c7.zip chromium_src-2629d65a605e07b47287af311f85c978c0e009c7.tar.gz chromium_src-2629d65a605e07b47287af311f85c978c0e009c7.tar.bz2 |
Change most callers of NativeScrollbar size functions to use a dedicated function that matches WebKit instead, since the callers really care about content area scrollbars.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/463061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/blocked_popup_container_view_views.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_host.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 13 |
3 files changed, 10 insertions, 19 deletions
diff --git a/chrome/browser/views/blocked_popup_container_view_views.cc b/chrome/browser/views/blocked_popup_container_view_views.cc index 8dcff51..f01eca5 100644 --- a/chrome/browser/views/blocked_popup_container_view_views.cc +++ b/chrome/browser/views/blocked_popup_container_view_views.cc @@ -11,6 +11,7 @@ #include "app/gfx/canvas.h" #include "app/gfx/path.h" +#include "app/gfx/scrollbar_size.h" #include "app/l10n_util.h" #include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" @@ -25,7 +26,6 @@ #include "views/controls/button/image_button.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/menu_2.h" -#include "views/controls/scrollbar/native_scroll_bar.h" #include "views/screen.h" #if defined(OS_WIN) @@ -499,10 +499,8 @@ void BlockedPopupContainerViewViews::SetPosition() { // vertical scroll bar is visible, and not care about covering up // the horizontal scroll bar. Fixing this is half of // http://b/1118139. - gfx::Point anchor_point( - parent_size.width() - - views::NativeScrollBar::GetVerticalScrollBarWidth(), - parent_size.height()); + gfx::Point anchor_point(parent_size.width() - gfx::scrollbar_size(), + parent_size.height()); gfx::Size size = container_view_->GetPreferredSize(); int base_x = anchor_point.x() - size.width(); diff --git a/chrome/browser/views/find_bar_host.cc b/chrome/browser/views/find_bar_host.cc index dd8622a..bc81cda 100644 --- a/chrome/browser/views/find_bar_host.cc +++ b/chrome/browser/views/find_bar_host.cc @@ -5,6 +5,7 @@ #include "chrome/browser/views/find_bar_host.h" #include "app/gfx/path.h" +#include "app/gfx/scrollbar_size.h" #include "app/slide_animation.h" #include "base/keyboard_codes.h" #include "base/scoped_handle.h" @@ -19,7 +20,6 @@ #include "chrome/browser/tab_contents/tab_contents_view.h" #include "views/focus/external_focus_tracker.h" #include "views/focus/view_storage.h" -#include "views/controls/scrollbar/native_scroll_bar.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" @@ -218,10 +218,8 @@ void FindBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { // TODO(brettw) this constant is evil. This is the amount of room we've added // to the window size, when we set the region, it can change the size. static const int kAddedWidth = 7; - int difference = (new_pos.right() - kAddedWidth) - - widget_bounds.width() - - views::NativeScrollBar::GetVerticalScrollBarWidth() + - 1; + int difference = new_pos.right() - kAddedWidth - widget_bounds.width() - + gfx::scrollbar_size() + 1; if (difference > 0) { Path::Point exclude[4]; exclude[0].x = max_x - difference; // Top left corner. diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 29a51fd..5e10dd2 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -10,6 +10,7 @@ #include "app/drag_drop_types.h" #include "app/gfx/canvas.h" +#include "app/gfx/scrollbar_size.h" #include "app/l10n_util.h" #include "app/os_exchange_data.h" #include "app/resource_bundle.h" @@ -79,7 +80,6 @@ #include "app/win_util.h" #include "chrome/browser/jumplist.h" #include "chrome/browser/views/theme_install_bubble_view.h" -#include "views/controls/scrollbar/native_scroll_bar.h" #elif defined(OS_LINUX) #include "chrome/browser/views/accelerator_table_gtk.h" #include "views/window/hit_test.h" @@ -231,8 +231,8 @@ class ResizeCorner : public views::View { 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... - // return gfx::Size(views::NativeScrollBar::GetVerticalScrollBarWidth(), - // views::NativeScrollBar::GetHorizontalScrollBarHeight()); + // int scrollbar_thickness = gfx::scrollbar_size(); + // return gfx::Size(scrollbar_thickness, scrollbar_thickness); return gfx::Size(); } @@ -553,12 +553,7 @@ gfx::Rect BrowserView::GetFindBarBoundingBox() const { // Finally decrease the width of the bounding box by the width of the vertical // scroll bar. -#if defined(OS_WIN) - int scrollbar_width = views::NativeScrollBar::GetVerticalScrollBarWidth(); -#else - // This matches the value in ScrollbarThemeChromium::scrollbarThickness. - int scrollbar_width = 15; -#endif + int scrollbar_width = gfx::scrollbar_size(); bounding_box.set_width(std::max(0, bounding_box.width() - scrollbar_width)); if (UILayoutIsRightToLeft()) bounding_box.set_x(bounding_box.x() + scrollbar_width); |