Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / renderer / banners / app_banner_client.h
blob7169baad8fa4d8c67d1ab2b151b849614f06f2b8
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.
5 #ifndef CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_
6 #define CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_
8 #include <stdint.h>
9 #include <string>
11 #include "base/id_map.h"
12 #include "content/public/renderer/render_frame_observer.h"
13 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClient.h"
14 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerPromptResult.h"
16 namespace IPC {
17 class Message;
18 } // namespace IPC
20 class AppBannerClient : public content::RenderFrameObserver,
21 public blink::WebAppBannerClient {
22 public:
23 explicit AppBannerClient(content::RenderFrame* render_frame);
24 virtual ~AppBannerClient();
26 private:
27 // content::RenderFrame::Observer implementation.
28 bool OnMessageReceived(const IPC::Message& message) override;
30 // WebAppBannerClient implementation.
31 void registerBannerCallbacks(int request_id,
32 blink::WebAppBannerCallbacks*) override;
34 void showAppBanner(int request_id);
36 void ResolveEvent(int request_id,
37 const std::string& platform,
38 const blink::WebAppBannerPromptResult::Outcome& outcome);
39 void OnBannerAccepted(int request_id, const std::string& platform);
40 void OnBannerDismissed(int request_id);
42 IDMap<blink::WebAppBannerCallbacks, IDMapOwnPointer>
43 banner_callbacks_;
45 DISALLOW_COPY_AND_ASSIGN(AppBannerClient);
48 #endif // CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_