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

Unified Diff: content/renderer/font_access/web_font_access_impl.h

Issue 1615133002: Implement API for accessing fonts installed locally on the system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OWNERS Mojo. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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..fa77ca7293814d9fa999964a7f228af55ad29de1
--- /dev/null
+++ b/content/renderer/font_access/web_font_access_impl.h
@@ -0,0 +1,44 @@
+// 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_FONT_ACCESS_WEB_FONT_ACCESS_IMPL_H_
+#define CONTENT_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
+ : NON_EXPORTED_BASE(public blink::WebFontAccess) {
+ public:
+ WebFontAccessImpl();
+ ~WebFontAccessImpl() override;
+
+ void getFonts(blink::FontAccessCallbacks*) override;
+ void getFontWebData(const blink::WebString&,
+ const blink::WebString&,
+ 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_FONT_ACCESS_WEB_FONT_ACCESS_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698