| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.content.res.Resources; | 7 import android.content.res.Resources; |
| 8 import android.util.SparseArray; | 8 import android.util.SparseArray; |
| 9 | 9 |
| 10 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 @CalledByNative | 62 @CalledByNative |
| 63 public static String getNoDomainPageContent() { | 63 public static String getNoDomainPageContent() { |
| 64 return getResource(sRawNoDomain, TYPE_RAW); | 64 return getResource(sRawNoDomain, TYPE_RAW); |
| 65 } | 65 } |
| 66 | 66 |
| 67 @CalledByNative | 67 @CalledByNative |
| 68 public static String getLoadErrorPageContent() { | 68 public static String getLoadErrorPageContent() { |
| 69 return getResource(sRawLoadError, TYPE_RAW); | 69 return getResource(sRawLoadError, TYPE_RAW); |
| 70 } | 70 } |
| 71 | 71 |
| 72 @CalledByNative |
| 72 public static String[] getConfigKeySystemUuidMapping() { | 73 public static String[] getConfigKeySystemUuidMapping() { |
| 73 // No need to cache, since this should be called only once. | 74 // No need to cache, since this should be called only once. |
| 74 return sResources.getStringArray(sStringArrayConfigKeySystemUUIDMapping)
; | 75 return sResources.getStringArray(sStringArrayConfigKeySystemUUIDMapping)
; |
| 75 } | 76 } |
| 76 | 77 |
| 77 private static String getResource(int resid, int type) { | 78 private static String getResource(int resid, int type) { |
| 78 assert resid != 0; | 79 assert resid != 0; |
| 79 assert sResources != null; | 80 assert sResources != null; |
| 80 assert sResourceCache != null; | 81 assert sResourceCache != null; |
| 81 | 82 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (isr != null) { | 121 if (isr != null) { |
| 121 isr.close(); | 122 isr.close(); |
| 122 } | 123 } |
| 123 } catch (IOException e) { | 124 } catch (IOException e) { |
| 124 // Nothing to do if close() fails. | 125 // Nothing to do if close() fails. |
| 125 } | 126 } |
| 126 } | 127 } |
| 127 return result; | 128 return result; |
| 128 } | 129 } |
| 129 } | 130 } |
| OLD | NEW |