OLD | NEW |
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 #include "content/browser/hyphenation/hyphenation_impl.h" | 5 #include "content/browser/hyphenation/hyphenation_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
16 #include "base/timer/elapsed_timer.h" | 17 #include "base/timer/elapsed_timer.h" |
17 #include "mojo/public/cpp/bindings/strong_binding.h" | 18 #include "mojo/public/cpp/bindings/strong_binding.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 using DictionaryFileMap = std::unordered_map<std::string, base::File>; | 22 using DictionaryFileMap = std::unordered_map<std::string, base::File>; |
22 | 23 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 67 |
67 void HyphenationImpl::OpenDictionary(const std::string& locale, | 68 void HyphenationImpl::OpenDictionary(const std::string& locale, |
68 const OpenDictionaryCallback& callback) { | 69 const OpenDictionaryCallback& callback) { |
69 if (IsValidLocale(locale)) | 70 if (IsValidLocale(locale)) |
70 callback.Run(GetDictionaryFile(locale)); | 71 callback.Run(GetDictionaryFile(locale)); |
71 else | 72 else |
72 callback.Run(base::File()); | 73 callback.Run(base::File()); |
73 } | 74 } |
74 | 75 |
75 } // namespace hyphenation | 76 } // namespace hyphenation |
OLD | NEW |