diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 00:07:38 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 00:07:38 +0000 |
commit | 1946c9389f17ca1c3dac2d30d2eb40cb06d59413 (patch) | |
tree | ce2afef1394cd7efdbd6588c11a5bf86d59f1a77 /chrome/browser/ui/cocoa/location_bar | |
parent | 6719335ef7930ab4cea4207c5c6eddda7ee12ef1 (diff) | |
download | chromium_src-1946c9389f17ca1c3dac2d30d2eb40cb06d59413.zip chromium_src-1946c9389f17ca1c3dac2d30d2eb40cb06d59413.tar.gz chromium_src-1946c9389f17ca1c3dac2d30d2eb40cb06d59413.tar.bz2 |
Fixes bug in instant that resulted in flickery fade. The problem would
happen if instant wouldn't load the current url and you continued
typing. For example, if the search engine doesn't support the instant
API on each key press you would see the page fade out, then snap in.
The fix is to make sure instant stays active until destroyed. That way
if the preview is no longer valid, but instant is still active the
page can remain faded out.
This also adds a couple more tests for better coverage.
BUG=66720 66539
TEST=see bug
Review URL: http://codereview.chromium.org/5701008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/location_bar')
-rw-r--r-- | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index 72f3172..436963d 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm @@ -233,18 +233,17 @@ void LocationBarViewMac::OnAutocompleteLosingFocus(gfx::NativeView unused) { if (!instant) return; - if (!instant->is_active() || !instant->GetPreviewContents()) - return; - // If |IsMouseDownFromActivate()| returns false, the RenderWidgetHostView did // not receive a mouseDown event. Therefore, we should destroy the preview. // Otherwise, the RWHV was clicked, so we commit the preview. - if (!instant->IsMouseDownFromActivate()) + if (!instant->is_displayable() || !instant->GetPreviewContents() || + !instant->IsMouseDownFromActivate()) { instant->DestroyPreviewContents(); - else if (instant->IsShowingInstant()) + } else if (instant->IsShowingInstant()) { instant->SetCommitOnMouseUp(); - else + } else { instant->CommitCurrentPreview(INSTANT_COMMIT_FOCUS_LOST); + } } void LocationBarViewMac::OnAutocompleteWillAccept() { |