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

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

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
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: trunk/src/chrome/browser/password_manager/password_manager_delegate_impl.cc
===================================================================
--- trunk/src/chrome/browser/password_manager/password_manager_delegate_impl.cc (revision 238401)
+++ trunk/src/chrome/browser/password_manager/password_manager_delegate_impl.cc (working copy)
@@ -9,7 +9,6 @@
#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"
@@ -43,11 +42,11 @@
class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
// If we won't be showing the one-click signin infobar, creates a save
- // 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.
+ // 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.
static void Create(content::WebContents* web_contents,
PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix);
@@ -61,7 +60,8 @@
NUM_RESPONSE_TYPES,
};
- SavePasswordInfoBarDelegate(PasswordFormManager* form_to_save,
+ SavePasswordInfoBarDelegate(InfoBarService* infobar_service,
+ PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix);
virtual ~SavePasswordInfoBarDelegate();
@@ -113,16 +113,18 @@
return;
#endif
- InfoBarService::FromWebContents(web_contents)->AddInfoBar(
- ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
- new SavePasswordInfoBarDelegate(form_to_save,
- uma_histogram_suffix))));
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ infobar_service->AddInfoBar(
+ scoped_ptr<InfoBarDelegate>(new SavePasswordInfoBarDelegate(
+ infobar_service, form_to_save, uma_histogram_suffix)));
}
SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
+ InfoBarService* infobar_service,
PasswordFormManager* form_to_save,
const std::string& uma_histogram_suffix)
- : ConfirmInfoBarDelegate(),
+ : ConfirmInfoBarDelegate(infobar_service),
form_to_save_(form_to_save),
infobar_response_(NO_RESPONSE),
uma_histogram_suffix_(uma_histogram_suffix) {

Powered by Google App Engine
This is Rietveld 408576698