| 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 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 HyphenationImpl::HyphenationImpl() {} | 58 HyphenationImpl::HyphenationImpl() {} |
| 59 | 59 |
| 60 HyphenationImpl::~HyphenationImpl() {} | 60 HyphenationImpl::~HyphenationImpl() {} |
| 61 | 61 |
| 62 // static | 62 // static |
| 63 void HyphenationImpl::Create(blink::mojom::HyphenationRequest request) { | 63 void HyphenationImpl::Create(blink::mojom::HyphenationRequest request) { |
| 64 mojo::MakeStrongBinding(base::MakeUnique<HyphenationImpl>(), | 64 mojo::MakeStrongBinding(base::MakeUnique<HyphenationImpl>(), |
| 65 std::move(request)); | 65 std::move(request)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void HyphenationImpl::OpenDictionary(const mojo::String& locale, | 68 void HyphenationImpl::OpenDictionary(const std::string& locale, |
| 69 const OpenDictionaryCallback& callback) { | 69 const OpenDictionaryCallback& callback) { |
| 70 mojo::ScopedHandle handle; | 70 mojo::ScopedHandle handle; |
| 71 if (IsValidLocale(locale)) { | 71 if (IsValidLocale(locale)) { |
| 72 base::File& file = GetDictionaryFile(locale); | 72 base::File& file = GetDictionaryFile(locale); |
| 73 if (file.IsValid()) | 73 if (file.IsValid()) |
| 74 handle = mojo::WrapPlatformFile(file.Duplicate().TakePlatformFile()); | 74 handle = mojo::WrapPlatformFile(file.Duplicate().TakePlatformFile()); |
| 75 } | 75 } |
| 76 callback.Run(std::move(handle)); | 76 callback.Run(std::move(handle)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace hyphenation | 79 } // namespace hyphenation |
| OLD | NEW |