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

Unified Diff: net/detector.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cup_utils_unittest.cc ('k') | net/detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/detector.h
diff --git a/net/detector.h b/net/detector.h
deleted file mode 100644
index fdbbef460fae6733256b97854587afd6f0a5beaa..0000000000000000000000000000000000000000
--- a/net/detector.h
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2007-2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#ifndef OMAHA_NET_DETECTOR_H__
-#define OMAHA_NET_DETECTOR_H__
-
-#include <windows.h>
-#include <atlstr.h>
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-
-namespace omaha {
-
-struct ProxyConfig;
-
-class ProxyDetectorInterface {
- public:
- // Detects proxy information.
- virtual HRESULT Detect(ProxyConfig* config) = 0;
- virtual const TCHAR* source() = 0;
- virtual ~ProxyDetectorInterface() {}
-};
-
-// Detects proxy override information in the specified registry key.
-class RegistryOverrideProxyDetector : public ProxyDetectorInterface {
- public:
- explicit RegistryOverrideProxyDetector(const CString& reg_path)
- : reg_path_(reg_path) {}
-
- virtual HRESULT Detect(ProxyConfig* config);
- virtual const TCHAR* source() { return _T("RegistryOverride"); }
- private:
- CString reg_path_;
- DISALLOW_EVIL_CONSTRUCTORS(RegistryOverrideProxyDetector);
-};
-
-class UpdateDevProxyDetector : public ProxyDetectorInterface {
- public:
- UpdateDevProxyDetector();
- virtual HRESULT Detect(ProxyConfig* config) {
- return registry_detector_.Detect(config);
- }
- virtual const TCHAR* source() { return _T("UpdateDev"); }
- private:
- RegistryOverrideProxyDetector registry_detector_;
- DISALLOW_EVIL_CONSTRUCTORS(UpdateDevProxyDetector);
-};
-
-// Detects winhttp proxy information. This is what the winhttp proxy
-// configuration utility (proxycfg.exe) has set.
-// The winhttp proxy settings are under:
-// HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
-class DefaultProxyDetector : public ProxyDetectorInterface {
- public:
- DefaultProxyDetector() {}
- virtual HRESULT Detect(ProxyConfig* config);
- virtual const TCHAR* source() { return _T("winhttp"); }
- private:
- DISALLOW_EVIL_CONSTRUCTORS(DefaultProxyDetector);
-};
-
-// Detects proxy information for Firefox.
-// http://www.mozilla.org/quality/networking/docs/netprefs.html
-// It works only when the calling code runs as or it impersonates a user.
-class FirefoxProxyDetector : public ProxyDetectorInterface {
- public:
- enum ProxyType {
- PROXY_TYPE_NO_PROXY = 0,
- PROXY_TYPE_NAMED_PROXY = 1,
- PROXY_TYPE_AUTO_CONFIG_URL = 2,
- PROXY_TYPE_AUTO_DETECT = 4
- };
-
- FirefoxProxyDetector();
-
- virtual HRESULT Detect(ProxyConfig* config);
- virtual const TCHAR* source() { return _T("Firefox"); }
- private:
- // Parses the prefs.js file.
- HRESULT ParsePrefsFile(const TCHAR* name,
- const TCHAR* file_path,
- ProxyConfig* config);
-
- // Parse one line of the prefs file.
- void ParsePrefsLine(const char* ansi_line,
- CString* proxy_type,
- CString* proxy_config_url,
- CString* proxy_http_host,
- CString* proxy_http_port,
- CString* proxy_ssl_host,
- CString* proxy_ssl_port);
-
- // Builds a proxy string out of individual components.
- HRESULT BuildProxyString(const CString& http_host,
- const CString& http_port,
- const CString& ssl_host,
- const CString& ssl_port,
- CString* proxy);
-
- // Cached configuration values for the current FF profile.
- CString cached_prefs_name_;
- CString cached_prefs_file_path_;
- int64 cached_prefs_last_modified_;
- scoped_ptr<ProxyConfig> cached_config_;
-
- friend class FirefoxProxyDetectorTest;
- DISALLOW_EVIL_CONSTRUCTORS(FirefoxProxyDetector);
-};
-
-// Detects wininet proxy information for the current user. The caller must
-// run as user to retrieve the correct information.
-// It works only when the calling code runs as or it impersonates a user.
-class IEProxyDetector : public ProxyDetectorInterface {
- public:
- IEProxyDetector() {}
- virtual HRESULT Detect(ProxyConfig* config);
- virtual const TCHAR* source() { return _T("IE"); }
- private:
- DISALLOW_EVIL_CONSTRUCTORS(IEProxyDetector);
-};
-
-} // namespace omaha
-
-#endif // OMAHA_NET_DETECTOR_H__
-
« no previous file with comments | « net/cup_utils_unittest.cc ('k') | net/detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698