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

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

Issue 2588323002: Revert "Remove Finch support for PasswordBranding" (Closed)
Patch Set: Created 3 years, 12 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 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_android .h" 5 #include "chrome/browser/password_manager/save_password_infobar_delegate_android .h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // static 26 // static
27 void SavePasswordInfoBarDelegate::Create( 27 void SavePasswordInfoBarDelegate::Create(
28 content::WebContents* web_contents, 28 content::WebContents* web_contents,
29 std::unique_ptr<password_manager::PasswordFormManager> form_to_save) { 29 std::unique_ptr<password_manager::PasswordFormManager> form_to_save) {
30 Profile* profile = 30 Profile* profile =
31 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 31 Profile::FromBrowserContext(web_contents->GetBrowserContext());
32 syncer::SyncService* sync_service = 32 syncer::SyncService* sync_service =
33 ProfileSyncServiceFactory::GetForProfile(profile); 33 ProfileSyncServiceFactory::GetForProfile(profile);
34 bool is_smartlock_branding_enabled = 34 bool is_smartlock_branding_enabled =
35 password_bubble_experiment::IsSmartLockUser(sync_service); 35 password_bubble_experiment::IsSmartLockBrandingSavePromptEnabled(
36 sync_service);
36 InfoBarService* infobar_service = 37 InfoBarService* infobar_service =
37 InfoBarService::FromWebContents(web_contents); 38 InfoBarService::FromWebContents(web_contents);
38 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 39 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
39 std::unique_ptr<ConfirmInfoBarDelegate>( 40 std::unique_ptr<ConfirmInfoBarDelegate>(
40 new SavePasswordInfoBarDelegate(web_contents, std::move(form_to_save), 41 new SavePasswordInfoBarDelegate(web_contents, std::move(form_to_save),
41 is_smartlock_branding_enabled)))); 42 is_smartlock_branding_enabled))));
42 } 43 }
43 44
44 SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() { 45 SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
45 password_manager::metrics_util::LogUIDismissalReason(infobar_response_); 46 password_manager::metrics_util::LogUIDismissalReason(infobar_response_);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 infobar_response_ = password_manager::metrics_util::CLICKED_SAVE; 90 infobar_response_ = password_manager::metrics_util::CLICKED_SAVE;
90 return true; 91 return true;
91 } 92 }
92 93
93 bool SavePasswordInfoBarDelegate::Cancel() { 94 bool SavePasswordInfoBarDelegate::Cancel() {
94 DCHECK(form_to_save_.get()); 95 DCHECK(form_to_save_.get());
95 form_to_save_->PermanentlyBlacklist(); 96 form_to_save_->PermanentlyBlacklist();
96 infobar_response_ = password_manager::metrics_util::CLICKED_NEVER; 97 infobar_response_ = password_manager::metrics_util::CLICKED_NEVER;
97 return true; 98 return true;
98 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698