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

Unified Diff: chrome/browser/infobars/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/infobars/infobar_delegate.cc
diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc
index bef38aad33ec9a607c0b9c3737dae9dd50666ff4..8624d3c648705ef412b6b720710b8d6b9f9ab141 100644
--- a/chrome/browser/infobars/infobar_delegate.cc
+++ b/chrome/browser/infobars/infobar_delegate.cc
@@ -7,14 +7,8 @@
#include "base/logging.h"
#include "build/build_config.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_service.h"
-#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_details.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/web_contents.h"
#include "ui/base/resource/resource_bundle.h"
-using content::NavigationEntry;
// InfoBarDelegate ------------------------------------------------------------
@@ -32,9 +26,8 @@ bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
return false;
}
-bool InfoBarDelegate::ShouldExpire(
- const content::LoadCommittedDetails& details) const {
- if (!details.is_navigation_to_different_page())
+bool InfoBarDelegate::ShouldExpire(const NavigationDetails& details) const {
+ if (!details.is_navigation_to_different_page)
return false;
return ShouldExpireInternal(details);
@@ -51,6 +44,8 @@ InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const {
return WARNING_TYPE;
}
+void InfoBarDelegate::CleanUp() {}
droger 2014/03/18 15:59:53 The default implementation of CleanUp does nothing
+
AutoLoginInfoBarDelegate* InfoBarDelegate::AsAutoLoginInfoBarDelegate() {
return NULL;
}
@@ -99,11 +94,8 @@ TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() {
return NULL;
}
-void InfoBarDelegate::StoreActiveEntryUniqueID() {
- DCHECK(web_contents());
- NavigationEntry* active_entry =
- web_contents()->GetController().GetActiveEntry();
- contents_unique_id_ = active_entry ? active_entry->GetUniqueID() : 0;
+void InfoBarDelegate::StoreActiveEntryUniqueID(int entry_id) {
+ contents_unique_id_ = entry_id;
}
gfx::Image InfoBarDelegate::GetIcon() const {
@@ -112,20 +104,12 @@ gfx::Image InfoBarDelegate::GetIcon() const {
ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id);
}
-content::WebContents* InfoBarDelegate::web_contents() {
- return (infobar_ && infobar_->owner()) ?
- infobar_->owner()->web_contents() : NULL;
-}
-
InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) {
}
bool InfoBarDelegate::ShouldExpireInternal(
- const content::LoadCommittedDetails& details) const {
+ const NavigationDetails& details) const {
// NOTE: If you change this, be sure to check and adjust the behavior of
// anyone who overrides this as necessary!
- 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;
}

Powered by Google App Engine
This is Rietveld 408576698