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

Unified Diff: ui/base/android/system_ui_resource_manager.h

Issue 422013003: [Android] Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/android/window_android_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/android/system_ui_resource_manager.h
diff --git a/ui/base/android/system_ui_resource_manager.h b/ui/base/android/system_ui_resource_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..082c8d9a9ecacf2670a5d969eb8126f6a91f89d8
--- /dev/null
+++ b/ui/base/android/system_ui_resource_manager.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_
+#define UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_
+
+#include "cc/resources/ui_resource_client.h"
+#include "ui/base/ui_base_export.h"
+
+namespace ui {
+
+// Interface for loading and accessing shared system UI resources.
+class UI_BASE_EXPORT SystemUIResourceManager {
+ public:
+ enum ResourceType { OVERSCROLL_EDGE, OVERSCROLL_GLOW };
+
+ virtual ~SystemUIResourceManager() {}
+
+ // Trigger loading of the bitmap for the given |resource|, if necessary.
+ // Note that this operation may be asynchronous, and subsequent queries to
+ // |GetUIResourceId()| will yield a valid result only after loading finishes.
+ // This method is particularly useful for idly loading a resource before an
+ // explicit cc::UIResourceId is required.
+ virtual void EnsureResource(ResourceType resource) = 0;
powei 2014/07/31 17:24:28 So it looks like overscroll is not using this righ
jdduke (slow) 2014/07/31 17:40:56 Yeah, it's unused, and I thought of just ripping i
+
+ // Return the resource id associated with |resource|. If loading hasn't yet
+ // begun for the given |resource|, it will be triggered immediately. If
+ // loading is asynchronous, 0 will be returned until loading has finished, and
+ // the caller is responsible for re-querying until a valid id is returned.
+ virtual cc::UIResourceId GetUIResourceId(ResourceType resource) = 0;
+};
+
+} // namespace ui
+
+#endif // UI_BASE_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_H_
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/android/window_android_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698