Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef InstalledAppController_h | 5 #ifndef InstalledAppController_h |
| 6 #define InstalledAppController_h | 6 #define InstalledAppController_h |
| 7 | 7 |
| 8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| 11 #include "platform/Supplementable.h" | 11 #include "platform/Supplementable.h" |
| 12 #include "public/platform/WebVector.h" | 12 #include "public/platform/WebVector.h" |
| 13 #include "public/platform/modules/installedapp/WebRelatedApplication.h" | 13 #include "public/platform/modules/installedapp/WebRelatedApplication.h" |
| 14 #include "public/platform/modules/installedapp/WebRelatedAppsFetcher.h" | 14 #include "public/platform/modules/installedapp/WebRelatedAppsFetcher.h" |
| 15 #include "public/platform/modules/installedapp/installed_app_provider.mojom-blin k.h" | |
| 16 #include "public/platform/modules/installedapp/related_application.mojom-blink.h " | |
| 15 #include "wtf/RefPtr.h" | 17 #include "wtf/RefPtr.h" |
| 16 #include "wtf/Vector.h" | 18 #include "wtf/Vector.h" |
| 17 | 19 |
| 18 #include <memory> | 20 #include <memory> |
| 19 | 21 |
| 20 namespace blink { | 22 namespace blink { |
| 21 | 23 |
| 22 class SecurityOrigin; | 24 class SecurityOrigin; |
| 23 | 25 |
| 24 class MODULES_EXPORT InstalledAppController final | 26 class MODULES_EXPORT InstalledAppController final |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 50 // Inherited from ContextLifecycleObserver. | 52 // Inherited from ContextLifecycleObserver. |
| 51 void contextDestroyed(ExecutionContext*) override; | 53 void contextDestroyed(ExecutionContext*) override; |
| 52 | 54 |
| 53 // For a given security origin, takes a set of related applications and | 55 // For a given security origin, takes a set of related applications and |
| 54 // filters them by those which belong to the current underlying platform, and | 56 // filters them by those which belong to the current underlying platform, and |
| 55 // are actually installed. Passes the filtered list to the callback. | 57 // are actually installed. Passes the filtered list to the callback. |
| 56 void filterByInstalledApps(WTF::RefPtr<SecurityOrigin>, | 58 void filterByInstalledApps(WTF::RefPtr<SecurityOrigin>, |
| 57 const WebVector<WebRelatedApplication>&, | 59 const WebVector<WebRelatedApplication>&, |
| 58 std::unique_ptr<AppInstalledCallbacks>); | 60 std::unique_ptr<AppInstalledCallbacks>); |
| 59 | 61 |
| 62 // Callback from the InstalledAppProvider mojo service. | |
| 63 void OnFilterInstalledApps(std::unique_ptr<blink::AppInstalledCallbacks>, | |
| 64 WTF::Vector<mojom::blink::RelatedApplicationPtr>); | |
| 65 | |
| 66 WeakMember<LocalFrame> m_frame; | |
|
haraken
2017/02/23 08:35:51
You can use supplementable(), which will return a
Matt Giuca
2017/03/02 05:45:33
Done. Thanks for the suggestion.
| |
| 67 | |
| 68 // Handle to the InstalledApp mojo service. | |
| 69 mojom::blink::InstalledAppProviderPtr m_provider = nullptr; | |
| 70 | |
| 60 WebRelatedAppsFetcher* m_relatedAppsFetcher; | 71 WebRelatedAppsFetcher* m_relatedAppsFetcher; |
| 61 }; | 72 }; |
| 62 | 73 |
| 63 } // namespace blink | 74 } // namespace blink |
| 64 | 75 |
| 65 #endif // InstalledAppController_h | 76 #endif // InstalledAppController_h |
| OLD | NEW |