Index: content/renderer/font_access/web_font_access_impl.h |
diff --git a/content/renderer/font_access/web_font_access_impl.h b/content/renderer/font_access/web_font_access_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..05a7095d4d1a39a686cb833f08f6fb3706b1ce34 |
--- /dev/null |
+++ b/content/renderer/font_access/web_font_access_impl.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_RENDERER_FONT_ACCESS_WEB_FONT_ACCESS_IMPL_H_ |
+#define CONTENT_RENDERER_FONT_ACCESS_WEB_FONT_ACCESS_IMPL_H_ |
+ |
+#include "base/compiler_specific.h" |
+#include "content/common/content_export.h" |
+#include "content/common/font_access/font_access_service.mojom.h" |
+#include "mojo/public/cpp/bindings/lib/buffer.h" |
+#include "third_party/WebKit/public/platform/modules/font_access/WebFontAccess.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT WebFontAccessImpl final |
+ : NON_EXPORTED_BASE(public blink::WebFontAccess) { |
+ public: |
+ WebFontAccessImpl(); |
+ ~WebFontAccessImpl() override; |
+ |
+ void getFonts(blink::FontAccessCallbacks*) override; |
+ void getFontWebData(const blink::WebString& family, |
+ const blink::WebString& style, |
+ blink::FontDataCallbacks*) override; |
+ |
+ private: |
+ void FontListHasLoaded(scoped_ptr<blink::FontAccessCallbacks> callbacks, |
+ mojo::Array<FontDescriptionPtr> fonts); |
+ void FontDataHasLoaded(scoped_ptr<blink::FontDataCallbacks> callbacks, |
+ mojo::ScopedSharedBufferHandle handle, |
+ uint64_t size); |
+ |
+ FontAccessServicePtr& GetService(); |
+ |
+ FontAccessServicePtr provider_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WebFontAccessImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_FONT_ACCESS_WEB_FONT_ACCESS_IMPL_H_ |