diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 20:37:49 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 20:37:49 +0000 |
commit | 2a1a1815a228089514ca0eb52ea9533d9e070672 (patch) | |
tree | 5ae6e2d6376cf68b61a404b8771fb01c034a7052 /chrome/browser/views/find_bar_win.cc | |
parent | 0f08bf3692c1db8ff2032a7e944335cb5bb6a453 (diff) | |
download | chromium_src-2a1a1815a228089514ca0eb52ea9533d9e070672.zip chromium_src-2a1a1815a228089514ca0eb52ea9533d9e070672.tar.gz chromium_src-2a1a1815a228089514ca0eb52ea9533d9e070672.tar.bz2 |
Convert all but one Find test from ui_test to In-Process
Browser test.
I also added initialization for a struct that static code analysis complained about. Not technically needed, but harmless to add.
BUG=None
TEST=None (covered by tests already).
Review URL: http://codereview.chromium.org/115652
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16651 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_win.cc')
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 007dcc0..5c2af1a 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -23,6 +23,9 @@ // The minimum space between the FindInPage window and the search result. static const int kMinFindWndDistanceFromSelection = 5; +// static +bool FindBarWin::disable_animations_during_testing_ = false; + //////////////////////////////////////////////////////////////////////////////// // FindBarWin, public: @@ -153,7 +156,7 @@ void FindBarWin::UpdateWindowEdges(const gfx::Rect& new_pos) { views::NativeScrollBar::GetVerticalScrollBarWidth() + 1; if (difference > 0) { - POINT exclude[4]; + POINT exclude[4] = {0}; exclude[0].x = max_x - difference; // Top left corner. exclude[0].y = 0; @@ -177,8 +180,13 @@ void FindBarWin::UpdateWindowEdges(const gfx::Rect& new_pos) { } void FindBarWin::Show() { - animation_->Reset(); - animation_->Show(); + if (disable_animations_during_testing_) { + animation_->Reset(1); + MoveWindowIfNecessary(gfx::Rect(), true); + } else { + animation_->Reset(); + animation_->Show(); + } } void FindBarWin::SetFocusAndSelection() { @@ -190,7 +198,7 @@ bool FindBarWin::IsAnimating() { } void FindBarWin::Hide(bool animate) { - if (animate) { + if (animate && !disable_animations_during_testing_) { animation_->Reset(1.0); animation_->Hide(); } else { |