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

Side by Side Diff: components/os_crypt/key_storage_util_linux.cc

Issue 2256633002: Add two more options for the --password-store switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 4 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
« no previous file with comments | « components/os_crypt/key_storage_util_linux.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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/os_crypt/key_storage_util_linux.h"
6
7 #include "base/logging.h"
8
9 namespace os_crypt {
10
11 SelectedLinuxBackend SelectBackend(const std::string& type,
12 base::nix::DesktopEnvironment desktop_env) {
13 if (type == "kwallet")
14 return SelectedLinuxBackend::KWALLET;
15 if (type == "kwallet5")
16 return SelectedLinuxBackend::KWALLET5;
17 if (type == "gnome")
18 return SelectedLinuxBackend::GNOME_ANY;
19 if (type == "gnome-keyring")
20 return SelectedLinuxBackend::GNOME_KEYRING;
21 if (type == "gnome-libsecret")
22 return SelectedLinuxBackend::GNOME_LIBSECRET;
23 if (type == "basic")
24 return SelectedLinuxBackend::BASIC_TEXT;
25
26 const char* name = base::nix::GetDesktopEnvironmentName(desktop_env);
27 VLOG(1) << "Password storage detected desktop environment: "
28 << (name ? name : "(unknown)");
29
30 // Detect the store to use automatically.
31 switch (desktop_env) {
32 case base::nix::DESKTOP_ENVIRONMENT_KDE4:
33 return SelectedLinuxBackend::KWALLET;
34 case base::nix::DESKTOP_ENVIRONMENT_KDE5:
35 return SelectedLinuxBackend::KWALLET5;
36 case base::nix::DESKTOP_ENVIRONMENT_GNOME:
37 case base::nix::DESKTOP_ENVIRONMENT_UNITY:
38 case base::nix::DESKTOP_ENVIRONMENT_XFCE:
39 return SelectedLinuxBackend::GNOME_ANY;
40 // KDE3 didn't use DBus, which our KWallet store uses.
41 case base::nix::DESKTOP_ENVIRONMENT_KDE3:
42 case base::nix::DESKTOP_ENVIRONMENT_OTHER:
43 return SelectedLinuxBackend::BASIC_TEXT;
44 }
45 }
46
47 } // namespace os_crypt
OLDNEW
« no previous file with comments | « components/os_crypt/key_storage_util_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698