Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / base / android / system_ui_resource_manager.h
blobe1b2edfaf8fc7de86c1a451128bf55cb497a8be3
1 // Copyright 2014 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 UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_
6 #define UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_
8 #include "cc/resources/ui_resource_client.h"
9 #include "ui/base/ui_base_export.h"
11 namespace ui {
13 // Interface for loading and accessing shared system UI resources.
14 class UI_BASE_EXPORT SystemUIResourceManager {
15 public:
16 enum ResourceType {
17 OVERSCROLL_EDGE = 0,
18 OVERSCROLL_GLOW,
19 OVERSCROLL_GLOW_L,
20 RESOURCE_TYPE_FIRST = OVERSCROLL_EDGE,
21 RESOURCE_TYPE_LAST = OVERSCROLL_GLOW_L
24 virtual ~SystemUIResourceManager() {}
26 // Optionally trigger bitmap loading for a given |resource|, if necessary.
27 // Note that this operation may be asynchronous, and subsequent queries to
28 // |GetUIResourceId()| will yield a valid result only after loading finishes.
29 // This method is particularly useful for idly loading a resource before an
30 // explicit cc::UIResourceId is required. Repeated calls will be ignored.
31 virtual void PreloadResource(ResourceType resource) = 0;
33 // Return the resource id associated with |resource|. If loading hasn't yet
34 // begun for the given |resource|, it will be triggered immediately. If
35 // loading is asynchronous, 0 will be returned until loading has finished, and
36 // the caller is responsible for re-querying until a valid id is returned.
37 virtual cc::UIResourceId GetUIResourceId(ResourceType resource) = 0;
40 } // namespace ui
42 #endif // UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_