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

Side by Side Diff: components/font_service/font_service_app.cc

Issue 1675083002: Rename ApplicationDelegate to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate
Patch Set: . Created 4 years, 10 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 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"
11 #include "mojo/platform_handle/platform_handle_functions.h" 11 #include "mojo/platform_handle/platform_handle_functions.h"
12 #include "mojo/shell/public/cpp/application_connection.h" 12 #include "mojo/shell/public/cpp/connection.h"
13 13
14 static_assert(static_cast<uint32_t>(SkTypeface::kNormal) == 14 static_assert(static_cast<uint32_t>(SkTypeface::kNormal) ==
15 static_cast<uint32_t>(font_service::TypefaceStyle::NORMAL), 15 static_cast<uint32_t>(font_service::TypefaceStyle::NORMAL),
16 "Skia and font service flags must match"); 16 "Skia and font service flags must match");
17 static_assert(static_cast<uint32_t>(SkTypeface::kBold) == 17 static_assert(static_cast<uint32_t>(SkTypeface::kBold) ==
18 static_cast<uint32_t>(font_service::TypefaceStyle::BOLD), 18 static_cast<uint32_t>(font_service::TypefaceStyle::BOLD),
19 "Skia and font service flags must match"); 19 "Skia and font service flags must match");
20 static_assert(static_cast<uint32_t>(SkTypeface::kItalic) == 20 static_assert(static_cast<uint32_t>(SkTypeface::kItalic) ==
21 static_cast<uint32_t>(font_service::TypefaceStyle::ITALIC), 21 static_cast<uint32_t>(font_service::TypefaceStyle::ITALIC),
22 "Skia and font service flags must match"); 22 "Skia and font service flags must match");
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
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( 66 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) {
67 mojo::ApplicationConnection* connection) {
68 connection->AddService(this); 67 connection->AddService(this);
69 return true; 68 return true;
70 } 69 }
71 70
72 void FontServiceApp::Create(mojo::ApplicationConnection* connection, 71 void FontServiceApp::Create(mojo::Connection* connection,
73 mojo::InterfaceRequest<FontService> request) { 72 mojo::InterfaceRequest<FontService> request) {
74 bindings_.AddBinding(this, std::move(request)); 73 bindings_.AddBinding(this, std::move(request));
75 } 74 }
76 75
77 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, 76 void FontServiceApp::MatchFamilyName(const mojo::String& family_name,
78 TypefaceStyle requested_style, 77 TypefaceStyle requested_style,
79 const MatchFamilyNameCallback& callback) { 78 const MatchFamilyNameCallback& callback) {
80 SkFontConfigInterface::FontIdentity result_identity; 79 SkFontConfigInterface::FontIdentity result_identity;
81 SkString result_family; 80 SkString result_family;
82 SkTypeface::Style result_style; 81 SkTypeface::Style result_style;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 int count = paths_.count(); 117 int count = paths_.count();
119 for (int i = 0; i < count; ++i) { 118 for (int i = 0; i < count; ++i) {
120 if (path == *paths_[i]) 119 if (path == *paths_[i])
121 return i; 120 return i;
122 } 121 }
123 *paths_.append() = new SkString(path); 122 *paths_.append() = new SkString(path);
124 return count; 123 return count;
125 } 124 }
126 125
127 } // namespace font_service 126 } // namespace font_service
OLDNEW
« no previous file with comments | « components/font_service/font_service_app.h ('k') | components/html_viewer/ax_provider_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698