| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/font_service/font_service_app.h" | 5 #include "components/font_service/font_service_app.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 namespace font_service { | 48 namespace font_service { |
| 49 | 49 |
| 50 FontServiceApp::FontServiceApp() {} | 50 FontServiceApp::FontServiceApp() {} |
| 51 | 51 |
| 52 FontServiceApp::~FontServiceApp() {} | 52 FontServiceApp::~FontServiceApp() {} |
| 53 | 53 |
| 54 void FontServiceApp::Initialize(mojo::Connector* connector, | 54 void FontServiceApp::Initialize(shell::Connector* connector, |
| 55 const mojo::Identity& identity, | 55 const shell::Identity& identity, |
| 56 uint32_t id) { | 56 uint32_t id) { |
| 57 tracing_.Initialize(connector, identity.name()); | 57 tracing_.Initialize(connector, identity.name()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) { | 60 bool FontServiceApp::AcceptConnection(shell::Connection* connection) { |
| 61 connection->AddInterface(this); | 61 connection->AddInterface(this); |
| 62 return true; | 62 return true; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void FontServiceApp::Create(mojo::Connection* connection, | 65 void FontServiceApp::Create(shell::Connection* connection, |
| 66 mojo::InterfaceRequest<FontService> request) { | 66 mojo::InterfaceRequest<FontService> request) { |
| 67 bindings_.AddBinding(this, std::move(request)); | 67 bindings_.AddBinding(this, std::move(request)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, | 70 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, |
| 71 TypefaceStylePtr requested_style, | 71 TypefaceStylePtr requested_style, |
| 72 const MatchFamilyNameCallback& callback) { | 72 const MatchFamilyNameCallback& callback) { |
| 73 SkFontConfigInterface::FontIdentity result_identity; | 73 SkFontConfigInterface::FontIdentity result_identity; |
| 74 SkString result_family; | 74 SkString result_family; |
| 75 SkFontStyle result_style; | 75 SkFontStyle result_style; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 int count = paths_.size(); | 122 int count = paths_.size(); |
| 123 for (int i = 0; i < count; ++i) { | 123 for (int i = 0; i < count; ++i) { |
| 124 if (path == paths_[i]) | 124 if (path == paths_[i]) |
| 125 return i; | 125 return i; |
| 126 } | 126 } |
| 127 paths_.emplace_back(path); | 127 paths_.emplace_back(path); |
| 128 return count; | 128 return count; |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace font_service | 131 } // namespace font_service |
| OLD | NEW |