OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
11 #include "components/keyed_service/core/keyed_service.h" | 11 #include "components/keyed_service/core/keyed_service.h" |
12 #include "components/keyed_service/core/service_access_type.h" | 12 #include "components/keyed_service/core/service_access_type.h" |
13 | 13 |
| 14 #if defined(USE_X11) |
| 15 #include "base/nix/xdg_util.h" |
| 16 #endif |
| 17 |
14 class Profile; | 18 class Profile; |
15 | 19 |
16 namespace password_manager { | 20 namespace password_manager { |
17 class PasswordStore; | 21 class PasswordStore; |
18 } | 22 } |
19 | 23 |
20 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) | 24 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) |
21 // Local profile ids are used to associate resources stored outside the profile | 25 // Local profile ids are used to associate resources stored outside the profile |
22 // directory, like saved passwords in GNOME Keyring / KWallet, with a profile. | 26 // directory, like saved passwords in GNOME Keyring / KWallet, with a profile. |
23 // With high probability, they are unique on the local machine. They are almost | 27 // With high probability, they are unique on the local machine. They are almost |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 70 |
67 // BrowserContextKeyedServiceFactory: | 71 // BrowserContextKeyedServiceFactory: |
68 KeyedService* BuildServiceInstanceFor( | 72 KeyedService* BuildServiceInstanceFor( |
69 content::BrowserContext* context) const override; | 73 content::BrowserContext* context) const override; |
70 void RegisterProfilePrefs( | 74 void RegisterProfilePrefs( |
71 user_prefs::PrefRegistrySyncable* registry) override; | 75 user_prefs::PrefRegistrySyncable* registry) override; |
72 content::BrowserContext* GetBrowserContextToUse( | 76 content::BrowserContext* GetBrowserContextToUse( |
73 content::BrowserContext* context) const override; | 77 content::BrowserContext* context) const override; |
74 bool ServiceIsNULLWhileTesting() const override; | 78 bool ServiceIsNULLWhileTesting() const override; |
75 | 79 |
| 80 #if defined(USE_X11) |
| 81 enum LinuxBackendUsage { |
| 82 KDE_NOFLAG_PLAINTEXT, |
| 83 KDE_NOFLAG_KWALLET, |
| 84 KDE_KWALLETFLAG_PLAINTEXT, |
| 85 KDE_KWALLETFLAG_KWALLET, |
| 86 KDE_GNOMEFLAG_PLAINTEXT, |
| 87 KDE_GNOMEFLAG_KEYRING, |
| 88 KDE_GNOMEFLAG_LIBSECRET, |
| 89 KDE_BASICFLAG_PLAINTEXT, |
| 90 GNOME_NOFLAG_PLAINTEXT, |
| 91 GNOME_NOFLAG_KEYRING, |
| 92 GNOME_NOFLAG_LIBSECRET, |
| 93 GNOME_GNOMEFLAG_PLAINTEXT, |
| 94 GNOME_GNOMEFLAG_KEYRING, |
| 95 GNOME_GNOMEFLAG_LIBSECRET, |
| 96 GNOME_KWALLETFLAG_PLAINTEXT, |
| 97 GNOME_KWALLETFLAG_KWALLET, |
| 98 GNOME_BASICFLAG_PLAINTEXT, |
| 99 OTHER_PLAINTEXT, |
| 100 OTHER_KWALLET, |
| 101 OTHER_KEYRING, |
| 102 OTHER_LIBSECRET, |
| 103 MAX_BACKEND_USAGE_VALUE |
| 104 }; |
| 105 |
| 106 enum LinuxBackendUsed { PLAINTEXT, GNOME_KEYRING, LIBSECRET, KWALLET }; |
| 107 |
| 108 static base::nix::DesktopEnvironment GetDesktopEnvironment(); |
| 109 static void RecordBackendStatistics(base::nix::DesktopEnvironment desktop_env, |
| 110 const std::string& command_line_flag, |
| 111 LinuxBackendUsed used_backend); |
| 112 #endif |
| 113 |
76 DISALLOW_COPY_AND_ASSIGN(PasswordStoreFactory); | 114 DISALLOW_COPY_AND_ASSIGN(PasswordStoreFactory); |
77 }; | 115 }; |
78 | 116 |
79 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ | 117 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_FACTORY_H_ |
OLD | NEW |