Commit e3dc0aaf authored by Ian Vollick's avatar Ian Vollick Committed by Commit Bot

Plumb resource IDs for ActionNames

These are easier to use than strings.

No-Presubmit: true
Bug: 961143
Change-Id: I00d9c83c7687a5e109bcc4def5fd7002908ad751
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1607320
Commit-Queue: Ian Vollick <vollick@chromium.org>
Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659171}
parent 683075cc
...@@ -135,9 +135,9 @@ public abstract class InfoBar implements InfoBarView { ...@@ -135,9 +135,9 @@ public abstract class InfoBar implements InfoBarView {
} }
ActionNames names = new ActionNames(); ActionNames names = new ActionNames();
names.cancel = mContext.getResources().getString(R.string.cancel); names.cancel = R.string.cancel;
names.select = mContext.getResources().getString(R.string.select); names.select = R.string.select;
names.alt = ""; names.alt = 0;
PropertyModel model = PropertyModel model =
new PropertyModel.Builder(TouchlessDialogProperties.ALL_DIALOG_KEYS) new PropertyModel.Builder(TouchlessDialogProperties.ALL_DIALOG_KEYS)
.with(TouchlessDialogProperties.IS_FULLSCREEN, false) .with(TouchlessDialogProperties.IS_FULLSCREEN, false)
......
...@@ -158,9 +158,9 @@ public class TouchlessContextMenuManager extends ContextMenuManager { ...@@ -158,9 +158,9 @@ public class TouchlessContextMenuManager extends ContextMenuManager {
PropertyModel.Builder builder = PropertyModel.Builder builder =
new PropertyModel.Builder(TouchlessDialogProperties.ALL_DIALOG_KEYS); new PropertyModel.Builder(TouchlessDialogProperties.ALL_DIALOG_KEYS);
ActionNames names = new ActionNames(); ActionNames names = new ActionNames();
names.cancel = context.getResources().getString(org.chromium.chrome.R.string.cancel); names.cancel = org.chromium.chrome.R.string.cancel;
names.select = context.getResources().getString(org.chromium.chrome.R.string.select); names.select = org.chromium.chrome.R.string.select;
names.alt = ""; names.alt = 0;
builder.with(TouchlessDialogProperties.IS_FULLSCREEN, true) builder.with(TouchlessDialogProperties.IS_FULLSCREEN, true)
.with(ModalDialogProperties.CONTROLLER, .with(ModalDialogProperties.CONTROLLER,
new ModalDialogProperties.Controller() { new ModalDialogProperties.Controller() {
......
...@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.touchless.dialog; ...@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.touchless.dialog;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.IntDef; import android.support.annotation.IntDef;
import android.support.annotation.StringRes;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import org.chromium.ui.modaldialog.ModalDialogProperties; import org.chromium.ui.modaldialog.ModalDialogProperties;
...@@ -67,9 +68,9 @@ public class TouchlessDialogProperties { ...@@ -67,9 +68,9 @@ public class TouchlessDialogProperties {
* Struct-like class for holding the Names for the dialog actions. * Struct-like class for holding the Names for the dialog actions.
*/ */
public static class ActionNames { public static class ActionNames {
public String cancel; public @StringRes int cancel;
public String select; public @StringRes int select;
public String alt; public @StringRes int alt;
} }
/** /**
......
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