OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ |
6 #define EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ | 6 #define EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // Get the portion of the manifest which should not be highlighted and is | 35 // Get the portion of the manifest which should not be highlighted and is |
36 // after the feature. | 36 // after the feature. |
37 std::string GetAfterFeature() const; | 37 std::string GetAfterFeature() const; |
38 | 38 |
39 // Populate a DictionaryValue with the highlighted portions (in UTF16) of the | 39 // Populate a DictionaryValue with the highlighted portions (in UTF16) of the |
40 // source file. | 40 // source file. |
41 void SetHighlightedRegions(base::DictionaryValue* dict) const; | 41 void SetHighlightedRegions(base::DictionaryValue* dict) const; |
42 | 42 |
43 protected: | 43 protected: |
44 FileHighlighter(const std::string& contents); | 44 explicit FileHighlighter(const std::string& contents); |
45 | 45 |
46 // The contents of the file we are parsing. | 46 // The contents of the file we are parsing. |
47 std::string contents_; | 47 std::string contents_; |
48 | 48 |
49 // The start of the feature. | 49 // The start of the feature. |
50 size_t start_; | 50 size_t start_; |
51 | 51 |
52 // The end of the feature. | 52 // The end of the feature. |
53 size_t end_; | 53 size_t end_; |
54 | 54 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Called from the constructor; determine the bounds of the line in the source | 103 // Called from the constructor; determine the bounds of the line in the source |
104 // file. | 104 // file. |
105 void Parse(size_t line_number); | 105 void Parse(size_t line_number); |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(SourceHighlighter); | 107 DISALLOW_COPY_AND_ASSIGN(SourceHighlighter); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace extensions | 110 } // namespace extensions |
111 | 111 |
112 #endif // EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ | 112 #endif // EXTENSIONS_BROWSER_FILE_HIGHLIGHTER_H_ |
OLD | NEW |