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

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

Issue 2488573002: Refactor getInstalledRelatedApps code and add manifest logic and tests. (Closed)
Patch Set: Use SecurityOrigin, not WebSecurityOrigin. 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..ba73fc4917527fb0c66ea84f6ba6d6a99a2ee467 100644
--- a/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h
+++ b/third_party/WebKit/Source/modules/installedapp/InstalledAppController.h
@@ -9,11 +9,17 @@
#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/RefPtr.h"
+#include "wtf/Vector.h"
+
+#include <memory>
namespace blink {
-class WebSecurityOrigin;
+class SecurityOrigin;
class MODULES_EXPORT InstalledAppController final
: public GarbageCollectedFinalized<InstalledAppController>,
@@ -25,22 +31,33 @@ 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(WTF::RefPtr<SecurityOrigin>,
+ 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(WTF::RefPtr<SecurityOrigin>,
+ const WebVector<WebRelatedApplication>&,
+ std::unique_ptr<AppInstalledCallbacks>);
+
+ WebRelatedAppsFetcher* m_relatedAppsFetcher;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698