Return backed up TemplateURL on default search change
[chromium-blink-merge.git] / chrome / browser / chromeos / web_socket_proxy_controller.h
blob4e8ad0d703bf262ad02973705f91847022712d0c
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_
7 #pragma once
9 #include <string>
10 #include <vector>
12 namespace chromeos {
14 // Fills vector with extensions IDs which are allowed to use private
15 // extension API (WebSocketProxyPrivate, InputMethodPrivate, etc.)
16 void FillWithExtensionsIdsWithPrivateAccess(std::vector<std::string>* ids);
18 // Controls webproxy to TCP service.
19 class WebSocketProxyController {
20 public:
21 enum ConnectionFlags {
22 PLAIN_TCP = 0,
23 TLS_OVER_TCP = 1 << 0
26 // Can be called on any thread. Subsequent calls are cheap and do nothing.
27 static void Initiate();
29 // All methods can be called on any thread.
30 static void Shutdown();
31 static bool IsInitiated();
32 static int GetPort(); // Returns port listening websocket connections.
34 static bool CheckCredentials(
35 const std::string& extension_id,
36 const std::string& hostname,
37 unsigned short port,
38 ConnectionFlags);
41 } // namespace chromeos
43 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_