OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "webkit/mocks/mock_webhyphenator.h" | 5 #include "webkit/mocks/mock_webhyphenator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_handle.h" | 8 #include "base/memory/scoped_handle.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "third_party/hyphen/hyphen.h" | 11 #include "third_party/hyphen/hyphen.h" |
12 | 12 |
13 namespace webkit_glue { | 13 namespace webkit_glue { |
14 | 14 |
15 MockWebHyphenator::MockWebHyphenator() | 15 MockWebHyphenator::MockWebHyphenator() |
16 : hyphen_dictionary_(NULL) { | 16 : hyphen_dictionary_(NULL) { |
17 } | 17 } |
18 | 18 |
19 MockWebHyphenator::~MockWebHyphenator() { | 19 MockWebHyphenator::~MockWebHyphenator() { |
20 if (hyphen_dictionary_) | 20 if (hyphen_dictionary_) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (before_index >= 2) { | 95 if (before_index >= 2) { |
96 for (size_t index = before_index - 2; index > 0; --index) { | 96 for (size_t index = before_index - 2; index > 0; --index) { |
97 if (hyphens[index] & 1) | 97 if (hyphens[index] & 1) |
98 return index + 1; | 98 return index + 1; |
99 } | 99 } |
100 } | 100 } |
101 return 0; | 101 return 0; |
102 } | 102 } |
103 | 103 |
104 } // namespace webkit_glue | 104 } // namespace webkit_glue |
OLD | NEW |