diff options
author | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 18:05:52 +0000 |
---|---|---|
committer | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 18:05:52 +0000 |
commit | 27e6e9ec960a108b11575c0f00341bda5524d141 (patch) | |
tree | 909bd364189675e3983f78b22fc8f2fd356ad508 /ash | |
parent | f79de675d793684fb90a36d95a7ac2bde4b6bece (diff) | |
download | chromium_src-27e6e9ec960a108b11575c0f00341bda5524d141.zip chromium_src-27e6e9ec960a108b11575c0f00341bda5524d141.tar.gz chromium_src-27e6e9ec960a108b11575c0f00341bda5524d141.tar.bz2 |
Use gfx::Insets return type for Border::GetInsets().
Simplify Border code by using an explicit return value for GetInsets() rather than an out argument. This code is not invoked enough for performance to be an issue.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11364208
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/launcher/overflow_bubble.cc | 3 | ||||
-rw-r--r-- | ash/system/tray/tray_details_view.cc | 4 | ||||
-rw-r--r-- | ash/system/tray/tray_event_filter.cc | 4 | ||||
-rw-r--r-- | ash/system/tray/tray_views.cc | 4 | ||||
-rw-r--r-- | ash/wm/maximize_bubble_controller.cc | 9 |
5 files changed, 9 insertions, 15 deletions
diff --git a/ash/launcher/overflow_bubble.cc b/ash/launcher/overflow_bubble.cc index e5f78cd..b5a1be5e 100644 --- a/ash/launcher/overflow_bubble.cc +++ b/ash/launcher/overflow_bubble.cc @@ -201,8 +201,7 @@ ui::EventResult OverflowBubbleView::OnScrollEvent(ui::ScrollEvent* event) { gfx::Rect OverflowBubbleView::GetBubbleBounds() { views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); - gfx::Insets bubble_insets; - border->GetInsets(&bubble_insets); + gfx::Insets bubble_insets = border->GetInsets(); const int border_size = views::BubbleBorder::is_arrow_on_horizontal(arrow_location()) ? diff --git a/ash/system/tray/tray_details_view.cc b/ash/system/tray/tray_details_view.cc index b68c5fd..4e74bd6 100644 --- a/ash/system/tray/tray_details_view.cc +++ b/ash/system/tray/tray_details_view.cc @@ -30,8 +30,8 @@ class ScrollBorder : public views::Border { kBorderLightColor); } - virtual void GetInsets(gfx::Insets* insets) const OVERRIDE { - insets->Set(0, 0, 1, 0); + virtual gfx::Insets GetInsets() const OVERRIDE { + return gfx::Insets(0, 0, 1, 0); } bool visible_; diff --git a/ash/system/tray/tray_event_filter.cc b/ash/system/tray/tray_event_filter.cc index 2368900..7b130e9 100644 --- a/ash/system/tray/tray_event_filter.cc +++ b/ash/system/tray/tray_event_filter.cc @@ -72,9 +72,7 @@ bool TrayEventFilter::ProcessLocatedEvent(ui::LocatedEvent* event) { return false; gfx::Rect bounds = wrapper_->bubble_widget()->GetWindowBoundsInScreen(); - gfx::Insets insets; - wrapper_->bubble_view()->GetBorderInsets(&insets); - bounds.Inset(insets); + bounds.Inset(wrapper_->bubble_view()->GetBorderInsets()); if (bounds.Contains(event->root_location())) return false; if (wrapper_->tray()) { diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc index ccfba23..297c2fd 100644 --- a/ash/system/tray/tray_views.cc +++ b/ash/system/tray/tray_views.cc @@ -72,8 +72,8 @@ class SpecialPopupRowBorder : public views::Border { gfx::Rect(gfx::Size(view.width(), kBorderHeight))); } - virtual void GetInsets(gfx::Insets* insets) const OVERRIDE { - insets->Set(kBorderHeight, 0, 0, 0); + virtual gfx::Insets GetInsets() const OVERRIDE { + return gfx::Insets(kBorderHeight, 0, 0, 0); } scoped_ptr<views::Painter> painter_; diff --git a/ash/wm/maximize_bubble_controller.cc b/ash/wm/maximize_bubble_controller.cc index 5734394..54521aa 100644 --- a/ash/wm/maximize_bubble_controller.cc +++ b/ash/wm/maximize_bubble_controller.cc @@ -92,8 +92,7 @@ MaximizeBubbleBorder::MaximizeBubbleBorder(views::View* content_view, } void MaximizeBubbleBorder::GetMask(gfx::Path* mask) { - gfx::Insets inset; - GetInsets(&inset); + gfx::Insets inset = GetInsets(); // Note: Even though the tip could be added as activatable, it is left out // since it would not change the action behavior in any way plus it makes // more sense to keep the focus on the underlying button for clicks. @@ -113,8 +112,7 @@ gfx::Rect MaximizeBubbleBorder::GetBounds( const gfx::Rect& position_relative_to, const gfx::Size& contents_size) const { gfx::Size border_size(contents_size); - gfx::Insets insets; - GetInsets(&insets); + gfx::Insets insets = GetInsets(); border_size.Enlarge(insets.width(), insets.height()); // Position the bubble to center the box on the anchor. @@ -129,8 +127,7 @@ gfx::Rect MaximizeBubbleBorder::GetBounds( } void MaximizeBubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) { - gfx::Insets inset; - GetInsets(&inset); + gfx::Insets inset = GetInsets(); // Draw the border line around everything. int y = inset.top(); |