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

Side by Side Diff: chrome/browser/gtk/options/advanced_contents_gtk.cc

Issue 159297: linux: generalize desktop environment guessing to encompass KDE (Closed)
Patch Set: fixed Created 11 years, 5 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 | « base/linux_util.cc ('k') | net/proxy/proxy_config_service_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/gtk/options/advanced_contents_gtk.h" 5 #include "chrome/browser/gtk/options/advanced_contents_gtk.h"
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 FALSE, FALSE, 0); 295 FALSE, FALSE, 0);
296 } 296 }
297 297
298 // static 298 // static
299 void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button, 299 void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
300 NetworkSection* section) { 300 NetworkSection* section) {
301 section->UserMetricsRecordAction(L"Options_ChangeProxies", NULL); 301 section->UserMetricsRecordAction(L"Options_ChangeProxies", NULL);
302 302
303 scoped_ptr<base::EnvironmentVariableGetter> env_getter( 303 scoped_ptr<base::EnvironmentVariableGetter> env_getter(
304 base::EnvironmentVariableGetter::Create()); 304 base::EnvironmentVariableGetter::Create());
305 if (base::UseGnomeForSettings(env_getter.get())) { 305
306 std::vector<std::string> argv; 306 switch (base::GetDesktopEnvironment(env_getter.get())) {
307 argv.push_back(kProxyConfigBinary); 307 case base::DESKTOP_ENVIRONMENT_GNOME: {
308 base::file_handle_mapping_vector no_files; 308 std::vector<std::string> argv;
309 base::environment_vector env; 309 argv.push_back(kProxyConfigBinary);
310 base::ProcessHandle handle; 310 base::file_handle_mapping_vector no_files;
311 env.push_back(std::make_pair("GTK_PATH", 311 base::environment_vector env;
312 getenv("CHROMIUM_SAVED_GTK_PATH"))); 312 base::ProcessHandle handle;
313 if (!base::LaunchApp(argv, env, no_files, false, &handle)) { 313 env.push_back(std::make_pair("GTK_PATH",
314 LOG(ERROR) << "OpenProxyConfigDialogTask failed"; 314 getenv("CHROMIUM_SAVED_GTK_PATH")));
315 return; 315 if (!base::LaunchApp(argv, env, no_files, false, &handle)) {
316 LOG(ERROR) << "OpenProxyConfigDialogTask failed";
317 return;
318 }
319 ProcessWatcher::EnsureProcessGetsReaped(handle);
320 break;
316 } 321 }
317 ProcessWatcher::EnsureProcessGetsReaped(handle); 322
318 } else { 323 case base::DESKTOP_ENVIRONMENT_KDE:
319 BrowserList::GetLastActive()-> 324 NOTIMPLEMENTED() << "Bug 17363: obey KDE proxy settings.";
320 OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LINUX_PROXY_CONFIG_URL)), 325 // Fall through to default behavior for now.
321 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); 326
327 case base::DESKTOP_ENVIRONMENT_OTHER:
328 BrowserList::GetLastActive()->
329 OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LINUX_PROXY_CONFIG_URL)),
330 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
331 break;
322 } 332 }
323 } 333 }
324 334
325 /////////////////////////////////////////////////////////////////////////////// 335 ///////////////////////////////////////////////////////////////////////////////
326 // PrivacySection 336 // PrivacySection
327 337
328 class PrivacySection : public OptionsPageBase { 338 class PrivacySection : public OptionsPageBase {
329 public: 339 public:
330 explicit PrivacySection(Profile* profile); 340 explicit PrivacySection(Profile* profile);
331 virtual ~PrivacySection() {} 341 virtual ~PrivacySection() {}
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT), 849 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT),
840 web_content_section_->get_page_widget(), false); 850 web_content_section_->get_page_widget(), false);
841 851
842 security_section_.reset(new SecuritySection(profile_)); 852 security_section_.reset(new SecuritySection(profile_));
843 options_builder.AddOptionGroup( 853 options_builder.AddOptionGroup(
844 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY), 854 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY),
845 security_section_->get_page_widget(), false); 855 security_section_->get_page_widget(), false);
846 856
847 page_ = options_builder.get_page_widget(); 857 page_ = options_builder.get_page_widget();
848 } 858 }
OLDNEW
« no previous file with comments | « base/linux_util.cc ('k') | net/proxy/proxy_config_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698