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

Unified Diff: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 385041: Merge crash fix to 3.0.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/195/src/
Patch Set: Created 11 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: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
===================================================================
--- chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (revision 31682)
+++ chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc (working copy)
@@ -681,8 +681,7 @@
AutocompleteEditModel* edit_model,
Profile* profile,
AutocompletePopupPositioner* popup_positioner)
- : popup_(new AutocompletePopupWin(this)),
- model_(new AutocompletePopupModel(this, edit_model, profile)),
+ : model_(new AutocompletePopupModel(this, edit_model, profile)),
edit_view_(edit_view),
popup_positioner_(popup_positioner),
result_font_(font.DeriveFont(kEditFontAdjust)),
@@ -710,7 +709,7 @@
// AutocompletePopupContentsView, AutocompletePopupView overrides:
bool AutocompletePopupContentsView::IsOpen() const {
- return popup_->IsWindow() && popup_->IsVisible();
+ return (popup_ != NULL);
}
void AutocompletePopupContentsView::InvalidateLine(size_t line) {
@@ -720,9 +719,10 @@
void AutocompletePopupContentsView::UpdatePopupAppearance() {
if (model_->result().empty()) {
// No matches, close any existing popup.
- if (popup_->IsWindow()) {
+ if (popup_ != NULL) {
size_animation_.Stop();
- popup_->Hide();
+ popup_->CloseNow();
+ popup_.reset();
}
return;
}
@@ -759,20 +759,18 @@
size_animation_.Reset();
target_bounds_ = new_target_bounds;
- if (!popup_->IsWindow()) {
- // If we've never been shown, we need to create the window.
- popup_->Init(edit_view_, this);
+ if (popup_ == NULL) {
+ // If the popup is currently closed, we need to create it.
+ popup_.reset(new AutocompletePopupClass(edit_view_, this));
} else {
- // Animate the popup shrinking, but don't animate growing larger (or
- // appearing for the first time) since that would make the popup feel less
- // responsive.
+ // Animate the popup shrinking, but don't animate growing larger since that
+ // would make the popup feel less responsive.
GetWidget()->GetBounds(&start_bounds_, true);
- if (popup_->IsVisible() &&
- (target_bounds_.height() < start_bounds_.height()))
+ if (target_bounds_.height() < start_bounds_.height())
size_animation_.Show();
else
start_bounds_ = target_bounds_;
- popup_->Show();
+ popup_->SetBounds(GetPopupBounds());
}
SchedulePaint();
@@ -830,7 +828,9 @@
void AutocompletePopupContentsView::AnimationProgressed(
const Animation* animation) {
- popup_->Show();
+ // We should only be running the animation when the popup is already visible.
+ DCHECK(popup_ != NULL);
+ popup_->SetBounds(GetPopupBounds());
}
////////////////////////////////////////////////////////////////////////////////
Property changes on: chrome\browser\views\autocomplete\autocomplete_popup_contents_view.cc
___________________________________________________________________
Deleted: svn:mergeinfo
Reverse-merged /branches/chrome_webkit_merge_branch/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc:r69-2775
Reverse-merged /trunk/src/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc:r21322,25494,25568

Powered by Google App Engine
This is Rietveld 408576698