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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 2425703003: Fix failing DCHECK in AutoCompleteInput() (Closed)
Patch Set: use pkasting's suggested code Created 4 years, 2 months 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
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
6 6
7 #include <Carbon/Carbon.h> // kVK_Return 7 #include <Carbon/Carbon.h> // kVK_Return
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // * The user has just pasted in something that replaced all the text 435 // * The user has just pasted in something that replaced all the text
436 // * The user is trying to compose something in an IME 436 // * The user is trying to compose something in an IME
437 bool prevent_inline_autocomplete = IsImeComposing(); 437 bool prevent_inline_autocomplete = IsImeComposing();
438 NSTextView* editor = (NSTextView*)[field_ currentEditor]; 438 NSTextView* editor = (NSTextView*)[field_ currentEditor];
439 if (editor) { 439 if (editor) {
440 if (NSMaxRange([editor selectedRange]) < [[editor textStorage] length]) 440 if (NSMaxRange([editor selectedRange]) < [[editor textStorage] length])
441 prevent_inline_autocomplete = true; 441 prevent_inline_autocomplete = true;
442 } 442 }
443 443
444 model()->StartAutocomplete([editor selectedRange].length != 0, 444 model()->StartAutocomplete([editor selectedRange].length != 0,
445 prevent_inline_autocomplete, false); 445 prevent_inline_autocomplete);
446 } 446 }
447 447
448 void OmniboxViewMac::CloseOmniboxPopup() { 448 void OmniboxViewMac::CloseOmniboxPopup() {
449 // Call both base class methods. 449 // Call both base class methods.
450 ClosePopup(); 450 ClosePopup();
451 OmniboxView::CloseOmniboxPopup(); 451 OmniboxView::CloseOmniboxPopup();
452 } 452 }
453 453
454 void OmniboxViewMac::SetFocus() { 454 void OmniboxViewMac::SetFocus() {
455 FocusLocation(false); 455 FocusLocation(false);
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 display_text); 1114 display_text);
1115 NSDictionary* notification_info = @{ 1115 NSDictionary* notification_info = @{
1116 NSAccessibilityAnnouncementKey : announcement, 1116 NSAccessibilityAnnouncementKey : announcement,
1117 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) 1117 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh)
1118 }; 1118 };
1119 NSAccessibilityPostNotificationWithUserInfo( 1119 NSAccessibilityPostNotificationWithUserInfo(
1120 [field_ window], 1120 [field_ window],
1121 NSAccessibilityAnnouncementRequestedNotification, 1121 NSAccessibilityAnnouncementRequestedNotification,
1122 notification_info); 1122 notification_info);
1123 } 1123 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698