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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 5701008: Fixes bug in instant that resulted in flickery fade. The problem would (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Adds content to 403.html as bots seem to have problem with empty file Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/nsimage_cache_mac.h" 9 #include "base/nsimage_cache_mac.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 SetSuggestedText(string16()); 226 SetSuggestedText(string16());
227 } 227 }
228 228
229 void LocationBarViewMac::OnAutocompleteLosingFocus(gfx::NativeView unused) { 229 void LocationBarViewMac::OnAutocompleteLosingFocus(gfx::NativeView unused) {
230 SetSuggestedText(string16()); 230 SetSuggestedText(string16());
231 231
232 InstantController* instant = browser_->instant(); 232 InstantController* instant = browser_->instant();
233 if (!instant) 233 if (!instant)
234 return; 234 return;
235 235
236 if (!instant->is_active() || !instant->GetPreviewContents())
237 return;
238
239 // If |IsMouseDownFromActivate()| returns false, the RenderWidgetHostView did 236 // If |IsMouseDownFromActivate()| returns false, the RenderWidgetHostView did
240 // not receive a mouseDown event. Therefore, we should destroy the preview. 237 // not receive a mouseDown event. Therefore, we should destroy the preview.
241 // Otherwise, the RWHV was clicked, so we commit the preview. 238 // Otherwise, the RWHV was clicked, so we commit the preview.
242 if (!instant->IsMouseDownFromActivate()) 239 if (!instant->is_displayable() || !instant->GetPreviewContents() ||
240 !instant->IsMouseDownFromActivate()) {
243 instant->DestroyPreviewContents(); 241 instant->DestroyPreviewContents();
244 else if (instant->IsShowingInstant()) 242 } else if (instant->IsShowingInstant()) {
245 instant->SetCommitOnMouseUp(); 243 instant->SetCommitOnMouseUp();
246 else 244 } else {
247 instant->CommitCurrentPreview(INSTANT_COMMIT_FOCUS_LOST); 245 instant->CommitCurrentPreview(INSTANT_COMMIT_FOCUS_LOST);
246 }
248 } 247 }
249 248
250 void LocationBarViewMac::OnAutocompleteWillAccept() { 249 void LocationBarViewMac::OnAutocompleteWillAccept() {
251 update_instant_ = false; 250 update_instant_ = false;
252 } 251 }
253 252
254 bool LocationBarViewMac::OnCommitSuggestedText(const std::wstring& typed_text) { 253 bool LocationBarViewMac::OnCommitSuggestedText(const std::wstring& typed_text) {
255 return edit_view_->CommitSuggestText(); 254 return edit_view_->CommitSuggestText();
256 } 255 }
257 256
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 683
685 // These need to change anytime the layout changes. 684 // These need to change anytime the layout changes.
686 // TODO(shess): Anytime the field editor might have changed, the 685 // TODO(shess): Anytime the field editor might have changed, the
687 // cursor rects almost certainly should have changed. The tooltips 686 // cursor rects almost certainly should have changed. The tooltips
688 // might change even when the rects don't change. 687 // might change even when the rects don't change.
689 [field_ resetFieldEditorFrameIfNeeded]; 688 [field_ resetFieldEditorFrameIfNeeded];
690 [field_ updateCursorAndToolTipRects]; 689 [field_ updateCursorAndToolTipRects];
691 690
692 [field_ setNeedsDisplay:YES]; 691 [field_ setNeedsDisplay:YES];
693 } 692 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698