OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_INFOBARS_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_INFOBARS_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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 virtual RegisterProtocolHandlerInfoBarDelegate* | 104 virtual RegisterProtocolHandlerInfoBarDelegate* |
105 AsRegisterProtocolHandlerInfoBarDelegate(); | 105 AsRegisterProtocolHandlerInfoBarDelegate(); |
106 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); | 106 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); |
107 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); | 107 virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
108 | 108 |
109 protected: | 109 protected: |
110 // If |contents| is non-NULL, its active entry's unique ID will be stored | 110 // If |contents| is non-NULL, its active entry's unique ID will be stored |
111 // using StoreActiveEntryUniqueID automatically. | 111 // using StoreActiveEntryUniqueID automatically. |
112 explicit InfoBarDelegate(InfoBarTabHelper* infobar_helper); | 112 explicit InfoBarDelegate(InfoBarTabHelper* infobar_helper); |
113 | 113 |
114 // Store the unique id for the active entry in the specified TabContents, to | 114 // Store the unique id for the active entry in the specified WebContents, to |
115 // be used later upon navigation to determine if this InfoBarDelegate should | 115 // be used later upon navigation to determine if this InfoBarDelegate should |
116 // be expired from |contents_|. | 116 // be expired from |contents_|. |
117 void StoreActiveEntryUniqueID(InfoBarTabHelper* infobar_helper); | 117 void StoreActiveEntryUniqueID(InfoBarTabHelper* infobar_helper); |
118 | 118 |
119 // Returns true if the navigation is to a new URL or a reload occured. | 119 // Returns true if the navigation is to a new URL or a reload occured. |
120 bool ShouldExpireInternal( | 120 bool ShouldExpireInternal( |
121 const content::LoadCommittedDetails& details) const; | 121 const content::LoadCommittedDetails& details) const; |
122 | 122 |
123 // Removes ourself from |owner_| if we haven't already been removed. | 123 // Removes ourself from |owner_| if we haven't already been removed. |
124 // TODO(pkasting): Move to InfoBar. | 124 // TODO(pkasting): Move to InfoBar. |
125 void RemoveSelf(); | 125 void RemoveSelf(); |
126 | 126 |
127 private: | 127 private: |
128 // The unique id of the active NavigationEntry of the TabContents that we were | 128 // The unique id of the active NavigationEntry of the WebContents that we were |
129 // opened for. Used to help expire on navigations. | 129 // opened for. Used to help expire on navigations. |
130 int contents_unique_id_; | 130 int contents_unique_id_; |
131 | 131 |
132 // TODO(pkasting): Remove. | 132 // TODO(pkasting): Remove. |
133 InfoBarTabHelper* owner_; | 133 InfoBarTabHelper* owner_; |
134 | 134 |
135 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 135 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
136 }; | 136 }; |
137 | 137 |
138 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 138 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
OLD | NEW |