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
3// found in the LICENSE file.
4
5package org.chromium.chrome.testshell;
6
7/**
8 * Observes changes to the {@link TestShellTab} class.  A {@link TestShellTabObserver} can observe
9 * multiple {@link TestShellTab} objects, as the first parameter for each method is the specific
10 * {@link TestShellTab} that is affected.  Additionally, a {@link TestShellTab} can have multiple
11 * {@link TestShellTabObserver}s.
12 *
13 * Note that this interface does not expose control methods, only observation methods.
14 */
15public interface TestShellTabObserver {
16    /**
17     * Called when the load progress of a {@link TestShellTab} has changed.
18     * @param tab      The notifying {@link TestShellTab}.
19     * @param progress The new progress amount (from 0 to 100).
20     */
21    public void onLoadProgressChanged(TestShellTab tab, int progress);
22
23    /**
24     * Called when the URL of a {@link TestShellTab} has changed.
25     * @param tab The notifying {@link TestShellTab}.
26     * @param url The new URL.
27     */
28    public void onUpdateUrl(TestShellTab tab, String url);
29
30    /**
31     * Called when the tab is about to close.
32     * @param tab The closing {@link TestShellTab}.
33     */
34    public void onCloseTab(TestShellTab tab);
35}