OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.firstrun; |
| 6 |
| 7 import android.app.Fragment; |
| 8 |
| 9 /** |
| 10 * Defines the host interface for First Run Experience pages. |
| 11 */ |
| 12 public interface FirstRunPageDelegate { |
| 13 /** |
| 14 * @return A {@link ProfileDataCache} for Android user accounts. |
| 15 */ |
| 16 ProfileDataCache getProfileDataCache(); |
| 17 |
| 18 /** |
| 19 * Advances the First Run Experience to the next page. |
| 20 * Successfully finishes FRE if the current page is the last page. |
| 21 */ |
| 22 void advanceToNextPage(); |
| 23 |
| 24 /** |
| 25 * Skips all intro pages. |
| 26 * Successfully finishes FRE if there are no non-intro pages. |
| 27 */ |
| 28 void skipIntroPages(); |
| 29 |
| 30 /** |
| 31 * Asks to re-instantiate the current page. |
| 32 * Useful to restore the "clean" state of the UI elements. |
| 33 */ |
| 34 void recreateCurrentPage(); |
| 35 |
| 36 /** |
| 37 * Unsuccessfully aborts the First Run Experience. |
| 38 * This usually means that the application will be closed. |
| 39 */ |
| 40 void abortFirstRunExperience(); |
| 41 |
| 42 /** |
| 43 * Successfully completes the First Run Experience. |
| 44 * All results will be packaged and sent over to the main activity. |
| 45 */ |
| 46 void completeFirstRunExperience(); |
| 47 |
| 48 /** |
| 49 * Notifies that the sign-in dialog is shown. |
| 50 */ |
| 51 void onSigninDialogShown(); |
| 52 |
| 53 /** |
| 54 * Notifies that the user refused to sign in (e.g. "NO, THANKS"). |
| 55 */ |
| 56 void refuseSignIn(); |
| 57 |
| 58 /** |
| 59 * Notifies that the user accepted to be signed in. |
| 60 * @param accountName An account to be signed in to. |
| 61 */ |
| 62 void acceptSignIn(String accountName); |
| 63 |
| 64 /** |
| 65 * Notifies that the user asked to show Sync Settings once the sign in |
| 66 * process is complete. |
| 67 */ |
| 68 void askToOpenSyncSettings(); |
| 69 |
| 70 /** |
| 71 * @return Whether the user has accepted Chrome Terms of Service. |
| 72 */ |
| 73 boolean didAcceptTermsOfService(); |
| 74 |
| 75 /** |
| 76 * @return Whether the "upload crash dump" setting is set to "NEVER". |
| 77 */ |
| 78 boolean isNeverUploadCrashDump(); |
| 79 |
| 80 /** |
| 81 * Notifies all interested parties that the user has accepted Chrome Terms o
f Service. |
| 82 * @param allowCrashUpload True if the user allows to upload crash dumps and
collect stats. |
| 83 */ |
| 84 void acceptTermsOfService(boolean allowCrashUpload); |
| 85 |
| 86 /** |
| 87 * Opens the Android account adder UI. |
| 88 * @param fragment A fragment that needs the account adder UI. |
| 89 */ |
| 90 void openAccountAdder(Fragment fragment); |
| 91 |
| 92 /** |
| 93 * Opens Chrome Preferences on a given page. |
| 94 * @param fragment A fragment that requested the service. |
| 95 * @param pageClassName The preferences fragment class name. |
| 96 */ |
| 97 void openChromePreferencesPage(Fragment fragment, String pageClassName); |
| 98 } |
OLD | NEW |