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

Side by Side Diff: content/browser/font_list_async.h

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 | « content/browser/browser_thread.cc ('k') | content/browser/font_list_async.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_FONT_LIST_ASYNC_H_
6 #define CONTENT_BROWSER_FONT_LIST_ASYNC_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11
12 class ListValue;
13
14 namespace content {
15
16 // Wraps ownership of a ListValue so we can send it across threads without
17 // having ownership problems (for example if the calling thread goes away
18 // before the callback is executed, we want the ListValue to be destroyed.
19 struct FontListResult : public base::RefCountedThreadSafe<FontListResult> {
20 FontListResult();
21 ~FontListResult();
22
23 scoped_ptr<ListValue> list;
24 };
25
26 // Retrieves the list of fonts on the system as a list of strings. It provides
27 // a non-blocking interface to GetFontList_SlowBlocking in common/.
28 //
29 // This function will run asynchronously on a background thread since getting
30 // the font list from the system can be slow. This function may be called from
31 // any thread that has a BrowserThread::ID. The callback will be executed on
32 // the calling thread.
33 //
34 // If the caller wants to take ownership of the ListValue, it can just do
35 // FontListResult.list.release() or use scoped_ptr.swap() because this value
36 // isn't used for anything else.
37 void GetFontListAsync(
38 const base::Callback<void(scoped_refptr<FontListResult>)>& callback);
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_FONT_LIST_ASYNC_H_
OLDNEW
« no previous file with comments | « content/browser/browser_thread.cc ('k') | content/browser/font_list_async.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698