OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
9 import org.chromium.android_webview.AwResource; | 9 import org.chromium.android_webview.AwResource; |
10 import org.chromium.content.app.AppResource; | |
11 | 10 |
12 public class AwTestResourceProvider { | 11 public class AwTestResourceProvider { |
13 private static boolean sInitialized; | 12 private static boolean sInitialized; |
14 | 13 |
15 static void registerResources(Context context) { | 14 static void registerResources(Context context) { |
16 if (sInitialized) { | 15 if (sInitialized) { |
17 return; | 16 return; |
18 } | 17 } |
19 | 18 |
20 AppResource.DRAWABLE_ICON_ACTION_BAR_SHARE = R.drawable.resource_icon; | |
21 AppResource.DRAWABLE_ICON_ACTION_BAR_WEB_SEARCH = R.drawable.resource_ic
on; | |
22 | |
23 AppResource.STRING_ACTION_BAR_SHARE = R.string.test_string; | |
24 AppResource.STRING_ACTION_BAR_WEB_SEARCH = R.string.test_string; | |
25 | |
26 AwResource.setResources(context.getResources()); | 19 AwResource.setResources(context.getResources()); |
27 | 20 |
28 AwResource.RAW_LOAD_ERROR = R.raw.blank_html; | 21 AwResource.RAW_LOAD_ERROR = R.raw.blank_html; |
29 AwResource.RAW_NO_DOMAIN = R.raw.blank_html; | 22 AwResource.RAW_NO_DOMAIN = R.raw.blank_html; |
30 | 23 |
31 AwResource.STRING_DEFAULT_TEXT_ENCODING = R.string.test_string; | 24 AwResource.STRING_DEFAULT_TEXT_ENCODING = R.string.test_string; |
32 | 25 |
33 sInitialized = true; | 26 sInitialized = true; |
34 } | 27 } |
35 } | 28 } |
OLD | NEW |