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

Side by Side Diff: third_party/WebKit/Source/platform/text/Hyphenation.h

Issue 1978683002: Enable hyphens: auto and none in BreakingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments for heuristic, adjust widths of hyphens-auto-mock test Created 4 years, 7 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Hyphenation_h 5 #ifndef Hyphenation_h
6 #define Hyphenation_h 6 #define Hyphenation_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Forward.h" 9 #include "wtf/Forward.h"
10 #include "wtf/HashMap.h" 10 #include "wtf/HashMap.h"
11 #include "wtf/RefCounted.h" 11 #include "wtf/RefCounted.h"
12 #include "wtf/text/AtomicStringHash.h" 12 #include "wtf/text/AtomicStringHash.h"
13 #include "wtf/text/StringHash.h" 13 #include "wtf/text/StringHash.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class StringView;
18
19 class PLATFORM_EXPORT Hyphenation : public RefCounted<Hyphenation> { 17 class PLATFORM_EXPORT Hyphenation : public RefCounted<Hyphenation> {
20 public: 18 public:
21 virtual ~Hyphenation() {} 19 virtual ~Hyphenation() {}
22 20
23 static Hyphenation* get(const AtomicString& locale); 21 static Hyphenation* get(const AtomicString& locale);
24 22
25 virtual size_t lastHyphenLocation(const StringView&, size_t beforeIndex, con st AtomicString& locale) const = 0; 23 virtual size_t lastHyphenLocation(const StringView&, size_t beforeIndex) con st = 0;
26 24
27 static void setForTesting(const AtomicString& locale, PassRefPtr<Hyphenation >); 25 static void setForTesting(const AtomicString& locale, PassRefPtr<Hyphenation >);
28 static void clearForTesting(); 26 static void clearForTesting();
29 27
30 private: 28 private:
31 using HyphenationMap = HashMap<AtomicString, RefPtr<Hyphenation>, CaseFoldin gHash>; 29 using HyphenationMap = HashMap<AtomicString, RefPtr<Hyphenation>, CaseFoldin gHash>;
32 30
33 static HyphenationMap& getHyphenationMap(); 31 static HyphenationMap& getHyphenationMap();
34 static PassRefPtr<Hyphenation> platformGetHyphenation(const AtomicString& lo cale); 32 static PassRefPtr<Hyphenation> platformGetHyphenation(const AtomicString& lo cale);
35 }; 33 };
36 34
37 } // namespace blink 35 } // namespace blink
38 36
39 #endif // Hyphenation_h 37 #endif // Hyphenation_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/Font.cpp ('k') | third_party/WebKit/Source/platform/text/Hyphenation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698