OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
12 | 12 |
13 class FilePath; | 13 class FilePath; |
14 class RefCountedBytes; | 14 class RefCountedMemory; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 } | 18 } |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 // This class is used for encapsulating the statics and other other messy | 22 // This class is used for encapsulating the statics and other other messy |
23 // external calls that are required for creating and getting the needed HTML | 23 // external calls that are required for creating and getting the needed HTML |
24 // objects. This allows for easier mocking of this code and allows for | 24 // objects. This allows for easier mocking of this code and allows for |
25 // modularity. Since we don't currently unit the class that this code is related | 25 // modularity. Since we don't currently unit the class that this code is related |
26 // to, there is a case for refactoring it back into LoginUIHTMLSource. | 26 // to, there is a case for refactoring it back into LoginUIHTMLSource. |
27 class HTMLOperationsInterface { | 27 class HTMLOperationsInterface { |
28 public: | 28 public: |
29 HTMLOperationsInterface() {} | 29 HTMLOperationsInterface() {} |
30 virtual ~HTMLOperationsInterface() {} | 30 virtual ~HTMLOperationsInterface() {} |
31 | 31 |
32 virtual base::StringPiece GetLoginHTML(); | 32 virtual base::StringPiece GetLoginHTML(); |
33 virtual std::string GetFullHTML(base::StringPiece login_html, | 33 virtual std::string GetFullHTML(base::StringPiece login_html, |
34 base::DictionaryValue* localized_strings); | 34 base::DictionaryValue* localized_strings); |
35 virtual RefCountedBytes* CreateHTMLBytes(std::string full_html); | |
36 | 35 |
37 private: | 36 private: |
38 DISALLOW_COPY_AND_ASSIGN(HTMLOperationsInterface); | 37 DISALLOW_COPY_AND_ASSIGN(HTMLOperationsInterface); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace chromeos | 40 } // namespace chromeos |
42 | 41 |
43 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ | 42 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_LOGIN_UI_HELPERS_H_ |
OLD | NEW |