1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// found in the LICENSE file.
4f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
5f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_ANDROID_CONTENT_SETTINGS_POPUP_BLOCKED_INFOBAR_DELEGATE_H_
6f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#define CHROME_BROWSER_UI_ANDROID_CONTENT_SETTINGS_POPUP_BLOCKED_INFOBAR_DELEGATE_H_
7f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "components/infobars/core/confirm_infobar_delegate.h"
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "url/gurl.h"
10f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace content {
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class WebContents;
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}  // namespace content
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class HostContentSettingsMap;
16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class PopupBlockedInfoBarDelegate : public ConfirmInfoBarDelegate {
18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) public:
19a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  // Creates a popup blocked infobar and delegate and adds the infobar to
20a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  // |infobar_service|.
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static void Create(content::WebContents* web_contents, int num_popups);
22f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
23f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual ~PopupBlockedInfoBarDelegate();
24f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
25f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) private:
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  PopupBlockedInfoBarDelegate(int num_popups,
275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                              const GURL& url,
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                              HostContentSettingsMap* map);
29f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // ConfirmInfoBarDelegate:
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual int GetIconID() const OVERRIDE;
32f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual PopupBlockedInfoBarDelegate* AsPopupBlockedInfoBarDelegate() OVERRIDE;
33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetMessageText() const OVERRIDE;
34f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual int GetButtons() const OVERRIDE;
35a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual bool Accept() OVERRIDE;
37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
38f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  int num_popups_;
395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  GURL url_;
405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  HostContentSettingsMap* map_;
415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  bool can_show_popups_;
42f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
43f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(PopupBlockedInfoBarDelegate);
44f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)};
45f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
46f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // CHROME_BROWSER_UI_ANDROID_CONTENT_SETTINGS_POPUP_BLOCKED_INFOBAR_DELEGATE_H_
47