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

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: nit 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
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 SelectedLinuxBackend SelectBackend(const std::string& command,
10 base::nix::DesktopEnvironment desktop_env) {
11 if (command == "kwallet")
12 return SelectedLinuxBackend::KWALLET;
13 if (command == "kwallet5")
14 return SelectedLinuxBackend::KWALLET5;
15 if (command == "gnome")
16 return SelectedLinuxBackend::GNOME_ANY;
17 if (command == "gnome-keyring")
18 return SelectedLinuxBackend::GNOME_KEYRING;
19 if (command == "gnome-libsecret")
20 return SelectedLinuxBackend::GNOME_LIBSECRET;
21 if (command == "basic")
22 return SelectedLinuxBackend::BASIC_TEXT;
23
24 const char* name = base::nix::GetDesktopEnvironmentName(desktop_env);
25 VLOG(1) << "Password storage detected desktop environment: "
26 << (name ? name : "(unknown)");
27
28 // Detect the store to use automatically.
29 switch (desktop_env) {
30 case base::nix::DESKTOP_ENVIRONMENT_KDE4:
31 return SelectedLinuxBackend::KWALLET;
32 case base::nix::DESKTOP_ENVIRONMENT_KDE5:
33 return SelectedLinuxBackend::KWALLET5;
34 case base::nix::DESKTOP_ENVIRONMENT_GNOME:
35 case base::nix::DESKTOP_ENVIRONMENT_UNITY:
36 case base::nix::DESKTOP_ENVIRONMENT_XFCE:
37 return SelectedLinuxBackend::GNOME_ANY;
38 // KDE3 didn't use DBus, which our KWallet store uses.
39 case base::nix::DESKTOP_ENVIRONMENT_KDE3:
40 case base::nix::DESKTOP_ENVIRONMENT_OTHER:
41 return SelectedLinuxBackend::BASIC_TEXT;
42 }
43 }
OLDNEW
« components/os_crypt/key_storage_util_linux.h ('K') | « 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