summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 00:22:21 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 00:22:21 +0000
commit63692215e10b693db53a395a9fdefd77cf3a6fc6 (patch)
tree5def9ef1dd75c3924f351c760ad9fa8e98065770
parent86f56f6d510c533fe570fb6153b6c1f7b4b365a3 (diff)
downloadchromium_src-63692215e10b693db53a395a9fdefd77cf3a6fc6.zip
chromium_src-63692215e10b693db53a395a9fdefd77cf3a6fc6.tar.gz
chromium_src-63692215e10b693db53a395a9fdefd77cf3a6fc6.tar.bz2
Linux: make compile-time dependency on gnome-keyring optional.
This is upstreaming a Gentoo Linux patch. BUG=none TEST=none Review URL: http://codereview.chromium.org/3380004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59587 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi17
-rw-r--r--build/linux/system.gyp5
-rw-r--r--chrome/browser/profile_impl.cc4
-rw-r--r--chrome/chrome_browser.gypi8
4 files changed, 29 insertions, 5 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 2730feb..0f721ed 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -73,16 +73,26 @@
'library%': 'static_library',
},
- # Set default value of toolkit_views on for Windows, Chrome OS
- # and the touch UI.
- # We set it at this level of nesting so the value is available for
+ # We set those at this level of nesting so the values are available for
# other conditionals below.
'conditions': [
+ # Set default value of toolkit_views on for Windows, Chrome OS
+ # and the touch UI.
['OS=="win" or chromeos==1 or touchui==1', {
'toolkit_views%': 1,
}, {
'toolkit_views%': 0,
}],
+
+ # A flag to enable or disable our compile-time dependency
+ # on gnome-keyring. If that dependency is disabled, no gnome-keyring
+ # support will be available. This option is useful
+ # for Linux distributions.
+ ['chromeos==1', {
+ 'use_gnome_keyring%': 0,
+ }, {
+ 'use_gnome_keyring%': 1,
+ }],
],
'host_arch%': '<(host_arch)',
@@ -143,6 +153,7 @@
'target_arch%': '<(target_arch)',
'host_arch%': '<(host_arch)',
'toolkit_views%': '<(toolkit_views)',
+ 'use_gnome_keyring%': '<(use_gnome_keyring)',
'chromeos%': '<(chromeos)',
'touchui%': '<(touchui)',
'inside_chromium_build%': '<(inside_chromium_build)',
diff --git a/build/linux/system.gyp b/build/linux/system.gyp
index f746ebf..816c584 100644
--- a/build/linux/system.gyp
+++ b/build/linux/system.gyp
@@ -259,11 +259,14 @@
'target_name': 'gnome-keyring',
'type': 'settings',
'conditions': [
- ['chromeos==0', {
+ ['use_gnome_keyring==1', {
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags gnome-keyring-1)',
],
+ 'defines': [
+ 'USE_GNOME_KEYRING',
+ ],
'conditions': [
['linux_link_gnome_keyring==0', {
'defines': ['DLOPEN_GNOME_KEYRING'],
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index f972716..2a3bb3f 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -93,7 +93,9 @@
#include "chrome/browser/chromeos/proxy_config_service_impl.h"
#elif defined(OS_POSIX) && !defined(OS_CHROMEOS)
#include "base/xdg_util.h"
+#if defined(USE_GNOME_KEYRING)
#include "chrome/browser/password_manager/native_backend_gnome_x.h"
+#endif
#include "chrome/browser/password_manager/native_backend_kwallet_x.h"
#include "chrome/browser/password_manager/password_store_x.h"
#endif
@@ -965,12 +967,14 @@ void ProfileImpl::CreatePasswordStore() {
backend.reset();
} else if (desktop_env == base::DESKTOP_ENVIRONMENT_GNOME ||
desktop_env == base::DESKTOP_ENVIRONMENT_XFCE) {
+#if defined(USE_GNOME_KEYRING)
LOG(INFO) << "Trying GNOME keyring for password storage.";
backend.reset(new NativeBackendGnome());
if (backend->Init())
LOG(INFO) << "Using GNOME keyring for password storage.";
else
backend.reset();
+#endif // defined(USE_GNOME_KEYRING)
}
// TODO(mdm): this can change to a WARNING when we detect by default.
if (!backend.get())
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 5032f92..f2b675f 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -3186,6 +3186,12 @@
],
},
}],
+ ['use_gnome_keyring==0', {
+ 'sources!': [
+ 'browser/password_manager/native_backend_gnome_x.h',
+ 'browser/password_manager/native_backend_gnome_x.cc',
+ ],
+ }],
['touchui==0', {
'sources!': [
# Nothing yet.
@@ -3220,7 +3226,7 @@
'third_party/mozilla_security_manager/nsUsageArrayHelper.h',
],
'conditions': [
- ['chromeos==0', {
+ ['use_gnome_keyring==1', {
'dependencies': [
'../build/linux/system.gyp:gnome-keyring',
],