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

Unified Diff: chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc

Issue 11748012: Minor cleanup to how infobars handle expiry: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc
===================================================================
--- chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc (revision 174909)
+++ chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc (working copy)
@@ -31,7 +31,7 @@
display_languages_(display_languages) {
const content::NavigationEntry* committed_entry = infobar_service->
GetWebContents()->GetController().GetLastCommittedEntry();
- set_contents_unique_id(committed_entry ? committed_entry->GetUniqueID() : 0);
+ contents_unique_id_ = committed_entry ? committed_entry->GetUniqueID() : 0;
}
gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const {
@@ -44,6 +44,17 @@
return PAGE_ACTION_TYPE;
}
+bool GeolocationConfirmInfoBarDelegate::ShouldExpireInternal(
+ const content::LoadCommittedDetails& details) const {
+ // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but
+ // uses the unique ID we set in the constructor instead of that stored in the
+ // base class.
+ return (contents_unique_id_ != details.entry->GetUniqueID()) ||
+ (content::PageTransitionStripQualifier(
+ details.entry->GetTransitionType()) ==
+ content::PAGE_TRANSITION_RELOAD);
+}
+
string16 GeolocationConfirmInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringFUTF16(IDS_GEOLOCATION_INFOBAR_QUESTION,
net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_));

Powered by Google App Engine
This is Rietveld 408576698