Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1201)

Unified Diff: third_party/WebKit/Source/modules/installedapp/InstalledAppController.h

Issue 2488573002: Refactor getInstalledRelatedApps code and add manifest logic and tests. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..45a9f266924d2dc149b841df0108586597cf54d0 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,32 @@ 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.
+ 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*);
+ 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

Powered by Google App Engine
This is Rietveld 408576698