Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / banners / app_banner_infobar_delegate_desktop.h
blob854eb888a2f58715f10c73b6d164b15938f65868
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_BROWSER_BANNERS_APP_BANNER_INFOBAR_DELEGATE_DESKTOP_H_
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_INFOBAR_DELEGATE_DESKTOP_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
10 #include "components/infobars/core/confirm_infobar_delegate.h"
11 #include "content/public/common/manifest.h"
13 namespace content {
14 class WebContents;
15 } // namespace content
17 namespace extensions {
18 class BookmarkAppHelper;
19 class Extension;
20 } // namespace extensions
22 namespace infobars {
23 class InfoBar;
24 } // namespace infobars
26 namespace banners {
28 class AppBannerDataFetcherDesktop;
30 class AppBannerInfoBarDelegateDesktop : public ConfirmInfoBarDelegate {
32 public:
33 ~AppBannerInfoBarDelegateDesktop() override;
35 static infobars::InfoBar* Create(
36 scoped_refptr<AppBannerDataFetcherDesktop> fetcher,
37 content::WebContents* web_contents,
38 const content::Manifest& web_manifest,
39 extensions::BookmarkAppHelper* bookmark_app_helper,
40 int event_request_id);
42 // ConfirmInfoBarDelegate overrides.
43 base::string16 GetMessageText() const override;
44 int GetButtons() const override;
45 base::string16 GetButtonLabel(InfoBarButton button) const override;
47 bool Accept() override;
49 // InfoBarDelegate override.
50 void InfoBarDismissed() override;
52 protected:
53 AppBannerInfoBarDelegateDesktop(
54 scoped_refptr<AppBannerDataFetcherDesktop> fetcher,
55 const content::Manifest& web_manifest,
56 extensions::BookmarkAppHelper* bookmark_app_helper,
57 int event_request_id);
59 private:
60 scoped_refptr<AppBannerDataFetcherDesktop> fetcher_;
61 content::Manifest web_manifest_;
62 extensions::BookmarkAppHelper* bookmark_app_helper_;
63 int event_request_id_;
64 bool has_user_interaction_;
66 Type GetInfoBarType() const override;
67 int GetIconId() const override;
68 gfx::VectorIconId GetVectorIconId() const override;
70 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateDesktop);
73 } // namespace banners
75 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_INFOBAR_DELEGATE_DESKTOP_H_