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

Side by Side Diff: components/infobars/core/infobar_delegate.h

Issue 1142153002: Simplify infobar expiry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile Created 5 years, 7 months 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
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698