| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_ | |
| 6 #define CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/id_map.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "content/public/renderer/render_frame_observer.h" | |
| 14 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClie
nt.h" | |
| 15 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerProm
ptResult.h" | |
| 16 | |
| 17 namespace IPC { | |
| 18 class Message; | |
| 19 } // namespace IPC | |
| 20 | |
| 21 class AppBannerClient : public content::RenderFrameObserver, | |
| 22 public blink::WebAppBannerClient { | |
| 23 public: | |
| 24 explicit AppBannerClient(content::RenderFrame* render_frame); | |
| 25 ~AppBannerClient() override; | |
| 26 | |
| 27 private: | |
| 28 // content::RenderFrameObserver implementation. | |
| 29 void OnDestruct() override; | |
| 30 bool OnMessageReceived(const IPC::Message& message) override; | |
| 31 | |
| 32 // WebAppBannerClient implementation. | |
| 33 void registerBannerCallbacks(int request_id, | |
| 34 blink::WebAppBannerCallbacks*) override; | |
| 35 | |
| 36 void showAppBanner(int request_id) override; | |
| 37 | |
| 38 void ResolveEvent(int request_id, | |
| 39 const std::string& platform, | |
| 40 const blink::WebAppBannerPromptResult::Outcome& outcome); | |
| 41 void OnBannerAccepted(int request_id, const std::string& platform); | |
| 42 void OnBannerDismissed(int request_id); | |
| 43 | |
| 44 IDMap<blink::WebAppBannerCallbacks, IDMapOwnPointer> | |
| 45 banner_callbacks_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(AppBannerClient); | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_ | |
| OLD | NEW |