Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1473)

Unified Diff: ceee/ie/plugin/bho/infobar_window.cc

Issue 4991002: New unittests for infobar. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ceee/ie/plugin/bho/infobar_window.cc
===================================================================
--- ceee/ie/plugin/bho/infobar_window.cc (revision 66307)
+++ ceee/ie/plugin/bho/infobar_window.cc (working copy)
@@ -41,7 +41,8 @@
show_(false),
target_height_(1),
current_height_(1),
- sliding_infobar_(false) {
+ sliding_infobar_(false),
+ timer_id_(0) {
DCHECK(delegate);
}
@@ -165,7 +166,7 @@
current_height_ = target_height_;
if (sliding_infobar_) {
- KillTimer(kInfobarSlidingTimerId);
+ KillTimer(timer_id_);
sliding_infobar_ = false;
}
} else {
@@ -174,7 +175,9 @@
current_height_ = CalculateNextHeight();
if (!sliding_infobar_) {
- SetTimer(kInfobarSlidingTimerId, kInfobarSlidingTimerIntervalMs, NULL);
+ // Set timer and store its id (it could be different from the passed one).
+ timer_id_ = SetTimer(kInfobarSlidingTimerId,
+ kInfobarSlidingTimerIntervalMs, NULL);
sliding_infobar_ = true;
}
}
@@ -258,12 +261,12 @@
}
LRESULT InfobarWindow::OnTimer(UINT_PTR nIDEvent) {
- DCHECK(nIDEvent == kInfobarSlidingTimerId);
+ DCHECK(nIDEvent == timer_id_);
if (show_ && sliding_infobar_ && current_height_ != target_height_) {
current_height_ = CalculateNextHeight();
UpdateLayout();
} else if (sliding_infobar_) {
- KillTimer(kInfobarSlidingTimerId);
+ KillTimer(timer_id_);
sliding_infobar_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698