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

Unified Diff: chrome/browser/password_manager/password_manager_delegate_impl.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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/password_manager/password_manager_delegate_impl.cc
===================================================================
--- chrome/browser/password_manager/password_manager_delegate_impl.cc (revision 238220)
+++ chrome/browser/password_manager/password_manager_delegate_impl.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/timer/elapsed_timer.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/password_manager/password_form_manager.h"
#include "chrome/browser/password_manager/password_manager.h"
@@ -42,11 +43,11 @@
class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
// If we won't be showing the one-click signin infobar, creates a save
- // password infobar delegate and adds it to the InfoBarService for
- // |web_contents|. |uma_histogram_suffix| is empty, or one of the "group_X"
- // suffixes used in the histogram names for infobar usage reporting; if empty,
- // the usage is not reported, otherwise the suffix is used to choose the right
- // histogram.
+ // password infobar and delegate and adds the infobar to the InfoBarService
+ // for |web_contents|. |uma_histogram_suffix| is empty, or one of the
+ // "group_X" suffixes used in the histogram names for infobar usage reporting;
+ // if empty, the usage is not reported, otherwise the suffix is used to choose
+ // the right histogram.
static void Create(content::WebContents* web_contents,
PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix);
@@ -60,8 +61,7 @@
NUM_RESPONSE_TYPES,
};
- SavePasswordInfoBarDelegate(InfoBarService* infobar_service,
- PasswordFormManager* form_to_save,
+ SavePasswordInfoBarDelegate(PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix);
virtual ~SavePasswordInfoBarDelegate();
@@ -113,18 +113,16 @@
return;
#endif
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(web_contents);
- infobar_service->AddInfoBar(
- scoped_ptr<InfoBarDelegate>(new SavePasswordInfoBarDelegate(
- infobar_service, form_to_save, uma_histogram_suffix)));
+ InfoBarService::FromWebContents(web_contents)->AddInfoBar(
+ ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
+ new SavePasswordInfoBarDelegate(form_to_save,
+ uma_histogram_suffix))));
}
SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
- InfoBarService* infobar_service,
PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
form_to_save_(form_to_save),
infobar_response_(NO_RESPONSE),
uma_histogram_suffix_(uma_histogram_suffix) {
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | chrome/browser/pepper_broker_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698