diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-30 16:33:43 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-30 16:33:43 +0000 |
commit | d6b68765f42ed51220dbf8dfad98b306c172f3b7 (patch) | |
tree | 5b41f293151382823604867d41225e7acd71d6a1 | |
parent | e9e90603f51e4274d5a5363708cb720400d5186a (diff) | |
download | chromium_src-d6b68765f42ed51220dbf8dfad98b306c172f3b7.zip chromium_src-d6b68765f42ed51220dbf8dfad98b306c172f3b7.tar.gz chromium_src-d6b68765f42ed51220dbf8dfad98b306c172f3b7.tar.bz2 |
Merge 220126 "[Android] Index argument range check for GetPrepop..."
> [Android] Index argument range check for GetPrepopulatedTemplateUrlAt.
>
> BUG=278480
> NOTRY=true
>
> Review URL: https://chromiumcodereview.appspot.com/22891027
TBR=kkimlabs@chromium.org
Review URL: https://codereview.chromium.org/23531018
git-svn-id: svn://svn.chromium.org/chrome/branches/1599/src@220597 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java | 7 |
1 files changed, 6 insertions, 1 deletions
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 ee26e4c..4ea0c30 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 @@ -127,8 +127,13 @@ public class TemplateUrlService { * @return {@link TemplateUrlService.TemplateUrl} for the default search engine. */ public TemplateUrl getDefaultSearchEngineTemplateUrl() { + if (!isLoaded()) return null; + + int defaultSearchEngineIndex = getDefaultSearchEngineIndex(); + assert defaultSearchEngineIndex >= 0; + return nativeGetPrepopulatedTemplateUrlAt( - mNativeTemplateUrlServiceAndroid, getDefaultSearchEngineIndex()); + mNativeTemplateUrlServiceAndroid, defaultSearchEngineIndex); } public void setSearchEngine(int selectedIndex) { |