OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/options/advanced_options_utils.h" | 7 #include "chrome/browser/ui/webui/options/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" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Show the proxy config URL in the given tab. | 46 // Show the proxy config URL in the given tab. |
47 void ShowLinuxProxyConfigUrl(int render_process_id, int render_view_id) { | 47 void ShowLinuxProxyConfigUrl(int render_process_id, int render_view_id) { |
48 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 48 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
49 scoped_ptr<base::Environment> env(base::Environment::Create()); | 49 scoped_ptr<base::Environment> env(base::Environment::Create()); |
50 const char* name = base::nix::GetDesktopEnvironmentName(env.get()); | 50 const char* name = base::nix::GetDesktopEnvironmentName(env.get()); |
51 if (name) | 51 if (name) |
52 LOG(ERROR) << "Could not find " << name << " network settings in $PATH"; | 52 LOG(ERROR) << "Could not find " << name << " network settings in $PATH"; |
53 OpenURLParams params( | 53 OpenURLParams params( |
54 GURL(kLinuxProxyConfigUrl), Referrer(), NEW_FOREGROUND_TAB, | 54 GURL(kLinuxProxyConfigUrl), Referrer(), NEW_FOREGROUND_TAB, |
55 content::PAGE_TRANSITION_LINK, false); | 55 ui::PAGE_TRANSITION_LINK, false); |
56 | 56 |
57 WebContents* web_contents = | 57 WebContents* web_contents = |
58 tab_util::GetWebContentsByID(render_process_id, render_view_id); | 58 tab_util::GetWebContentsByID(render_process_id, render_view_id); |
59 if (web_contents) | 59 if (web_contents) |
60 web_contents->OpenURL(params); | 60 web_contents->OpenURL(params); |
61 } | 61 } |
62 | 62 |
63 // Start the given proxy configuration utility. | 63 // Start the given proxy configuration utility. |
64 bool StartProxyConfigUtil(const char* command[]) { | 64 bool StartProxyConfigUtil(const char* command[]) { |
65 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 65 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 options | 157 } // namespace options |
158 | 158 |
159 #endif // !defined(OS_CHROMEOS) | 159 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |