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
3// found in the LICENSE file.
4
5#include "components/password_manager/core/browser/password_manager_client.h"
6
7namespace password_manager {
8
9bool PasswordManagerClient::IsAutomaticPasswordSavingEnabled() const {
10  return false;
11}
12
13bool PasswordManagerClient::IsPasswordManagerEnabledForCurrentPage() const {
14  return true;
15}
16
17base::FieldTrial::Probability
18PasswordManagerClient::GetProbabilityForExperiment(
19    const std::string& experiment_name) {
20  return 0;
21}
22
23bool PasswordManagerClient::IsPasswordSyncEnabled() { return false; }
24
25void PasswordManagerClient::OnLogRouterAvailabilityChanged(
26    bool router_can_be_used) {
27}
28
29void PasswordManagerClient::LogSavePasswordProgress(const std::string& text) {
30}
31
32bool PasswordManagerClient::IsLoggingActive() const {
33  return false;
34}
35
36PasswordStore::AuthorizationPromptPolicy
37PasswordManagerClient::GetAuthorizationPromptPolicy(
38    const autofill::PasswordForm& form) {
39  // Password Autofill is supposed to be a convenience. If it creates a
40  // blocking dialog, it is no longer convenient. We should only prompt the
41  // user after a full username has been typed in. Until that behavior is
42  // implemented, never prompt the user for keychain access.
43  // Effectively, this means that passwords stored by Chrome still work,
44  // since Chrome can access those without a prompt, but passwords stored by
45  // Safari, Firefox, or Chrome Canary will not work. Note that the latest
46  // build of Safari and Firefox don't create keychain items with the
47  // relevant tags anyways (7/11/2014).
48  // http://crbug.com/178358
49  return PasswordStore::DISALLOW_PROMPT;
50}
51
52}  // namespace password_manager
53