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

Side by Side Diff: webkit/plugins/ppapi/ppb_font_impl.cc

Issue 7044012: Support getting the font list in Pepper. This currently only works out of (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppb_font_impl.h ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_font_impl.h" 5 #include "webkit/plugins/ppapi/ppb_font_impl.h"
6 6
7 #include "ppapi/c/dev/ppb_font_dev.h" 7 #include "ppapi/c/dev/ppb_font_dev.h"
8 #include "ppapi/thunk/thunk.h" 8 #include "ppapi/thunk/thunk.h"
9 #include "webkit/plugins/ppapi/common.h" 9 #include "webkit/plugins/ppapi/common.h"
10 #include "webkit/plugins/ppapi/plugin_module.h" 10 #include "webkit/plugins/ppapi/plugin_module.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 WebKitForwarding::Font* result = NULL; 44 WebKitForwarding::Font* result = NULL;
45 instance->module()->GetWebKitForwarding()->CreateFontForwarding( 45 instance->module()->GetWebKitForwarding()->CreateFontForwarding(
46 NULL, desc, face_name ? face_name->value() : std::string(), &result); 46 NULL, desc, face_name ? face_name->value() : std::string(), &result);
47 font_forwarding_.reset(result); 47 font_forwarding_.reset(result);
48 } 48 }
49 49
50 PPB_Font_Impl::~PPB_Font_Impl() { 50 PPB_Font_Impl::~PPB_Font_Impl() {
51 } 51 }
52 52
53 // static
54 const PPB_Font_Dev* PPB_Font_Impl::GetInterface() {
55 return ::ppapi::thunk::GetPPB_Font_Thunk();
56 }
57
58 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsFont_API() { 53 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsFont_API() {
59 return this; 54 return this;
60 } 55 }
61 56
62 PPB_Font_Impl* PPB_Font_Impl::AsPPB_Font_Impl() { 57 PPB_Font_Impl* PPB_Font_Impl::AsPPB_Font_Impl() {
63 return this; 58 return this;
64 } 59 }
65 60
66 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, 61 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description,
67 PP_FontMetrics_Dev* metrics) { 62 PP_FontMetrics_Dev* metrics) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 int32_t PPB_Font_Impl::PixelOffsetForCharacter(const PP_TextRun_Dev* text, 118 int32_t PPB_Font_Impl::PixelOffsetForCharacter(const PP_TextRun_Dev* text,
124 uint32_t char_offset) { 119 uint32_t char_offset) {
125 int32_t result = -1; 120 int32_t result = -1;
126 WebKitForwarding::Font::TextRun run; 121 WebKitForwarding::Font::TextRun run;
127 if (PPTextRunToTextRun(text, &run)) { 122 if (PPTextRunToTextRun(text, &run)) {
128 font_forwarding_->PixelOffsetForCharacter(NULL, run, char_offset, &result); 123 font_forwarding_->PixelOffsetForCharacter(NULL, run, char_offset, &result);
129 } 124 }
130 return result; 125 return result;
131 } 126 }
132 127
128 PPB_Font_FunctionImpl::PPB_Font_FunctionImpl() {
129 }
130
131 PPB_Font_FunctionImpl::~PPB_Font_FunctionImpl() {
132 }
133
134 ::ppapi::thunk::PPB_Font_FunctionAPI*
135 PPB_Font_FunctionImpl::AsFont_FunctionAPI() {
136 return this;
137 }
138
139 PP_Var PPB_Font_FunctionImpl::GetFontFamilies(PP_Instance instance) {
140 return PP_MakeUndefined();
141 }
142
133 } // namespace ppapi 143 } // namespace ppapi
134 } // namespace webkit 144 } // namespace webkit
135 145
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_font_impl.h ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698