Vectorize website settings icons in omnibox
[chromium-blink-merge.git] / ppapi / cpp / module_impl.h
blobfa2c61923bee205a1a34746104baf615a0435b21
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.
5 #ifndef PPAPI_CPP_MODULE_IMPL_H_
6 #define PPAPI_CPP_MODULE_IMPL_H_
8 /// @file
9 /// This file defines some simple function templates that help the C++ wrappers
10 /// (and are not for external developers to use).
12 #include "ppapi/cpp/module.h"
14 namespace pp {
16 namespace {
18 // Specialize this function to return the interface string corresponding to the
19 // PP?_XXX structure.
20 template <typename T> const char* interface_name() {
21 return NULL;
24 template <typename T> inline T const* get_interface() {
25 static T const* funcs = reinterpret_cast<T const*>(
26 pp::Module::Get()->GetBrowserInterface(interface_name<T>()));
27 return funcs;
30 template <typename T> inline bool has_interface() {
31 return get_interface<T>() != NULL;
34 } // namespace
36 } // namespace pp
38 #endif // PPAPI_CPP_MODULE_IMPL_H_