| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 | 12 |
| 13 class Extension; |
| 13 class Profile; | 14 class Profile; |
| 14 | 15 |
| 15 class TerminalExtensionHelper { | 16 class TerminalExtensionHelper { |
| 16 public: | 17 public: |
| 17 // Checks if the extension whose id is |extension_id| is allowed to access | |
| 18 // terminalPrivate API. | |
| 19 static bool AllowAccessToExtension(Profile* profile, | |
| 20 const std::string& extension_id); | |
| 21 // Returns Hterm extension's entry point for Crosh. If no HTerm extension is | 18 // Returns Hterm extension's entry point for Crosh. If no HTerm extension is |
| 22 // installed, returns empty url. | 19 // installed, returns empty url. |
| 23 static GURL GetCroshExtensionURL(Profile* profile); | 20 static GURL GetCroshExtensionURL(Profile* profile); |
| 24 | |
| 25 private: | |
| 26 // Returns id of installed HTerm extension (if any), or NULL. | |
| 27 static const char* GetTerminalExtensionId(Profile* profile); | |
| 28 }; | 21 }; |
| 29 | 22 |
| 30 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ | 23 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_EXTENSION_HELPER_H_ |
| OLD | NEW |