Commit 8e6b81db authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

Update keyboard accessory style to match specs (part 2)

Changes in this CL:
- added a drop shadow
- added a divider at the top of the accessory sheet
- centered text for accessory options (e.g. Manage passwords...)

Bug: 856180, 887258
Change-Id: I7b71670ef551d8d5f86501ba47011ae590323676
Reviewed-on: https://chromium-review.googlesource.com/1225803
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Reviewed-by: default avatarFriedrich Horschig [CEST] <fhorschig@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592727}
parent 63d23fa9
......@@ -6,31 +6,47 @@
<org.chromium.chrome.browser.autofill.keyboard_accessory.KeyboardAccessoryView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/keyboard_accessory"
android:layout_gravity="start|bottom"
android:background="@color/modern_grey_100"
android:contentDescription="@string/autofill_keyboard_accessory_content_description"
android:fillViewport="true"
android:scrollbars="none"
android:visibility="gone"
android:orientation="horizontal"
android:layout_height="@dimen/keyboard_accessory_height"
android:orientation="vertical"
android:layout_height="@dimen/keyboard_accessory_height_with_shadow"
android:layout_width="match_parent"
android:paddingEnd="0dp"
android:clickable="true"
android:focusable="true">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
app:tabIndicatorHeight="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/accessory_shadow"
android:layout_width="match_parent"
android:layout_height="@dimen/keyboard_accessory_shadow"
android:src="@drawable/modern_toolbar_shadow"
android:scaleType="fitXY"
android:scaleY="-1"
tools:ignore="ContentDescription" />
<View style="@style/VerticalDivider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/keyboard_accessory_height"
android:layout_gravity="start|bottom"
android:orientation="horizontal"
android:background="@color/modern_grey_100">
<android.support.v7.widget.RecyclerView
android:id="@+id/actions_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
app:tabIndicatorHeight="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<View style="@style/VerticalDivider" />
<android.support.v7.widget.RecyclerView
android:id="@+id/actions_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</LinearLayout>
</org.chromium.chrome.browser.autofill.keyboard_accessory.KeyboardAccessoryView>
......@@ -31,7 +31,7 @@
android:id="@+id/keyboard_accessory_stub"
android:inflatedId="@+id/keyboard_accessory"
android:layout="@layout/keyboard_accessory"
android:layout_height="@dimen/keyboard_accessory_height"
android:layout_height="@dimen/keyboard_accessory_height_with_shadow"
android:layout_width="match_parent"
android:layout_gravity="start|bottom"/>
......
......@@ -5,12 +5,10 @@
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:fillViewport="true"
android:gravity="center_vertical"
android:gravity="center_vertical|start"
android:textAppearance="@style/BlackHint1"
android:minHeight="48dp"
android:layout_height="wrap_content"
......
......@@ -5,12 +5,12 @@
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:fillViewport="true"
android:layout_height="48dp"
android:minHeight="48dp"
android:gravity="center_vertical|start"
android:textAppearance="@style/BlackTitle1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="?android:attr/selectableItemBackground"/>
\ No newline at end of file
android:background="?android:attr/selectableItemBackground"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<View style="@style/HorizontalDivider"
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingBottom="8dp"/>
\ No newline at end of file
......@@ -128,7 +128,9 @@
<dimen name="keyboard_accessory_action_padding">16dp</dimen>
<dimen name="keyboard_accessory_half_padding">6dp</dimen>
<dimen name="keyboard_accessory_height">48dp</dimen>
<dimen name="keyboard_accessory_height_with_shadow">50dp</dimen>
<dimen name="keyboard_accessory_padding">6dp</dimen>
<dimen name="keyboard_accessory_shadow">2dp</dimen>
<dimen name="keyboard_accessory_sheet_height">330dp</dimen>
<dimen name="keyboard_accessory_suggestion_padding">16dp</dimen>
<dimen name="keyboard_accessory_suggestion_height">48dp</dimen>
......
......@@ -249,6 +249,14 @@ public class KeyboardAccessoryData {
return new Item(ItemType.OPTION, caption, contentDescription, false, callback, null);
}
/**
* Creates an Item of type {@link ItemType#TOP_DIVIDER}. A horizontal line meant to be
* displayed at the top of the accessory sheet.
*/
public static Item createTopDivider() {
return new Item(ItemType.TOP_DIVIDER, null, null, false, null, null);
}
/**
* Creates a new item.
* @param type Type of the item (e.g. non-clickable LABEL or clickable SUGGESTION).
......
......@@ -119,6 +119,9 @@ class PasswordAccessoryBridge {
nativeOnOptionSelected(mNativeView, item.getCaption());
});
continue;
case ItemType.TOP_DIVIDER:
items[i] = Item.createTopDivider();
continue;
}
assert false : "Cannot create item for type '" + type[i] + "'.";
}
......
......@@ -61,6 +61,11 @@ class PasswordAccessorySheetViewBinder {
LayoutInflater.from(parent.getContext())
.inflate(R.layout.password_accessory_sheet_option, parent,
false));
case ItemType.TOP_DIVIDER:
return new ItemViewHolder(
LayoutInflater.from(parent.getContext())
.inflate(R.layout.password_accessory_sheet_top_divider, parent,
false));
}
assert false : viewType;
return null;
......
......@@ -376,6 +376,10 @@ std::vector<Item> PasswordAccessoryController::CreateViewItems(
std::vector<Item> items;
base::string16 passwords_title_str;
// Create a horizontal divider line before the title.
items.emplace_back(base::string16(), base::string16(), false,
Item::Type::TOP_DIVIDER);
// Create the title element
passwords_title_str = l10n_util::GetStringFUTF16(
suggestions.empty()
......
......@@ -146,6 +146,13 @@ MATCHER_P(MatchesOption, text, PrintItem(text, text, false, ItemType::OPTION)) {
arg.content_description == text && arg.itemType == ItemType::OPTION;
}
// Compares whether a given AccessoryItem is a label with the given text.
MATCHER(IsTopDivider, "is a top divider") {
return arg.text.empty() && arg.is_password == false &&
arg.content_description.empty() &&
arg.itemType == ItemType::TOP_DIVIDER;
}
// Compares whether a given AccessoryItem had the given properties.
MATCHER_P4(MatchesItem,
text,
......@@ -341,14 +348,15 @@ TEST_F(PasswordAccessoryControllerTest, TransformsMatchesToSuggestions) {
controller()->SavePasswordsForOrigin({CreateEntry("Ben", "S3cur3").first},
url::Origin::Create(GURL(kExampleSite)));
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -362,7 +370,7 @@ TEST_F(PasswordAccessoryControllerTest, HintsToEmptyUserNames) {
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(no_user_str(), no_user_str(), false,
ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str(no_user_str()),
......@@ -380,30 +388,31 @@ TEST_F(PasswordAccessoryControllerTest, SortsAlphabeticalDuringTransform) {
CreateEntry("Alf", "PWD").first, CreateEntry("Cat", "M1@u").first},
url::Origin::Create(GURL(kExampleSite)));
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Alf"), ASCIIToUTF16("Alf"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("PWD"), password_for_str("Alf"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Cat"), ASCIIToUTF16("Cat"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M1@u"), password_for_str("Cat"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Zebra"), ASCIIToUTF16("Zebra"),
false, ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M3h"), password_for_str("Zebra"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Alf"), ASCIIToUTF16("Alf"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("PWD"), password_for_str("Alf"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Cat"), ASCIIToUTF16("Cat"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M1@u"), password_for_str("Cat"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
MatchesItem(ASCIIToUTF16("Zebra"), ASCIIToUTF16("Zebra"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M3h"), password_for_str("Zebra"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -415,14 +424,15 @@ TEST_F(PasswordAccessoryControllerTest, RepeatsSuggestionsForSameFrame) {
url::Origin::Create(GURL(kExampleSite)));
// Pretend that any input in the same frame was focused.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -435,9 +445,9 @@ TEST_F(PasswordAccessoryControllerTest, ProvidesEmptySuggestionsMessage) {
EXPECT_CALL(
*view(),
OnItemsAvailable(
ElementsAre(MatchesLabel(passwords_empty_str(kExampleDomain)),
IsDivider(), MatchesOption(manage_passwords_str()))));
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_empty_str(kExampleDomain)),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -524,14 +534,15 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) {
url::Origin::Create(GURL(kExampleSite)));
// Pretend a username field was focused. This should result in non-interactive
// suggestion.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -539,14 +550,15 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) {
// Pretend that we focus a password field now: By triggering a refresh with
// |is_password_field| set to true, all suggestions should become interactive.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -556,14 +568,15 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) {
TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) {
controller()->SavePasswordsForOrigin({CreateEntry("Ben", "S3cur3").first},
url::Origin::Create(GURL(kExampleSite)));
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -571,14 +584,15 @@ TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) {
controller()->SavePasswordsForOrigin({CreateEntry("Alf", "M3lm4k").first},
url::Origin::Create(GURL(kExampleSite)));
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Alf"), ASCIIToUTF16("Alf"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M3lm4k"), password_for_str("Alf"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Alf"), ASCIIToUTF16("Alf"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("M3lm4k"), password_for_str("Alf"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -590,14 +604,15 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) {
url::Origin::Create(GURL(kExampleSite)));
// Pretend a username field was focused. This should result in non-emtpy
// suggestions.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -605,10 +620,11 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) {
// Pretend that the focus was lost or moved to an unfillable field. Now, only
// the empty state message should be sent.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_empty_str(kExampleDomain)),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_empty_str(kExampleDomain)),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/false,
......@@ -620,14 +636,15 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) {
// This should result in non-emtpy suggestions.
controller()->SavePasswordsForOrigin({CreateEntry("Ben", "S3cur3").first},
url::Origin::Create(GURL(kExampleSite)));
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"),
true, ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
EXPECT_CALL(
*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(), MatchesLabel(passwords_title_str(kExampleDomain)),
MatchesItem(ASCIIToUTF16("Ben"), ASCIIToUTF16("Ben"), false,
ItemType::SUGGESTION),
MatchesItem(ASCIIToUTF16("S3cur3"), password_for_str("Ben"), true,
ItemType::NON_INTERACTIVE_SUGGESTION),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
/*is_fillable=*/true,
......@@ -640,6 +657,7 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) {
// Now, only the empty state message should be sent.
EXPECT_CALL(*view(),
OnItemsAvailable(ElementsAre(
IsTopDivider(),
MatchesLabel(passwords_empty_str("random.other-site.org")),
IsDivider(), MatchesOption(manage_passwords_str()))));
controller()->RefreshSuggestionsForField(
......
......@@ -41,6 +41,10 @@ class PasswordAccessoryViewInterface {
// A single, usually static and interactive suggestion.
OPTION = 5, // e.g. the "Manage passwords..." link.
// A horizontal, non-interactive divider used to visually divide the
// accessory sheet from the accessory bar.
TOP_DIVIDER = 6,
};
// The |text| is caption of the item and what will be filled if selected.
base::string16 text;
......
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