Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: chrome/browser/tab_contents/confirm_infobar_delegate.h

Issue 8698016: Remove InfoBarDelegate::InfoBarClosed(), delete InfoBars directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cancelling changes. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/browser/infobars/infobar_delegate.h" 12 #include "chrome/browser/infobars/infobar_delegate.h"
13 13
14 // An interface derived from InfoBarDelegate implemented by objects wishing to 14 // An interface derived from InfoBarDelegate implemented by objects wishing to
15 // control a ConfirmInfoBar. 15 // control a ConfirmInfoBar.
16 class ConfirmInfoBarDelegate : public InfoBarDelegate { 16 class ConfirmInfoBarDelegate : public InfoBarDelegate {
17 public: 17 public:
18 virtual ~ConfirmInfoBarDelegate();
19
18 enum InfoBarButton { 20 enum InfoBarButton {
19 BUTTON_NONE = 0, 21 BUTTON_NONE = 0,
20 BUTTON_OK = 1 << 0, 22 BUTTON_OK = 1 << 0,
21 BUTTON_CANCEL = 1 << 1, 23 BUTTON_CANCEL = 1 << 1,
22 }; 24 };
23 25
24 // Returns the message string to be displayed for the InfoBar. 26 // Returns the message string to be displayed for the InfoBar.
25 virtual string16 GetMessageText() const = 0; 27 virtual string16 GetMessageText() const = 0;
26 28
27 // Return the buttons to be shown for this InfoBar. 29 // Return the buttons to be shown for this InfoBar.
(...skipping 22 matching lines...) Expand all
50 52
51 // Called when the Link (if any) is clicked. The |disposition| specifies how 53 // Called when the Link (if any) is clicked. The |disposition| specifies how
52 // the resulting document should be loaded (based on the event flags present 54 // the resulting document should be loaded (based on the event flags present
53 // when the link was clicked). If this function returns true, the infobar is 55 // when the link was clicked). If this function returns true, the infobar is
54 // then immediately closed. Subclasses MUST NOT return true if in handling 56 // then immediately closed. Subclasses MUST NOT return true if in handling
55 // this call something triggers the infobar to begin closing. 57 // this call something triggers the infobar to begin closing.
56 virtual bool LinkClicked(WindowOpenDisposition disposition); 58 virtual bool LinkClicked(WindowOpenDisposition disposition);
57 59
58 protected: 60 protected:
59 explicit ConfirmInfoBarDelegate(InfoBarTabHelper* infobar_helper); 61 explicit ConfirmInfoBarDelegate(InfoBarTabHelper* infobar_helper);
60 virtual ~ConfirmInfoBarDelegate();
61 62
62 virtual bool ShouldExpire( 63 virtual bool ShouldExpire(
63 const content::LoadCommittedDetails& details) const OVERRIDE; 64 const content::LoadCommittedDetails& details) const OVERRIDE;
64 65
65 private: 66 private:
66 // InfoBarDelegate: 67 // InfoBarDelegate:
67 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) OVERRIDE; 68 virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) OVERRIDE;
68 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; 69 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE;
69 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE; 70 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE;
70 71
71 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); 72 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate);
72 }; 73 };
73 74
74 #endif // CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ 75 #endif // CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_tab_helper.cc ('k') | chrome/browser/ui/cocoa/infobars/infobar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698