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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model.cc

Issue 2049503004: Add a "not signed in" condition to the Sync promo in the password bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_bubble_experiment.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/passwords/manage_passwords_bubble_model.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 PrefService* prefs = profile->GetPrefs(); 453 PrefService* prefs = profile->GetPrefs();
454 return !prefs->GetBoolean( 454 return !prefs->GetBoolean(
455 password_manager::prefs::kWasSavePrompFirstRunExperienceShown); 455 password_manager::prefs::kWasSavePrompFirstRunExperienceShown);
456 } 456 }
457 return false; 457 return false;
458 } 458 }
459 459
460 bool ManagePasswordsBubbleModel::ReplaceToShowSignInPromoIfNeeded() { 460 bool ManagePasswordsBubbleModel::ReplaceToShowSignInPromoIfNeeded() {
461 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_STATE, state_); 461 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_STATE, state_);
462 PrefService* prefs = GetProfile()->GetPrefs(); 462 PrefService* prefs = GetProfile()->GetPrefs();
463 if (password_bubble_experiment::ShouldShowChromeSignInPasswordPromo(prefs)) { 463 const ProfileSyncService* sync_service =
464 ProfileSyncServiceFactory::GetForProfile(GetProfile());
465 if (password_bubble_experiment::ShouldShowChromeSignInPasswordPromo(
466 prefs, sync_service)) {
464 interaction_keeper_->ReportInteractions(this); 467 interaction_keeper_->ReportInteractions(this);
465 title_brand_link_range_ = gfx::Range(); 468 title_brand_link_range_ = gfx::Range();
466 title_ = l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_TITLE); 469 title_ = l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_TITLE);
467 state_ = password_manager::ui::CHROME_SIGN_IN_PROMO_STATE; 470 state_ = password_manager::ui::CHROME_SIGN_IN_PROMO_STATE;
468 int show_count = prefs->GetInteger( 471 int show_count = prefs->GetInteger(
469 password_manager::prefs::kNumberSignInPasswordPromoShown); 472 password_manager::prefs::kNumberSignInPasswordPromoShown);
470 prefs->SetInteger(password_manager::prefs::kNumberSignInPasswordPromoShown, 473 prefs->SetInteger(password_manager::prefs::kNumberSignInPasswordPromoShown,
471 show_count + 1); 474 show_count + 1);
472 return true; 475 return true;
473 } 476 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 return metrics_util::NO_UPDATE_SUBMISSION; 525 return metrics_util::NO_UPDATE_SUBMISSION;
523 } 526 }
524 if (state_ != password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) 527 if (state_ != password_manager::ui::PENDING_PASSWORD_UPDATE_STATE)
525 return metrics_util::NO_UPDATE_SUBMISSION; 528 return metrics_util::NO_UPDATE_SUBMISSION;
526 if (password_overridden_) 529 if (password_overridden_)
527 return update_events[3][behavior]; 530 return update_events[3][behavior];
528 if (ShouldShowMultipleAccountUpdateUI()) 531 if (ShouldShowMultipleAccountUpdateUI())
529 return update_events[2][behavior]; 532 return update_events[2][behavior];
530 return update_events[1][behavior]; 533 return update_events[1][behavior];
531 } 534 }
OLDNEW
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_bubble_experiment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698