summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/website_settings
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/website_settings')
-rw-r--r--chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc11
-rw-r--r--chrome/browser/ui/website_settings/website_settings_infobar_delegate.h4
-rw-r--r--chrome/browser/ui/website_settings/website_settings_unittest.cc8
3 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc
index f51f741..c995827 100644
--- a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc
+++ b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "content/public/browser/web_contents.h"
#include "grit/generated_resources.h"
@@ -15,13 +16,13 @@
// static
void WebsiteSettingsInfoBarDelegate::Create(InfoBarService* infobar_service) {
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new WebsiteSettingsInfoBarDelegate(infobar_service)));
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
+ new WebsiteSettingsInfoBarDelegate())));
}
-WebsiteSettingsInfoBarDelegate::WebsiteSettingsInfoBarDelegate(
- InfoBarService* infobar_service)
- : ConfirmInfoBarDelegate(infobar_service) {
+WebsiteSettingsInfoBarDelegate::WebsiteSettingsInfoBarDelegate()
+ : ConfirmInfoBarDelegate() {
}
WebsiteSettingsInfoBarDelegate::~WebsiteSettingsInfoBarDelegate() {
diff --git a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.h b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.h
index 19fffa0..be68757 100644
--- a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.h
+++ b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.h
@@ -16,12 +16,12 @@ class InfoBarService;
// the reload right from the infobar.
class WebsiteSettingsInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- // Creates a website settings infobar delegate and adds it to
+ // Creates a website settings infobar and delegate and adds the infobar to
// |infobar_service|.
static void Create(InfoBarService* infobar_service);
private:
- explicit WebsiteSettingsInfoBarDelegate(InfoBarService* infobar_service);
+ WebsiteSettingsInfoBarDelegate();
virtual ~WebsiteSettingsInfoBarDelegate();
// ConfirmInfoBarDelegate:
diff --git a/chrome/browser/ui/website_settings/website_settings_unittest.cc b/chrome/browser/ui/website_settings/website_settings_unittest.cc
index ab5cba0..20519ab 100644
--- a/chrome/browser/ui/website_settings/website_settings_unittest.cc
+++ b/chrome/browser/ui/website_settings/website_settings_unittest.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
-#include "chrome/browser/infobars/infobar_delegate.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/ui/website_settings/website_settings_ui.h"
#include "chrome/common/content_settings.h"
@@ -391,9 +391,5 @@ TEST_F(WebsiteSettingsTest, ShowInfoBar) {
website_settings()->OnUIClosing();
ASSERT_EQ(1u, infobar_service()->infobar_count());
- // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete
- // it. Hence the |delegate| must be cleaned up after it was removed from the
- // |infobar_service|.
- scoped_ptr<InfoBarDelegate> delegate(infobar_service()->infobar_at(0));
- infobar_service()->RemoveInfoBar(delegate.get());
+ infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
}