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

Side by Side Diff: components/password_manager/core/browser/password_generation_manager_unittest.cc

Issue 900223005: [Clean up] Clean up some methods in PasswordManagerClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 <vector> 5 #include <vector>
6 6
7 #include "base/prefs/pref_registry_simple.h" 7 #include "base/prefs/pref_registry_simple.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/testing_pref_service.h" 9 #include "base/prefs/testing_pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 public: 66 public:
67 TestPasswordManagerClient(scoped_ptr<PrefService> prefs) 67 TestPasswordManagerClient(scoped_ptr<PrefService> prefs)
68 : prefs_(prefs.Pass()), 68 : prefs_(prefs.Pass()),
69 store_(new TestPasswordStore), 69 store_(new TestPasswordStore),
70 driver_(this), 70 driver_(this),
71 is_sync_enabled_(false), 71 is_sync_enabled_(false),
72 is_off_the_record_(false) {} 72 is_off_the_record_(false) {}
73 73
74 ~TestPasswordManagerClient() override { store_->Shutdown(); } 74 ~TestPasswordManagerClient() override { store_->Shutdown(); }
75 75
76 bool IsOffTheRecord() override { return is_off_the_record_; } 76 bool IsOffTheRecord() const override { return is_off_the_record_; }
77 PasswordStore* GetPasswordStore() override { return store_.get(); } 77 PasswordStore* GetPasswordStore() const override { return store_.get(); }
78 PrefService* GetPrefs() override { return prefs_.get(); } 78 PrefService* GetPrefs() override { return prefs_.get(); }
79 bool IsPasswordSyncEnabled(CustomPassphraseState state) override { 79 bool IsPasswordSyncEnabled(CustomPassphraseState state) const override {
80 return is_sync_enabled_; 80 return is_sync_enabled_;
81 } 81 }
82 82
83 void set_is_password_sync_enabled(bool enabled) { 83 void set_is_password_sync_enabled(bool enabled) {
84 is_sync_enabled_ = enabled; 84 is_sync_enabled_ = enabled;
85 } 85 }
86 86
87 TestPasswordManagerDriver* test_driver() { return &driver_; } 87 TestPasswordManagerDriver* test_driver() { return &driver_; }
88 void set_is_off_the_record(bool is_otr) { is_off_the_record_ = is_otr; } 88 void set_is_off_the_record(bool is_otr) { is_off_the_record_ = is_otr; }
89 89
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // be disabled. 204 // be disabled.
205 client_->set_is_off_the_record(true); 205 client_->set_is_off_the_record(true);
206 PrefService* prefs = client_->GetPrefs(); 206 PrefService* prefs = client_->GetPrefs();
207 prefs->SetBoolean(prefs::kPasswordManagerSavingEnabled, true); 207 prefs->SetBoolean(prefs::kPasswordManagerSavingEnabled, true);
208 client_->set_is_password_sync_enabled(true); 208 client_->set_is_password_sync_enabled(true);
209 209
210 EXPECT_FALSE(IsGenerationEnabled()); 210 EXPECT_FALSE(IsGenerationEnabled());
211 } 211 }
212 212
213 } // namespace password_manager 213 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698