| OLD | NEW |
| 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_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Returns true if the supplied |delegate| is equal to this one. Equality is | 51 // Returns true if the supplied |delegate| is equal to this one. Equality is |
| 52 // left to the implementation to define. This function is called by the | 52 // left to the implementation to define. This function is called by the |
| 53 // TabContentsWrapper when determining whether or not a delegate should be | 53 // TabContentsWrapper when determining whether or not a delegate should be |
| 54 // added because a matching one already exists. If this function returns true, | 54 // added because a matching one already exists. If this function returns true, |
| 55 // the TabContentsWrapper will not add the new delegate because it considers | 55 // the TabContentsWrapper will not add the new delegate because it considers |
| 56 // one to already be present. | 56 // one to already be present. |
| 57 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const; | 57 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const; |
| 58 | 58 |
| 59 // Returns true if the InfoBar should be closed automatically after the page | 59 // Returns true if the InfoBar should be closed automatically after the page |
| 60 // is navigated. The default behavior is to return true if the | 60 // is navigated. The default behavior is to return true if the user initiated |
| 61 // navigation is to a new page (not including reloads). | 61 // navigation somewhere else or reloaded. |
| 62 virtual bool ShouldExpire( | 62 virtual bool ShouldExpire( |
| 63 const content::LoadCommittedDetails& details) const; | 63 const content::LoadCommittedDetails& details) const; |
| 64 | 64 |
| 65 // Called when the user clicks on the close button to dismiss the infobar. | 65 // Called when the user clicks on the close button to dismiss the infobar. |
| 66 virtual void InfoBarDismissed(); | 66 virtual void InfoBarDismissed(); |
| 67 | 67 |
| 68 // Called after the InfoBar is closed. Deletes |this|. | 68 // Called after the InfoBar is closed. Deletes |this|. |
| 69 // TODO(pkasting): Get rid of this and delete delegates directly. | 69 // TODO(pkasting): Get rid of this and delete delegates directly. |
| 70 void InfoBarClosed(); | 70 void InfoBarClosed(); |
| 71 | 71 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 // The unique id of the active NavigationEntry of the TabContents that we were | 105 // The unique id of the active NavigationEntry of the TabContents that we were |
| 106 // opened for. Used to help expire on navigations. | 106 // opened for. Used to help expire on navigations. |
| 107 int contents_unique_id_; | 107 int contents_unique_id_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 109 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ | 112 #endif // CHROME_BROWSER_TAB_CONTENTS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |