OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_INSTALLEDAPP_INSTALLED_APP_DISPATCHER_H |
| 6 #define CONTENT_RENDERER_INSTALLEDAPP_INSTALLED_APP_DISPATCHER_H |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "content/common/installedapp/installed_app_provider.mojom.h" |
| 13 #include "content/common/installedapp/related_application.mojom.h" |
| 14 #include "content/public/renderer/render_frame_observer.h" |
| 15 #include "third_party/WebKit/public/platform/modules/installedapp/WebInstalledAp
p.h" |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class ServiceRegistry; |
| 20 struct Manifest; |
| 21 |
| 22 class CONTENT_EXPORT InstalledAppDispatcher |
| 23 : public RenderFrameObserver, |
| 24 public NON_EXPORTED_BASE(blink::WebInstalledApp) { |
| 25 public: |
| 26 explicit InstalledAppDispatcher(RenderFrame* render_frame, |
| 27 ServiceRegistry* service_registry); |
| 28 ~InstalledAppDispatcher() override; |
| 29 |
| 30 void getInstalledRelatedApps(const blink::WebSecurityOrigin&, |
| 31 blink::WebPassOwnPtr<blink::AppInstalledCallbacks
>) override; |
| 32 |
| 33 private: |
| 34 content::InstalledAppProviderPtr& GetProvider(); |
| 35 |
| 36 void OnGetManifest(scoped_ptr<blink::AppInstalledCallbacks> callbacks, |
| 37 const blink::WebSecurityOrigin& origin, |
| 38 const Manifest& manifest); |
| 39 |
| 40 void OnFilterInstalledApps(scoped_ptr<blink::AppInstalledCallbacks> callbacks, |
| 41 mojo::Array<RelatedApplicationPtr> result); |
| 42 |
| 43 // Handle to the InstalledApp mojo service. |
| 44 content::InstalledAppProviderPtr provider_; |
| 45 |
| 46 ServiceRegistry* service_registry_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(InstalledAppDispatcher); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_RENDERER_INSTALLEDAPP_INSTALLED_APP_DISPATCHER_H |
OLD | NEW |