OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if !defined(OS_CHROMEOS) | 5 #if !defined(OS_CHROMEOS) |
6 | 6 |
7 #include "chrome/browser/ui/webui/options2/advanced_options_utils.h" | 7 #include "chrome/browser/ui/webui/options2/advanced_options_utils.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/nix/xdg_util.h" | 13 #include "base/nix/xdg_util.h" |
14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/browser/tab_contents/tab_util.h" | 16 #include "chrome/browser/tab_contents/tab_util.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
21 | 21 |
22 using content::BrowserThread; | 22 using content::BrowserThread; |
23 using content::OpenURLParams; | 23 using content::OpenURLParams; |
24 using content::Referrer; | 24 using content::Referrer; |
25 using content::WebContents; | 25 using content::WebContents; |
26 | 26 |
27 namespace options2 { | 27 namespace options { |
28 | 28 |
29 // Command used to configure GNOME 2 proxy settings. | 29 // Command used to configure GNOME 2 proxy settings. |
30 const char* kGNOME2ProxyConfigCommand[] = {"gnome-network-properties", NULL}; | 30 const char* kGNOME2ProxyConfigCommand[] = {"gnome-network-properties", NULL}; |
31 // In GNOME 3, we might need to run gnome-control-center instead. We try this | 31 // In GNOME 3, we might need to run gnome-control-center instead. We try this |
32 // only after gnome-network-properties is not found, because older GNOME also | 32 // only after gnome-network-properties is not found, because older GNOME also |
33 // has this but it doesn't do the same thing. See below where we use it. | 33 // has this but it doesn't do the same thing. See below where we use it. |
34 const char* kGNOME3ProxyConfigCommand[] = {"gnome-control-center", "network", | 34 const char* kGNOME3ProxyConfigCommand[] = {"gnome-control-center", "network", |
35 NULL}; | 35 NULL}; |
36 // KDE3 and KDE4 are only slightly different, but incompatible. Go figure. | 36 // KDE3 and KDE4 are only slightly different, but incompatible. Go figure. |
37 const char* kKDE3ProxyConfigCommand[] = {"kcmshell", "proxy", NULL}; | 37 const char* kKDE3ProxyConfigCommand[] = {"kcmshell", "proxy", NULL}; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } // anonymous namespace | 147 } // anonymous namespace |
148 | 148 |
149 void AdvancedOptionsUtilities::ShowNetworkProxySettings( | 149 void AdvancedOptionsUtilities::ShowNetworkProxySettings( |
150 WebContents* web_contents) { | 150 WebContents* web_contents) { |
151 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 151 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
152 base::Bind(&DetectAndStartProxyConfigUtil, | 152 base::Bind(&DetectAndStartProxyConfigUtil, |
153 web_contents->GetRenderProcessHost()->GetID(), | 153 web_contents->GetRenderProcessHost()->GetID(), |
154 web_contents->GetRenderViewHost()->GetRoutingID())); | 154 web_contents->GetRenderViewHost()->GetRoutingID())); |
155 } | 155 } |
156 | 156 |
157 } // namespace options2 | 157 } // namespace options |
158 | 158 |
159 #endif // !defined(OS_CHROMEOS) | 159 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |