Commit 63bc7b7a authored by Justin Donnelly's avatar Justin Donnelly Committed by Commit Bot

Enable omnibox suggestion refinement arrow for URL suggestions.

This will bring the iOS suggestion UI to parity with the Android UI.
Note that there is evidence that the refinement arrows next to URLs
see a significant amount of usage (though not as much as the query
refinement arrows). See the bug for more details.

Bug: 679083
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I10aad6b630cdc7c598643a2ef35f4bd3d476ec01
Reviewed-on: https://chromium-review.googlesource.com/1033714Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554760}
parent 6e1d57f4
...@@ -168,10 +168,25 @@ UIColor* DimColorIncognito() { ...@@ -168,10 +168,25 @@ UIColor* DimColorIncognito() {
return attributedText; return attributedText;
} }
// The primary purpose of this list is to omit the "what you typed" types, since
// those are simply the input in the omnibox and copying the text back to the
// omnibox would be a noop. However, this list also omits other types that are
// deprecated or not launched on iOS.
- (BOOL)isAppendable { - (BOOL)isAppendable {
return _match.type == AutocompleteMatchType::SEARCH_HISTORY || return _match.type == AutocompleteMatchType::BOOKMARK_TITLE ||
_match.type == AutocompleteMatchType::CALCULATOR ||
_match.type == AutocompleteMatchType::HISTORY_BODY ||
_match.type == AutocompleteMatchType::HISTORY_KEYWORD ||
_match.type == AutocompleteMatchType::HISTORY_TITLE ||
_match.type == AutocompleteMatchType::HISTORY_URL ||
_match.type == AutocompleteMatchType::NAVSUGGEST ||
_match.type == AutocompleteMatchType::NAVSUGGEST_PERSONALIZED ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST || _match.type == AutocompleteMatchType::SEARCH_SUGGEST ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST_ENTITY || _match.type == AutocompleteMatchType::SEARCH_SUGGEST_ENTITY ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED ||
_match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL ||
_match.type == AutocompleteMatchType::PHYSICAL_WEB_DEPRECATED; _match.type == AutocompleteMatchType::PHYSICAL_WEB_DEPRECATED;
} }
......
...@@ -19,7 +19,7 @@ class GURL; ...@@ -19,7 +19,7 @@ class GURL;
// Some suggestions represent a URL, for example the ones from history. // Some suggestions represent a URL, for example the ones from history.
- (BOOL)isURL; - (BOOL)isURL;
// Some suggestions can be appended to omnibox text in order to refine the // Some suggestions can be appended to omnibox text in order to refine the
// query. // query or URL.
- (BOOL)isAppendable; - (BOOL)isAppendable;
// The leading image for this suggestion type (loupe, globe, etc). Values are // The leading image for this suggestion type (loupe, globe, etc). Values are
// described in AutocompleteMatchType enum. // described in AutocompleteMatchType enum.
......
...@@ -119,10 +119,10 @@ void OmniboxPopupViewIOS::OnMatchSelected( ...@@ -119,10 +119,10 @@ void OmniboxPopupViewIOS::OnMatchSelected(
void OmniboxPopupViewIOS::OnMatchSelectedForAppending( void OmniboxPopupViewIOS::OnMatchSelectedForAppending(
const AutocompleteMatch& match) { const AutocompleteMatch& match) {
// Make a defensive copy of |match.contents|, as CopyToOmnibox() will trigger // Make a defensive copy of |match.fill_into_edit|, as CopyToOmnibox() will
// a new round of autocomplete and modify |match|. // trigger a new round of autocomplete and modify |match|.
base::string16 contents(match.contents); base::string16 fill_into_edit(match.fill_into_edit);
delegate_->OnSelectedMatchForAppending(contents); delegate_->OnSelectedMatchForAppending(fill_into_edit);
} }
void OmniboxPopupViewIOS::OnMatchSelectedForDeletion( void OmniboxPopupViewIOS::OnMatchSelectedForDeletion(
......
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