| Index: chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
|
| index 2bdbd77874b955fc7b1b087e8291f9a11d333aba..85a498e83bf5a2b06ccf78df96ddcc6802a1caf2 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java
|
| @@ -16,6 +16,7 @@ import java.lang.annotation.Retention;
|
| import java.lang.annotation.RetentionPolicy;
|
| import java.util.ArrayList;
|
| import java.util.List;
|
| +import java.util.Locale;
|
|
|
| /**
|
| * Android wrapper of the TemplateUrlService which provides access from the Java
|
| @@ -68,8 +69,8 @@ public class TemplateUrlService {
|
|
|
| @CalledByNative("TemplateUrl")
|
| public static TemplateUrl create(
|
| - int id, String shortName, boolean isPrepopulated, String keyword) {
|
| - return new TemplateUrl(id, shortName, isPrepopulated, keyword);
|
| + int index, String shortName, boolean isPrepopulated, String keyword) {
|
| + return new TemplateUrl(index, shortName, isPrepopulated, keyword);
|
| }
|
|
|
| public TemplateUrl(
|
| @@ -118,9 +119,21 @@ public class TemplateUrlService {
|
| public boolean equals(Object other) {
|
| if (!(other instanceof TemplateUrl)) return false;
|
| TemplateUrl otherTemplateUrl = (TemplateUrl) other;
|
| + // Explicitly excluding mTemplateUrlType as that will change if the search engine is
|
| + // set as default.
|
| return mIndex == otherTemplateUrl.mIndex
|
| + && mIsPrepopulated == otherTemplateUrl.mIsPrepopulated
|
| + && TextUtils.equals(mKeyword, otherTemplateUrl.mKeyword)
|
| && TextUtils.equals(mShortName, otherTemplateUrl.mShortName);
|
| }
|
| +
|
| + @Override
|
| + public String toString() {
|
| + return String.format(Locale.US,
|
| + "TemplateURL -- keyword: %s, short name: %s, index: %d, "
|
| + + "type: %d, prepopulated: %b",
|
| + mKeyword, mShortName, mIndex, mTemplateUrlType, mIsPrepopulated);
|
| + }
|
| }
|
|
|
| private static TemplateUrlService sService;
|
|
|