1// Copyright 2014 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.browser.banners;
6
7/**
8 * Fetches data about the given app.
9 */
10public abstract class AppDetailsDelegate {
11    /**
12     * Class to inform when the app's details have been retrieved.
13     */
14    public interface Observer {
15        /**
16         * Called when the task has finished.
17         * @param data Data about the requested package.  Will be null if retrieval failed.
18         */
19        public void onAppDetailsRetrieved(AppData data);
20    }
21
22    /**
23     * Retrieves information about the given package asynchronously.  When details have been
24     * retrieved, the observer is alerted.
25     * @param observer    Informed when the app details have been received.
26     * @param url         URL of the page requesting a banner.
27     * @param packageName Name of the app's package.
28     * @param iconSize    Size of the icon to retrieve.
29     */
30    protected abstract void getAppDetailsAsynchronously(
31            Observer observer, String url, String packageName, int iconSize);
32
33    /**
34     * Destroy the delegate, cleaning up any open hooks.
35     */
36    public abstract void destroy();
37}
38