OLD | NEW |
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/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 PrefService* ChromePasswordManagerClient::GetPrefs() { | 261 PrefService* ChromePasswordManagerClient::GetPrefs() { |
262 return profile_->GetPrefs(); | 262 return profile_->GetPrefs(); |
263 } | 263 } |
264 | 264 |
265 password_manager::PasswordStore* | 265 password_manager::PasswordStore* |
266 ChromePasswordManagerClient::GetPasswordStore() { | 266 ChromePasswordManagerClient::GetPasswordStore() { |
267 // Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord | 267 // Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord |
268 // itself when it shouldn't access the PasswordStore. | 268 // itself when it shouldn't access the PasswordStore. |
269 // TODO(gcasto): Is is safe to change this to Profile::IMPLICIT_ACCESS? | 269 // TODO(gcasto): Is is safe to change this to |
270 return PasswordStoreFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS) | 270 // ServiceAccessType::IMPLICIT_ACCESS? |
271 .get(); | 271 return PasswordStoreFactory::GetForProfile( |
| 272 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); |
272 } | 273 } |
273 | 274 |
274 base::FieldTrial::Probability | 275 base::FieldTrial::Probability |
275 ChromePasswordManagerClient::GetProbabilityForExperiment( | 276 ChromePasswordManagerClient::GetProbabilityForExperiment( |
276 const std::string& experiment_name) { | 277 const std::string& experiment_name) { |
277 base::FieldTrial::Probability enabled_probability = 0; | 278 base::FieldTrial::Probability enabled_probability = 0; |
278 if (experiment_name == | 279 if (experiment_name == |
279 password_manager::PasswordManager::kOtherPossibleUsernamesExperiment) { | 280 password_manager::PasswordManager::kOtherPossibleUsernamesExperiment) { |
280 switch (chrome::VersionInfo::GetChannel()) { | 281 switch (chrome::VersionInfo::GetChannel()) { |
281 case chrome::VersionInfo::CHANNEL_DEV: | 282 case chrome::VersionInfo::CHANNEL_DEV: |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 564 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
564 } else { | 565 } else { |
565 // Allow by default. | 566 // Allow by default. |
566 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 567 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
567 } | 568 } |
568 } | 569 } |
569 | 570 |
570 const GURL& ChromePasswordManagerClient::GetMainFrameURL() { | 571 const GURL& ChromePasswordManagerClient::GetMainFrameURL() { |
571 return web_contents()->GetVisibleURL(); | 572 return web_contents()->GetVisibleURL(); |
572 } | 573 } |
OLD | NEW |