summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 20:45:51 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 20:45:51 +0000
commit5fcfffba642d7bb4cdaeaa87af08ab9793db1f71 (patch)
tree8b3cd9e4c14e78afd7bf75895644f40c7425afc5
parentcffbe21f526d3bdf5104a8fac5f4365812841c39 (diff)
downloadchromium_src-5fcfffba642d7bb4cdaeaa87af08ab9793db1f71.zip
chromium_src-5fcfffba642d7bb4cdaeaa87af08ab9793db1f71.tar.gz
chromium_src-5fcfffba642d7bb4cdaeaa87af08ab9793db1f71.tar.bz2
OffsetY() is only used by InfoBarView. Move it there.
BUG=none TEST=none R=sky@chromium.org Review URL: https://codereview.chromium.org/100753004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239541 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/infobars/infobar.cc6
-rw-r--r--chrome/browser/infobars/infobar.h5
-rw-r--r--chrome/browser/ui/views/infobars/infobar_view.cc6
-rw-r--r--chrome/browser/ui/views/infobars/infobar_view.h5
4 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/infobars/infobar.cc b/chrome/browser/infobars/infobar.cc
index ab61ad1..072a009 100644
--- a/chrome/browser/infobars/infobar.cc
+++ b/chrome/browser/infobars/infobar.cc
@@ -114,12 +114,6 @@ void InfoBar::AnimationProgressed(const gfx::Animation* animation) {
RecalculateHeights(false);
}
-int InfoBar::OffsetY(const gfx::Size& prefsize) const {
- return arrow_height_ +
- std::max((bar_target_height_ - prefsize.height()) / 2, 0) -
- (bar_target_height_ - bar_height_);
-}
-
void InfoBar::AnimationEnded(const gfx::Animation* animation) {
// When the animation ends, we must ensure the container is notified even if
// the heights haven't changed, lest it never get an "animation finished"
diff --git a/chrome/browser/infobars/infobar.h b/chrome/browser/infobars/infobar.h
index 2355688..73d3ab47 100644
--- a/chrome/browser/infobars/infobar.h
+++ b/chrome/browser/infobars/infobar.h
@@ -100,11 +100,6 @@ class InfoBar : public gfx::AnimationDelegate {
// gfx::AnimationDelegate:
virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
- // Given a control with size |prefsize|, returns the centered y position
- // within us, taking into account animation so the control "slides in" (or
- // out) as we animate open and closed.
- int OffsetY(const gfx::Size& prefsize) const;
-
const InfoBarContainer* container() const { return container_; }
InfoBarContainer* container() { return container_; }
gfx::SlideAnimation* animation() { return &animation_; }
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 105b037..5d03a2d 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -321,6 +321,12 @@ int InfoBarView::EndX() const {
return close_button_->x() - kCloseButtonSpacing;
}
+int InfoBarView::OffsetY(const gfx::Size& prefsize) const {
+ return arrow_height() +
+ std::max((bar_target_height() - prefsize.height()) / 2, 0) -
+ (bar_target_height() - bar_height());
+}
+
const InfoBarContainer::Delegate* InfoBarView::container_delegate() const {
const InfoBarContainer* infobar_container = container();
return infobar_container ? infobar_container->delegate() : NULL;
diff --git a/chrome/browser/ui/views/infobars/infobar_view.h b/chrome/browser/ui/views/infobars/infobar_view.h
index 8914c17..2805a7c 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.h
+++ b/chrome/browser/ui/views/infobars/infobar_view.h
@@ -87,6 +87,11 @@ class InfoBarView : public InfoBar,
int StartX() const;
int EndX() const;
+ // Given a control with size |prefsize|, returns the centered y position
+ // within us, taking into account animation so the control "slides in" (or
+ // out) as we animate open and closed.
+ int OffsetY(const gfx::Size& prefsize) const;
+
// Convenience getter.
const InfoBarContainer::Delegate* container_delegate() const;