| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 FontServiceApp::FontServiceApp() {} | 57 FontServiceApp::FontServiceApp() {} |
| 58 | 58 |
| 59 FontServiceApp::~FontServiceApp() {} | 59 FontServiceApp::~FontServiceApp() {} |
| 60 | 60 |
| 61 void FontServiceApp::Initialize(mojo::Shell* shell, const std::string& url, | 61 void FontServiceApp::Initialize(mojo::Shell* shell, const std::string& url, |
| 62 uint32_t id) { | 62 uint32_t id) { |
| 63 tracing_.Initialize(shell, url); | 63 tracing_.Initialize(shell, url); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) { | 66 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) { |
| 67 connection->AddService(this); | 67 connection->AddInterface(this); |
| 68 return true; | 68 return true; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void FontServiceApp::Create(mojo::Connection* connection, | 71 void FontServiceApp::Create(mojo::Connection* connection, |
| 72 mojo::InterfaceRequest<FontService> request) { | 72 mojo::InterfaceRequest<FontService> request) { |
| 73 bindings_.AddBinding(this, std::move(request)); | 73 bindings_.AddBinding(this, std::move(request)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, | 76 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, |
| 77 TypefaceStyle requested_style, | 77 TypefaceStyle requested_style, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 int count = paths_.count(); | 117 int count = paths_.count(); |
| 118 for (int i = 0; i < count; ++i) { | 118 for (int i = 0; i < count; ++i) { |
| 119 if (path == *paths_[i]) | 119 if (path == *paths_[i]) |
| 120 return i; | 120 return i; |
| 121 } | 121 } |
| 122 *paths_.append() = new SkString(path); | 122 *paths_.append() = new SkString(path); |
| 123 return count; | 123 return count; |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace font_service | 126 } // namespace font_service |
| OLD | NEW |