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

Unified Diff: chrome/browser/google/google_url_tracker_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/google/google_url_tracker_infobar_delegate.cc
diff --git a/chrome/browser/google/google_url_tracker_infobar_delegate.cc b/chrome/browser/google/google_url_tracker_infobar_delegate.cc
index 0b2036c9eb3d9e8f4f3b3dac3379f37f1a54cd88..d9fc927ec38dda1ced539588af581986f7a74cf6 100644
--- a/chrome/browser/google/google_url_tracker_infobar_delegate.cc
+++ b/chrome/browser/google/google_url_tracker_infobar_delegate.cc
@@ -24,7 +24,7 @@ InfoBar* GoogleURLTrackerInfoBarDelegate::Create(
const GURL& search_url) {
return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(new GoogleURLTrackerInfoBarDelegate(
- google_url_tracker, search_url))));
+ infobar_service->web_contents(), google_url_tracker, search_url))));
}
bool GoogleURLTrackerInfoBarDelegate::Accept() {
@@ -38,7 +38,10 @@ bool GoogleURLTrackerInfoBarDelegate::Cancel() {
}
void GoogleURLTrackerInfoBarDelegate::Update(const GURL& search_url) {
- StoreActiveEntryUniqueID();
+ content::NavigationEntry* active_entry =
+ web_contents()->GetController().GetActiveEntry();
+ int entry_id = active_entry ? active_entry->GetUniqueID() : 0;
+ StoreActiveEntryUniqueID(entry_id);
search_url_ = search_url;
pending_id_ = 0;
}
@@ -71,13 +74,13 @@ void GoogleURLTrackerInfoBarDelegate::Close(bool redo_search) {
}
GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
+ content::WebContents* web_contents,
GoogleURLTracker* google_url_tracker,
const GURL& search_url)
- : ConfirmInfoBarDelegate(),
+ : ContentConfirmInfoBarDelegate(web_contents),
google_url_tracker_(google_url_tracker),
search_url_(search_url),
- pending_id_(0) {
-}
+ pending_id_(0) {}
GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() {
}
@@ -118,7 +121,7 @@ bool GoogleURLTrackerInfoBarDelegate::LinkClicked(
}
bool GoogleURLTrackerInfoBarDelegate::ShouldExpireInternal(
- const content::LoadCommittedDetails& details) const {
- int unique_id = details.entry->GetUniqueID();
- return (unique_id != contents_unique_id()) && (unique_id != pending_id_);
+ const NavigationDetails& details) const {
+ return (details.entry_id != contents_unique_id()) &&
+ (details.entry_id != pending_id_);
}

Powered by Google App Engine
This is Rietveld 408576698