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_
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
{
21 enum ConnectionFlags
{
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
,
41 } // namespace chromeos
43 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_