| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.locale; | 5 package org.chromium.chrome.browser.locale; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A Handler for changes in a given special locale. This is a JNI bridge and it
owns the native | 8 * A Handler for changes in a given special locale. This is a JNI bridge and it
owns the native |
| 9 * object. Make sure to call Destroy() after this object is not used anymore. | 9 * object. Make sure to call Destroy() after this object is not used anymore. |
| 10 */ | 10 */ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Overrides the default search provider in special locale. | 58 * Overrides the default search provider in special locale. |
| 59 */ | 59 */ |
| 60 public void overrideDefaultSearchProvider() { | 60 public void overrideDefaultSearchProvider() { |
| 61 assert mNativeSpecialLocaleHandler != 0; | 61 assert mNativeSpecialLocaleHandler != 0; |
| 62 nativeOverrideDefaultSearchProvider(mNativeSpecialLocaleHandler); | 62 nativeOverrideDefaultSearchProvider(mNativeSpecialLocaleHandler); |
| 63 } | 63 } |
| 64 | 64 |
| 65 /** |
| 66 * Sets the default search provider back to Google. |
| 67 */ |
| 68 public void setGoogleAsDefaultSearch() { |
| 69 assert mNativeSpecialLocaleHandler != 0; |
| 70 nativeSetGoogleAsDefaultSearch(mNativeSpecialLocaleHandler); |
| 71 } |
| 72 |
| 65 private static native long nativeInit(String localeId); | 73 private static native long nativeInit(String localeId); |
| 66 private static native void nativeDestroy(long nativeSpecialLocaleHandler); | 74 private static native void nativeDestroy(long nativeSpecialLocaleHandler); |
| 67 private static native boolean nativeLoadTemplateUrls(long nativeSpecialLocal
eHandler); | 75 private static native boolean nativeLoadTemplateUrls(long nativeSpecialLocal
eHandler); |
| 68 private static native void nativeRemoveTemplateUrls(long nativeSpecialLocale
Handler); | 76 private static native void nativeRemoveTemplateUrls(long nativeSpecialLocale
Handler); |
| 69 private static native void nativeOverrideDefaultSearchProvider(long nativeSp
ecialLocaleHandler); | 77 private static native void nativeOverrideDefaultSearchProvider(long nativeSp
ecialLocaleHandler); |
| 78 private static native void nativeSetGoogleAsDefaultSearch(long nativeSpecial
LocaleHandler); |
| 70 } | 79 } |
| OLD | NEW |