Index: third_party/WebKit/Source/modules/installedapp/InstalledAppController.h |
diff --git a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h |
index f9baebd616bfa6cddd41ba564880d45952dbac69..15844f8946ba94432c2fdc32996bfd09d2af483f 100644 |
--- a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h |
+++ b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h |
@@ -9,7 +9,12 @@ |
#include "core/frame/LocalFrame.h" |
#include "modules/ModulesExport.h" |
#include "platform/Supplementable.h" |
-#include "public/platform/modules/installedapp/WebInstalledAppClient.h" |
+#include "public/platform/WebVector.h" |
+#include "public/platform/modules/installedapp/WebRelatedApplication.h" |
+#include "public/platform/modules/installedapp/WebRelatedAppsFetcher.h" |
+#include "wtf/Vector.h" |
+ |
+#include <memory> |
namespace blink { |
@@ -25,22 +30,35 @@ class MODULES_EXPORT InstalledAppController final |
public: |
virtual ~InstalledAppController(); |
- void getInstalledApps(const WebSecurityOrigin&, |
- std::unique_ptr<AppInstalledCallbacks>); |
+ // Gets a list of related apps from a particular origin's manifest that belong |
+ // to the current underlying platform, and are installed. |
+ // TODO(mgiuca): Don't use a Web* type here. DO NOT SUBMIT. |
+ void getInstalledRelatedApps(const WebSecurityOrigin&, |
+ std::unique_ptr<AppInstalledCallbacks>); |
- static void provideTo(LocalFrame&, WebInstalledAppClient*); |
+ static void provideTo(LocalFrame&, WebRelatedAppsFetcher*); |
static InstalledAppController* from(LocalFrame&); |
static const char* supplementName(); |
DECLARE_VIRTUAL_TRACE(); |
private: |
- InstalledAppController(LocalFrame&, WebInstalledAppClient*); |
+ class GetRelatedAppsCallbacks; |
+ |
+ InstalledAppController(LocalFrame&, WebRelatedAppsFetcher*); |
// Inherited from ContextLifecycleObserver. |
void contextDestroyed(ExecutionContext*) override; |
- WebInstalledAppClient* m_client; |
+ // For a given security origin, takes a set of related applications and |
+ // filters them by those which belong to the current underlying platform, and |
+ // are actually installed. Passes the filtered list to the callback. |
+ void filterByInstalledApps( |
+ const blink::WebSecurityOrigin&, |
+ const blink::WebVector<blink::WebRelatedApplication>&, |
+ std::unique_ptr<blink::AppInstalledCallbacks>); |
+ |
+ WebRelatedAppsFetcher* m_relatedAppsFetcher; |
}; |
} // namespace blink |