summaryrefslogtreecommitdiff
path: root/chromium/content/renderer/installedapp/related_apps_fetcher.h
blob: 73fbfc15f95ae5b759b2b33b331507a5c9a93112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2017 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.

#ifndef CONTENT_RENDERER_INSTALLEDAPP_RELATED_APPS_FETCHER_H
#define CONTENT_RENDERER_INSTALLEDAPP_RELATED_APPS_FETCHER_H

#include <string>

#include "base/compiler_specific.h"
#include "content/common/content_export.h"
#include "third_party/blink/public/platform/modules/installedapp/web_related_apps_fetcher.h"

namespace blink {
namespace mojom {
class ManifestManager;
}
}  // namespace blink

namespace content {

struct Manifest;
class ManifestManager;

class CONTENT_EXPORT RelatedAppsFetcher : public blink::WebRelatedAppsFetcher {
 public:
  explicit RelatedAppsFetcher(blink::mojom::ManifestManager* manifest_manager);
  ~RelatedAppsFetcher() override;

  // blink::WebRelatedAppsFetcher overrides:
  void GetManifestRelatedApplications(
      std::unique_ptr<blink::WebCallbacks<
          const blink::WebVector<blink::WebRelatedApplication>&,
          void>> callbacks) override;

 private:
  // Callback for when the manifest has been fetched, triggered by a call to
  // getManifestRelatedApplications.
  void OnGetManifestForRelatedApplications(
      std::unique_ptr<blink::WebCallbacks<
          const blink::WebVector<blink::WebRelatedApplication>&,
          void>> callbacks,
      const GURL& url,
      const Manifest& manifest);

  blink::mojom::ManifestManager* const manifest_manager_;

  DISALLOW_COPY_AND_ASSIGN(RelatedAppsFetcher);
};

}  // namespace content

#endif  // CONTENT_RENDERER_INSTALLEDAPP_RELATED_APPS_FETCHER_H