summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-18 00:34:56 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-18 00:34:56 +0000
commit200e80dc6a93fa165551590e9cb1ba589ec0958e (patch)
treec5c878f63eadd0c8e1d6477570a6b37d1bb0b819
parentd4c755d3917ec20b811d4b868c18cb40cae6713b (diff)
downloadchromium_src-200e80dc6a93fa165551590e9cb1ba589ec0958e.zip
chromium_src-200e80dc6a93fa165551590e9cb1ba589ec0958e.tar.gz
chromium_src-200e80dc6a93fa165551590e9cb1ba589ec0958e.tar.bz2
Revert "Add proxy config (using gnome-network-preferences)"
This reverts commit d06bc0c855b1e81e36c7bfc9bef342eb358d99a5. TBR=estade git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21033 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/linux_util.cc10
-rw-r--r--base/linux_util.h6
-rw-r--r--chrome/app/resources/locale_settings.grd6
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc52
-rw-r--r--net/proxy/proxy_config_service_linux.cc9
5 files changed, 8 insertions, 75 deletions
diff --git a/base/linux_util.cc b/base/linux_util.cc
index d8b36ed..604980b 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -59,14 +59,4 @@ std::string GetLinuxDistro() {
return linux_distro;
}
-bool UseGnomeForSettings() {
- // GNOME_DESKTOP_SESSION_ID being defined is a good indication that
- // we are probably running under GNOME.
- // Note: KDE_FULL_SESSION is a corresponding env var to recognize KDE.
- char* desktop_session;
- return (getenv("GNOME_DESKTOP_SESSION_ID") ||
- ((desktop_session = getenv("DESKTOP_SESSION")) &&
- std::string(desktop_session) == "gnome"));
-}
-
} // namespace base
diff --git a/base/linux_util.h b/base/linux_util.h
index 75b4ad4..973a2b0 100644
--- a/base/linux_util.h
+++ b/base/linux_util.h
@@ -20,12 +20,6 @@ uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride);
// GetWinVersion() in base/win_util.h.
std::string GetLinuxDistro();
-// Return true if we appear to be running under Gnome and should attempt to use
-// some prefrences from the desktop environment (eg proxy settings),
-// If someone adds support for other environments, this function could be
-// replaced with one that returns an enum so we an specify Gnome, KDE, etc.
-bool UseGnomeForSettings();
-
} // namespace base
#endif // BASE_LINUX_UTIL_H__
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd
index aeb4c52..857bfde 100644
--- a/chrome/app/resources/locale_settings.grd
+++ b/chrome/app/resources/locale_settings.grd
@@ -543,12 +543,6 @@
<message name="IDS_CHROMIUM_PROJECT_URL" translateable="false">
http://code.google.com/chromium/?hl=[GRITLANGCODE]
</message>
-
- <!-- The URL for Linux proxy configuration help when not running under -->
- <!-- a supported desktop environment. -->
- <message name="IDS_LINUX_PROXY_CONFIG_URL" translateable="false">
- http://code.google.com/p/chromium/wiki/LinuxProxyConfig
- </message>
</messages>
</release>
</grit>
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index 4dc0460..89c4d18 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -4,14 +4,9 @@
#include "chrome/browser/gtk/options/advanced_contents_gtk.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-
#include "app/l10n_util.h"
#include "base/basictypes.h"
-#include "base/linux_util.h"
#include "base/path_service.h"
-#include "base/process_util.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
@@ -34,9 +29,6 @@
namespace {
-// Command used to configure the gconf proxy settings.
-const char kProxyConfigBinary[] = "gnome-network-preferences";
-
// The pixel width we wrap labels at.
// TODO(evanm): make the labels wrap at the appropriate width.
const int kWrapWidth = 475;
@@ -258,10 +250,6 @@ class NetworkSection : public OptionsPageBase {
}
private:
- // The callback functions for invoking the proxy config dialog.
- static void OnChangeProxiesButtonClicked(GtkButton *button,
- NetworkSection* section);
-
// The widget containing the options for this section.
GtkWidget* page_;
@@ -271,48 +259,10 @@ class NetworkSection : public OptionsPageBase {
NetworkSection::NetworkSection(Profile* profile)
: OptionsPageBase(profile) {
page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
-
- GtkWidget* proxy_description_label = CreateWrappedLabel(
- IDS_OPTIONS_PROXIES_LABEL);
- gtk_misc_set_alignment(GTK_MISC(proxy_description_label), 0, 0);
- gtk_box_pack_start(GTK_BOX(page_), proxy_description_label,
- FALSE, FALSE, 0);
-
- GtkWidget* change_proxies_button = gtk_button_new_with_label(
- l10n_util::GetStringUTF8(
- IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON).c_str());
- g_signal_connect(change_proxies_button, "clicked",
- G_CALLBACK(OnChangeProxiesButtonClicked), this);
- // Stick it in an hbox so it doesn't expand to the whole width.
- GtkWidget* button_hbox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(button_hbox),
- change_proxies_button,
+ gtk_box_pack_start(GTK_BOX(page_), gtk_label_new("TODO network options"),
FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(page_),
- OptionsLayoutBuilderGtk::IndentWidget(button_hbox),
- FALSE, FALSE, 0);
-}
-
-// static
-void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
- NetworkSection* section) {
- section->UserMetricsRecordAction(L"Options_ChangeProxies", NULL);
-
- if (base::UseGnomeForSettings()) {
- std::vector<std::string> argv;
- argv.push_back(kProxyConfigBinary);
- if (!base::LaunchApp(CommandLine(argv), false, false, NULL)) {
- LOG(ERROR) << "OpenProxyConfigDialogTask failed";
- return;
- }
- } else {
- BrowserList::GetLastActive()->
- OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LINUX_PROXY_CONFIG_URL)),
- GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
- }
}
-
///////////////////////////////////////////////////////////////////////////////
// PrivacySection
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index eef6d97..f85e450 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -7,7 +7,6 @@
#include <gconf/gconf-client.h>
#include <stdlib.h>
-#include "base/linux_util.h"
#include "base/logging.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
@@ -536,6 +535,13 @@ ProxyConfigServiceLinux::Delegate::Delegate(
}
bool ProxyConfigServiceLinux::Delegate::ShouldTryGConf() {
+ // GNOME_DESKTOP_SESSION_ID being defined is a good indication that
+ // we are probably running under GNOME.
+ // Note: KDE_FULL_SESSION is a corresponding env var to recognize KDE.
+ std::string dummy, desktop_session;
+ return env_var_getter_->Getenv("GNOME_DESKTOP_SESSION_ID", &dummy)
+ || (env_var_getter_->Getenv("DESKTOP_SESSION", &desktop_session)
+ && desktop_session == "gnome");
// I (sdoyon) would have liked to prioritize environment variables
// and only fallback to gconf if env vars were unset. But
// gnome-terminal "helpfully" sets http_proxy and no_proxy, and it
@@ -543,7 +549,6 @@ bool ProxyConfigServiceLinux::Delegate::ShouldTryGConf() {
// mislead us.
//
// We could introduce a CHROME_PROXY_OBEY_ENV_VARS variable...??
- return base::UseGnomeForSettings();
}
void ProxyConfigServiceLinux::Delegate::SetupAndFetchInitialConfig(