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

Side by Side Diff: chrome/browser/sync/test/integration/password_manager_setting_migrater_helper.cc

Issue 1256803002: [Smart Lock, Prefs reconciliation] Prefs migration logic for desktop platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/test/integration/password_manager_setting_migrater _helper.h"
6
7 #include "base/metrics/field_trial.h"
8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/sync/test/integration/preferences_helper.h"
12 #include "chrome/browser/sync/test/integration/sync_test.h"
13 #include "components/password_manager/core/common/password_manager_pref_names.h"
14 #include "content/public/browser/notification_details.h"
15 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/notification_source.h"
17
18 using preferences_helper::GetPrefs;
19
20 namespace {
21
22 const char kFieldTrialName[] = "PasswordManagerSettingsMigration";
23 const char kEnabledGroupName[] = "PasswordManagerSettingsMigration.Enable";
24
25 } // namespace
26
27 namespace password_manager_setting_migrater_helper {
28
29 base::FieldTrial* MigrationFieldTrial() {
30 return base::FieldTrialList::CreateFieldTrial(kFieldTrialName,
31 kEnabledGroupName);
32 }
33
34 void SendProfileAddNotification(Profile* profile) {
35 content::NotificationService::current()->Notify(
36 chrome::NOTIFICATION_PROFILE_ADDED, content::Source<Profile>(profile),
37 content::NotificationService::NoDetails());
38 }
39
40 void AssertPrefValuesOnClient(int index,
41 bool new_pref_value,
42 bool old_pref_value) {
43 using namespace password_manager::prefs;
44 ASSERT_EQ(new_pref_value,
45 GetPrefs(index)->GetBoolean(kCredentialsEnableService));
46 ASSERT_EQ(old_pref_value,
47 GetPrefs(index)->GetBoolean(kPasswordManagerSavingEnabled));
48 }
49
50 } // namespace password_manager_setting_migrater_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698