OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.partnercustomizations; | 5 package org.chromium.chrome.browser.partnercustomizations; |
6 | 6 |
7 import android.content.ContentResolver; | 7 import android.content.ContentResolver; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
10 import android.content.pm.ProviderInfo; | 10 import android.content.pm.ProviderInfo; |
11 import android.database.Cursor; | 11 import android.database.Cursor; |
12 import android.net.Uri; | 12 import android.net.Uri; |
13 import android.os.AsyncTask; | 13 import android.os.AsyncTask; |
14 import android.text.TextUtils; | 14 import android.text.TextUtils; |
15 import android.util.Log; | 15 import android.util.Log; |
16 | 16 |
17 import org.chromium.base.CommandLine; | 17 import org.chromium.base.CommandLine; |
18 import org.chromium.base.ThreadUtils; | 18 import org.chromium.base.ThreadUtils; |
19 import org.chromium.base.VisibleForTesting; | 19 import org.chromium.base.VisibleForTesting; |
| 20 import org.chromium.base.annotations.CalledByNative; |
20 import org.chromium.chrome.browser.ChromeSwitches; | 21 import org.chromium.chrome.browser.ChromeSwitches; |
21 import org.chromium.chrome.browser.UrlConstants; | 22 import org.chromium.chrome.browser.UrlConstants; |
22 import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksReader; | 23 import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksReader; |
23 | 24 |
24 import java.util.ArrayList; | 25 import java.util.ArrayList; |
25 import java.util.List; | 26 import java.util.List; |
26 | 27 |
27 /** | 28 /** |
28 * Reads and caches partner browser customizations information if it exists. | 29 * Reads and caches partner browser customizations information if it exists. |
29 */ | 30 */ |
(...skipping 20 matching lines...) Expand all Loading... |
50 * this method reads is not initialized until the asynchronous initi
alization of this | 51 * this method reads is not initialized until the asynchronous initi
alization of this |
51 * class has been completed. | 52 * class has been completed. |
52 */ | 53 */ |
53 public static boolean isHomepageProviderAvailableAndEnabled() { | 54 public static boolean isHomepageProviderAvailableAndEnabled() { |
54 return !TextUtils.isEmpty(getHomePageUrl()); | 55 return !TextUtils.isEmpty(getHomePageUrl()); |
55 } | 56 } |
56 | 57 |
57 /** | 58 /** |
58 * @return Whether incognito mode is disabled by the partner. | 59 * @return Whether incognito mode is disabled by the partner. |
59 */ | 60 */ |
| 61 @CalledByNative |
60 public static boolean isIncognitoDisabled() { | 62 public static boolean isIncognitoDisabled() { |
61 return sIncognitoModeDisabled; | 63 return sIncognitoModeDisabled; |
62 } | 64 } |
63 | 65 |
64 /** | 66 /** |
65 * @return Whether partner bookmarks editing is disabled by the partner. | 67 * @return Whether partner bookmarks editing is disabled by the partner. |
66 */ | 68 */ |
67 @VisibleForTesting | 69 @VisibleForTesting |
68 static boolean isBookmarksEditingDisabled() { | 70 static boolean isBookmarksEditingDisabled() { |
69 return sBookmarksEditingDisabled; | 71 return sBookmarksEditingDisabled; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 * provider or provider set it to null to disable homepage. | 289 * provider or provider set it to null to disable homepage. |
288 */ | 290 */ |
289 public static String getHomePageUrl() { | 291 public static String getHomePageUrl() { |
290 CommandLine commandLine = CommandLine.getInstance(); | 292 CommandLine commandLine = CommandLine.getInstance(); |
291 if (commandLine.hasSwitch(ChromeSwitches.PARTNER_HOMEPAGE_FOR_TESTING))
{ | 293 if (commandLine.hasSwitch(ChromeSwitches.PARTNER_HOMEPAGE_FOR_TESTING))
{ |
292 return commandLine.getSwitchValue(ChromeSwitches.PARTNER_HOMEPAGE_FO
R_TESTING); | 294 return commandLine.getSwitchValue(ChromeSwitches.PARTNER_HOMEPAGE_FO
R_TESTING); |
293 } | 295 } |
294 return sHomepage; | 296 return sHomepage; |
295 } | 297 } |
296 } | 298 } |
OLD | NEW |