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

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

Issue 1756793004: Chrome-side patch for IsAppInstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@splitpatch2
Patch Set: Created 4 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: 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..779748ed81ce098a71cbc172fffacd010a47f726
--- /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/WebInstalledApp.h"
+
+namespace content {
+
+class ServiceRegistry;
+struct Manifest;
+
+class CONTENT_EXPORT InstalledAppDispatcher
+ : public RenderFrameObserver,
+ public NON_EXPORTED_BASE(blink::WebInstalledApp) {
+ public:
+ explicit InstalledAppDispatcher(RenderFrame* render_frame,
+ ServiceRegistry* service_registry);
+ ~InstalledAppDispatcher() override;
+
+ void getInstalledRelatedApps(const blink::WebSecurityOrigin&,
+ blink::WebPassOwnPtr<blink::AppInstalledCallbacks>) override;
+
+ private:
+ content::InstalledAppProviderPtr& GetProvider();
+
+ void OnGetManifest(scoped_ptr<blink::AppInstalledCallbacks> callbacks,
+ const blink::WebSecurityOrigin& origin,
+ const Manifest& manifest);
+
+ void OnFilterInstalledApps(scoped_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