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

Unified Diff: content/renderer/installedapp/installed_app_dispatcher.h

Issue 2461303002: WIP for Get Installed Related Apps (Closed)
Patch Set: Created 4 years, 2 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: content/renderer/installedapp/installed_app_dispatcher.h
diff --git a/content/renderer/installedapp/installed_app_dispatcher.h b/content/renderer/installedapp/installed_app_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0603a4c6ffd630eb73cf7e1197b9ea730c6ef48
--- /dev/null
+++ b/content/renderer/installedapp/installed_app_dispatcher.h
@@ -0,0 +1,53 @@
+// Copyright 2016 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_INSTALLED_APP_DISPATCHER_H
+#define CONTENT_RENDERER_INSTALLEDAPP_INSTALLED_APP_DISPATCHER_H
+
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "content/common/content_export.h"
+#include "content/common/installedapp/installed_app_provider.mojom.h"
+#include "content/common/installedapp/related_application.mojom.h"
+#include "content/public/renderer/render_frame_observer.h"
+#include "third_party/WebKit/public/platform/modules/installedapp/WebInstalledAppClient.h"
+
+namespace content {
+
+class ServiceRegistry;
+struct Manifest;
+
+class CONTENT_EXPORT InstalledAppDispatcher
+ : public RenderFrameObserver,
+ public NON_EXPORTED_BASE(blink::WebInstalledAppClient) {
+ public:
+ explicit InstalledAppDispatcher(RenderFrame* render_frame,
+ ServiceRegistry* service_registry);
+ ~InstalledAppDispatcher() override;
+
+ void getInstalledRelatedApps(const blink::WebSecurityOrigin&,
+ std::unique_ptr<blink::AppInstalledCallbacks>) override;
+
+ private:
+ content::InstalledAppProviderPtr& GetProvider();
+
+ void OnGetManifest(std::unique_ptr<blink::AppInstalledCallbacks> callbacks,
+ const blink::WebSecurityOrigin& origin,
+ const Manifest& manifest);
+
+ void OnFilterInstalledApps(std::unique_ptr<blink::AppInstalledCallbacks> callbacks,
+ mojo::Array<RelatedApplicationPtr> result);
+
+ // Handle to the InstalledApp mojo service.
+ content::InstalledAppProviderPtr provider_;
+
+ ServiceRegistry* service_registry_;
+
+ DISALLOW_COPY_AND_ASSIGN(InstalledAppDispatcher);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_INSTALLEDAPP_INSTALLED_APP_DISPATCHER_H

Powered by Google App Engine
This is Rietveld 408576698