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_
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"
20 class AppBannerClient
: public content::RenderFrameObserver
,
21 public blink::WebAppBannerClient
{
23 explicit AppBannerClient(content::RenderFrame
* render_frame
);
24 virtual ~AppBannerClient();
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
>
45 DISALLOW_COPY_AND_ASSIGN(AppBannerClient
);
48 #endif // CHROME_RENDERER_BANNERS_APP_BANNER_CLIENT_H_