diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 01:00:27 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 01:00:27 +0000 |
commit | d851106a4c47f58ff714c4f4e2d05b41490947ac (patch) | |
tree | 34166dbdd4d219dfe32c591a973d87fd25fa7fc2 /chrome/browser/views/browser_actions_container.cc | |
parent | 596650852ec1016cf7c5af66ed4236c9cb546c05 (diff) | |
download | chromium_src-d851106a4c47f58ff714c4f4e2d05b41490947ac.zip chromium_src-d851106a4c47f58ff714c4f4e2d05b41490947ac.tar.gz chromium_src-d851106a4c47f58ff714c4f4e2d05b41490947ac.tar.bz2 |
Make the resize gripper invisible.
BUG=50107
TEST=Resize gripper nest to browser actions container should no longer appear
Review URL: http://codereview.chromium.org/3052011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/browser_actions_container.cc')
-rw-r--r-- | chrome/browser/views/browser_actions_container.cc | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc index d5a8fde..06afa92 100644 --- a/chrome/browser/views/browser_actions_container.cc +++ b/chrome/browser/views/browser_actions_container.cc @@ -75,8 +75,8 @@ static const int kChevronTopMargin = 9; // The margin to the right of the chevron. static const int kChevronRightMargin = 4; -// Extra hit-area for the resize gripper. -static const int kExtraResizeArea = 4; +// Width for the resize area. +static const int kResizeAreaWidth = 4; // Width of the drop indicator. static const int kDropIndicatorWidth = 2; @@ -367,7 +367,6 @@ BrowserActionsContainer::BrowserActionsContainer( popup_(NULL), popup_button_(NULL), model_(NULL), - resize_gripper_(NULL), chevron_(NULL), overflow_menu_(NULL), suppress_chevron_(false), @@ -383,11 +382,9 @@ BrowserActionsContainer::BrowserActionsContainer( model_->AddObserver(this); } resize_animation_.reset(new SlideAnimation(this)); - resize_gripper_ = new views::ResizeGripper(this); - resize_gripper_->SetAccessibleName( - l10n_util::GetString(IDS_ACCNAME_SEPARATOR)); - resize_gripper_->SetVisible(false); - AddChildView(resize_gripper_); + resize_area_ = new views::ResizeArea(this); + resize_area_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_SEPARATOR)); + AddChildView(resize_area_); // TODO(glen): Come up with a new bitmap for the chevron. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); @@ -520,8 +517,6 @@ void BrowserActionsContainer::DeleteBrowserActionViews() { void BrowserActionsContainer::OnBrowserActionVisibilityChanged() { SetVisible(browser_action_views_.size() > 0); - resize_gripper_->SetVisible(browser_action_views_.size() > 0); - owner_view_->Layout(); owner_view_->SchedulePaint(); } @@ -613,23 +608,14 @@ gfx::Size BrowserActionsContainer::GetPreferredSize() { void BrowserActionsContainer::Layout() { if (browser_action_views_.size() == 0) { SetVisible(false); - resize_gripper_->SetVisible(false); chevron_->SetVisible(false); return; } else { SetVisible(true); - resize_gripper_->SetVisible(true); } - int x = 0; - if (resize_gripper_->IsVisible()) { - // We'll draw the resize gripper a little wider, to add some invisible hit - // target area - but we don't account for it anywhere. - gfx::Size sz = resize_gripper_->GetPreferredSize(); - resize_gripper_->SetBounds(x, (height() - sz.height()) / 2 + 1, - sz.width() + kExtraResizeArea, sz.height()); - x += sz.width(); - } + resize_area_->SetBounds(0, 0, kResizeAreaWidth, height()); + int x = kResizeAreaWidth; x += base::i18n::IsRTL() ? kHorizontalPaddingRtl : kHorizontalPadding; @@ -898,7 +884,7 @@ int BrowserActionsContainer::ClampToNearestIconCount( size_t icon_count = 0u; if (pixelWidth >= 0) { // Caller wants to know how many icons fit within a given space so we start - // by subtracting the padding, gripper and dividers. + // by subtracting the padding, resize area and dividers. int icon_area = pixelWidth - extras; icon_area = std::max(0, icon_area); @@ -1047,8 +1033,8 @@ int BrowserActionsContainer::WidthOfNonIconArea() const { chevron_->GetPreferredSize().width() : 0; int padding = base::i18n::IsRTL() ? kHorizontalPaddingRtl : kHorizontalPadding; - return resize_gripper_->GetPreferredSize().width() + padding + - chevron_size + kChevronRightMargin + kDividerHorizontalMargin; + return kResizeAreaWidth + padding + chevron_size + kChevronRightMargin + + kDividerHorizontalMargin; } int BrowserActionsContainer::IconCountToWidth(int icons) const { @@ -1062,7 +1048,7 @@ int BrowserActionsContainer::IconCountToWidth(int icons) const { } int BrowserActionsContainer::ContainerMinSize() const { - return resize_gripper_->width() + chevron_->width() + kChevronRightMargin; + return kResizeAreaWidth + chevron_->width() + kChevronRightMargin; } void BrowserActionsContainer::Animate(Tween::Type tween_type, int target_size) { |