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

Side by Side Diff: chrome/browser/password_manager/save_password_infobar_delegate.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on Android Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" 5 #include "chrome/browser/password_manager/save_password_infobar_delegate.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/grit/chromium_strings.h" 10 #include "chrome/grit/chromium_strings.h"
(...skipping 28 matching lines...) Expand all
39 (realm == GURL("https://www.google.com/"))) && 39 (realm == GURL("https://www.google.com/"))) &&
40 switches::IsEnableWebBasedSignin() && 40 switches::IsEnableWebBasedSignin() &&
41 OneClickSigninHelper::CanOffer( 41 OneClickSigninHelper::CanOffer(
42 web_contents, 42 web_contents,
43 OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, 43 OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY,
44 base::UTF16ToUTF8(form_to_save->associated_username()), 44 base::UTF16ToUTF8(form_to_save->associated_username()),
45 NULL)) 45 NULL))
46 return; 46 return;
47 #endif 47 #endif
48 48
49 InfoBarService::FromWebContents(web_contents)->AddInfoBar( 49 InfoBarService* infobar_service =
50 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( 50 InfoBarService::FromWebContents(web_contents);
51 new SavePasswordInfoBarDelegate(form_to_save.Pass(), 51 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
52 uma_histogram_suffix)))); 52 scoped_ptr<ConfirmInfoBarDelegate>(new SavePasswordInfoBarDelegate(
53 form_to_save.Pass(), uma_histogram_suffix))));
53 } 54 }
54 55
55 SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() { 56 SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
56 UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse", 57 UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse",
57 infobar_response_, 58 infobar_response_,
58 password_manager::metrics_util::NUM_RESPONSE_TYPES); 59 password_manager::metrics_util::NUM_RESPONSE_TYPES);
59 60
60 password_manager::metrics_util::LogUIDismissalReason(infobar_response_); 61 password_manager::metrics_util::LogUIDismissalReason(infobar_response_);
61 62
62 // The shortest period for which the prompt needs to live, so that we don't 63 // The shortest period for which the prompt needs to live, so that we don't
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 void SavePasswordInfoBarDelegate::InfoBarDismissed() { 134 void SavePasswordInfoBarDelegate::InfoBarDismissed() {
134 DCHECK(form_to_save_.get()); 135 DCHECK(form_to_save_.get());
135 infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED; 136 infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED;
136 } 137 }
137 138
138 infobars::InfoBarDelegate::InfoBarAutomationType 139 infobars::InfoBarDelegate::InfoBarAutomationType
139 SavePasswordInfoBarDelegate::GetInfoBarAutomationType() const { 140 SavePasswordInfoBarDelegate::GetInfoBarAutomationType() const {
140 return PASSWORD_INFOBAR; 141 return PASSWORD_INFOBAR;
141 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698