Commit 3656c9a8 authored by stkhapugin@chromium.org's avatar stkhapugin@chromium.org Committed by Commit Bot

[iOS] Update outdated comments in OmniboxViewIOS.

Removes mentions of iOS <10 and removes one unnecessary if-condition.

Bug: None
Test: None
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I14b5e26b5b311011f3430fad813c164a8c682a27
Reviewed-on: https://chromium-review.googlesource.com/893186
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537332}
parent 8ce0e372
......@@ -221,8 +221,9 @@ void OmniboxViewIOS::SetWindowTextAndCaretPos(const base::string16& text,
bool notify_text_changed) {
// Do not call SetUserText() here, as the user has not triggered this change.
// Instead, set the field's text directly.
// TODO(justincohen): b/5244062 Temporary fix to set the text_field value
// before model()->CurrentTextIsUrl(), since that pulls from text_field.value.
// Set the field_ value before calling ApplyTextAttributes(), because that
// internally calls model()->CurrentTextIsUrl(), which uses the text in the
// field_.
[field_ setText:base::SysUTF16ToNSString(text)];
NSAttributedString* as = ApplyTextAttributes(text);
......@@ -510,15 +511,13 @@ void OmniboxViewIOS::OnDidChange(bool processing_user_event) {
// Generally do not notify the autocomplete system of a text change unless the
// change was a direct result of a user event. One exception is if the marked
// text changed, which could happen through a delayed IME recognition
// callback. iOS4 does not provide API access to marked text, so use
// |IsImeComposing()| as a proxy.
// callback.
bool proceed_without_user_event = false;
// The IME exception does not work for Korean text, because Korean does not
// seem to ever have marked text. It simply replaces or modifies previous
// characters as you type. Always proceed without user input on iOS7 if the
// Korean keyboard is currently active. (This Korean exception is not
// possible on iOS6 due to crbug.com/285294.)
// characters as you type. Always proceed without user input if the
// Korean keyboard is currently active.
NSString* current_language = [[field_ textInputMode] primaryLanguage];
if ([current_language hasPrefix:@"ko-"]) {
......@@ -669,13 +668,11 @@ void OmniboxViewIOS::UpdateSchemeStyle(const gfx::Range& range) {
// strikethrough attribute, typing and setting text without strikethrough
// attribute will still result in strikethrough. The following is a
// workaround that prevents crossing out the first character.
if (base::ios::IsRunningOnOrLater(11, 0, 0)) {
if (strikethroughRange.location == 0 && strikethroughRange.length > 0) {
strikethroughRange.location += 1;
strikethroughRange.length -= 1;
}
}
}
// Add a strikethrough through the scheme.
[attributing_display_string_
......@@ -761,8 +758,8 @@ void OmniboxViewIOS::ClearText() {
RemoveQueryRefinementChip();
} else {
// Otherwise, just remove the text in the omnibox.
// Since iOS 6, calling |setText| does not trigger |textDidChange| so it
// must be called explicitly.
// Calling -[UITextField setText:] does not trigger
// -[id<UITextFieldDelegate> textDidChange] so it must be called explicitly.
OnClear();
[field_ setText:@""];
OnDidChange(YES);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment