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

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

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 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_infobar_delegate.cc
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index da028eceb39ab48619976c4f7acf7aadc4ba02e9..e8d450555b0c2bd79ba0fe1cc097f0c95b224b45 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -72,10 +72,14 @@ InfoBar* GeolocationInfoBarDelegate::Create(
RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_CREATE);
const content::NavigationEntry* committed_entry =
infobar_service->web_contents()->GetController().GetLastCommittedEntry();
- GeolocationInfoBarDelegate* const delegate = new DelegateType(
- controller, id, requesting_frame,
- committed_entry ? committed_entry->GetUniqueID() : 0,
- display_languages, accept_button_label);
+ GeolocationInfoBarDelegate* const delegate =
+ new DelegateType(infobar_service->web_contents(),
+ controller,
+ id,
+ requesting_frame,
+ committed_entry ? committed_entry->GetUniqueID() : 0,
+ display_languages,
+ accept_button_label);
InfoBar* infobar = ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(delegate)).release();
@@ -83,20 +87,20 @@ InfoBar* GeolocationInfoBarDelegate::Create(
}
GeolocationInfoBarDelegate::GeolocationInfoBarDelegate(
+ content::WebContents* web_contents,
PermissionQueueController* controller,
const PermissionRequestID& id,
const GURL& requesting_frame,
int contents_unique_id,
const std::string& display_languages,
const std::string& accept_button_label)
- : ConfirmInfoBarDelegate(),
+ : ContentConfirmInfoBarDelegate(web_contents),
controller_(controller),
id_(id),
requesting_frame_(requesting_frame.GetOrigin()),
contents_unique_id_(contents_unique_id),
display_languages_(display_languages),
- user_has_interacted_(false) {
-}
+ user_has_interacted_(false) {}
GeolocationInfoBarDelegate::~GeolocationInfoBarDelegate() {
if (!user_has_interacted_)
@@ -133,14 +137,11 @@ InfoBarDelegate::Type GeolocationInfoBarDelegate::GetInfoBarType() const {
}
bool GeolocationInfoBarDelegate::ShouldExpireInternal(
- const content::LoadCommittedDetails& details) const {
+ const NavigationDetails& 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);
+ return (contents_unique_id_ != details.entry_id) || details.is_reload;
}
base::string16 GeolocationInfoBarDelegate::GetMessageText() const {

Powered by Google App Engine
This is Rietveld 408576698