OLD | NEW |
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 "gfx/gfx_module.h" | 5 #include "gfx/gfx_module.h" |
6 | 6 |
7 namespace gfx { | 7 namespace gfx { |
8 | 8 |
9 static GfxModule::ResourceProvider resource_provider = NULL; | 9 static GfxModule::ResourceProvider resource_provider = NULL; |
10 | 10 |
11 // static | 11 // static |
12 void GfxModule::SetResourceProvider(ResourceProvider func) { | 12 void GfxModule::SetResourceProvider(ResourceProvider func) { |
13 resource_provider = func; | 13 resource_provider = func; |
14 } | 14 } |
15 | 15 |
16 // static | 16 // static |
17 base::StringPiece GfxModule::GetResource(int key) { | 17 base::StringPiece GfxModule::GetResource(int key) { |
18 return resource_provider ? resource_provider(key) : base::StringPiece(); | 18 return resource_provider ? resource_provider(key) : base::StringPiece(); |
19 } | 19 } |
20 | 20 |
21 } // namespace gfx | 21 } // namespace gfx |
OLD | NEW |