OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/base/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual PopupBlockedInfoBarDelegate* AsPopupBlockedInfoBarDelegate(); | 120 virtual PopupBlockedInfoBarDelegate* AsPopupBlockedInfoBarDelegate(); |
121 virtual RegisterProtocolHandlerInfoBarDelegate* | 121 virtual RegisterProtocolHandlerInfoBarDelegate* |
122 AsRegisterProtocolHandlerInfoBarDelegate(); | 122 AsRegisterProtocolHandlerInfoBarDelegate(); |
123 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); | 123 virtual ScreenCaptureInfoBarDelegate* AsScreenCaptureInfoBarDelegate(); |
124 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); | 124 virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); |
125 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); | 125 virtual ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate(); |
126 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); | 126 virtual translate::TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |
127 | 127 |
128 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } | 128 void set_infobar(InfoBar* infobar) { infobar_ = infobar; } |
129 | 129 |
130 // Store the unique id for the active entry, to be used later upon navigation | |
131 // to determine if this InfoBarDelegate should be expired. | |
132 void StoreActiveEntryUniqueID(); | |
133 | |
134 protected: | 130 protected: |
135 InfoBarDelegate(); | 131 InfoBarDelegate(); |
136 | 132 |
137 // Returns true if the navigation is to a new URL or a reload occured. | |
138 virtual bool ShouldExpireInternal(const NavigationDetails& details) const; | |
139 | |
140 int contents_unique_id() const { return contents_unique_id_; } | |
141 InfoBar* infobar() { return infobar_; } | 133 InfoBar* infobar() { return infobar_; } |
142 | 134 |
143 private: | 135 private: |
144 // The unique id of the active NavigationEntry of the WebContents that we were | |
145 // opened for. Used to help expire on navigations. | |
146 int contents_unique_id_; | |
147 | |
148 // The InfoBar associated with us. | 136 // The InfoBar associated with us. |
149 InfoBar* infobar_; | 137 InfoBar* infobar_; |
150 | 138 |
151 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 139 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
152 }; | 140 }; |
153 | 141 |
154 } // namespace infobars | 142 } // namespace infobars |
155 | 143 |
156 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 144 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
OLD | NEW |