// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.firstrun;

import android.app.Fragment;

/**
 * Defines the host interface for First Run Experience pages.
 */
public interface FirstRunPageDelegate {
    /**
     * @return A {@link ProfileDataCache} for Android user accounts.
     */
    ProfileDataCache getProfileDataCache();

    /**
     * Advances the First Run Experience to the next page.
     * Successfully finishes FRE if the current page is the last page.
     */
    void advanceToNextPage();

    /**
     * Skips all intro pages.
     * Successfully finishes FRE if there are no non-intro pages.
     */
    void skipIntroPages();

    /**
     * Asks to re-instantiate the current page.
     * Useful to restore the "clean" state of the UI elements.
     */
    void recreateCurrentPage();

    /**
     * Unsuccessfully aborts the First Run Experience.
     * This usually means that the application will be closed.
     */
    void abortFirstRunExperience();

    /**
     * Successfully completes the First Run Experience.
     * All results will be packaged and sent over to the main activity.
     */
    void completeFirstRunExperience();

    /**
     * Notifies that the sign-in dialog is shown.
     */
    void onSigninDialogShown();

    /**
     * Notifies that the user refused to sign in (e.g. "NO, THANKS").
     */
    void refuseSignIn();

    /**
     * Notifies that the user accepted to be signed in.
     * @param accountName An account to be signed in to.
     */
    void acceptSignIn(String accountName);

    /**
     * Notifies that the user asked to show Sync Settings once the sign in
     * process is complete.
     */
    void askToOpenSyncSettings();

    /**
     * @return Whether the user has accepted Chrome Terms of Service.
     */
    boolean didAcceptTermsOfService();

    /**
     * @return Whether the "upload crash dump" setting is set to "NEVER".
     */
    boolean isNeverUploadCrashDump();

    /**
     * Notifies all interested parties that the user has accepted Chrome Terms of Service.
     * @param allowCrashUpload True if the user allows to upload crash dumps and collect stats.
     */
    void acceptTermsOfService(boolean allowCrashUpload);

    /**
     * Opens the Android account adder UI.
     * @param fragment A fragment that needs the account adder UI.
     */
    void openAccountAdder(Fragment fragment);

    /**
     * Opens Chrome Preferences on a given page.
     * @param fragment A fragment that requested the service.
     * @param pageClassName The preferences fragment class name.
     */
    void openChromePreferencesPage(Fragment fragment, String pageClassName);
}

@@ -2554,205 +2554,322 @@
   * 
-Opens Chrome Preferences on a given page.%0A     * @param fragment A fragment that requested the service.%0A     * @param pageClassName The preferences fragment class name.%0A     */%0A    void o
+Show an EmbedContentViewActivity with a given title and a URL.%0A     * @param title Resource id for the title of the EmbedContentViewActivity.%0A     * @param url Resource id for the URL of the EmbedContentViewActivity.%0A     */%0A    void showEmbedContentViewActivity(int title, int url);%0A%0A    /**%0A     * O
 pen
+s 
 Chrome
-P
+ p
 refe
@@ -2878,53 +2878,70 @@
 nces
-Page(Fragment fragment, String pageClassName
+ for document mode.%0A     */%0A    void openDocumentModeSettings(
 );%0A%7D
-%0A

Update FirstRunPageDelegate interface.