Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: webkit/mocks/mock_webhyphenator.h

Issue 12335128: Switch from using individual methods for hyphenation to using the WebHyphantor interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_MOCKS_MOCK_WEBHYPHENATOR_H_
6 #define WEBKIT_MOCKS_MOCK_WEBHYPHENATOR_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/platform_file.h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebHyphenator.h"
12
13 typedef struct _HyphenDict HyphenDict;
14
15 namespace webkit_glue {
16
17 class MockWebHyphenator : public WebKit::WebHyphenator {
18 public:
19 MockWebHyphenator();
20 virtual ~MockWebHyphenator();
21
22 // Loads the hyphenation dictionary. |dict_file| should be an open fd to
23 // third_party/hyphen/hyph_en_US.dic.
24 void LoadDictionary(base::PlatformFile dict_file);
25
26 // WebHyphenator implementation.
27 virtual bool canHyphenate(const WebKit::WebString& locale) OVERRIDE;
28 virtual size_t computeLastHyphenLocation(
29 const char16* characters,
30 size_t length,
31 size_t before_index,
32 const WebKit::WebString& locale) OVERRIDE;
33
34 private:
35 HyphenDict* hyphen_dictionary_;
36
37 DISALLOW_COPY_AND_ASSIGN(MockWebHyphenator);
38 };
39
40 } // namespace webkit_glue
41
42 #endif // WEBKIT_MOCKS_MOCK_WEBHYPHENATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698