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

Unified Diff: content/browser/android/system_ui_resource_manager_impl.h

Issue 377013002: android: Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated test file entry in gypi 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
Index: content/browser/android/system_ui_resource_manager_impl.h
diff --git a/content/browser/android/system_ui_resource_manager_impl.h b/content/browser/android/system_ui_resource_manager_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..348a75fd2f4490ede301a246c5c4b060977f5449
--- /dev/null
+++ b/content/browser/android/system_ui_resource_manager_impl.h
@@ -0,0 +1,62 @@
+// 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 CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_IMPL_H_
+#define CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_IMPL_H_
+
+#include "base/basictypes.h"
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
jdduke (slow) 2014/07/23 18:17:45 Is observer_list.h used in the header? Could it be
powei 2014/07/23 21:56:09 Done.
+#include "content/browser/android/system_ui_resource.h"
jdduke (slow) 2014/07/23 18:17:45 Do we need the include? Is the forward declaration
powei 2014/07/23 21:56:09 Done.
+#include "content/common/content_export.h"
+#include "ui/base/android/system_ui_resource_manager.h"
+
+class SkBitmap;
+
+namespace cc {
+class UIResourceBitmap;
+}
+
+namespace content {
+
+class SystemUIResource;
+
+class CONTENT_EXPORT SystemUIResourceManagerImpl
+ : public ui::SystemUIResourceManager {
+ public:
+ SystemUIResourceManagerImpl(UIResourceProvider* ui_resource_provider);
+ ~SystemUIResourceManagerImpl();
+
+ virtual void Subscribe(ui::SystemUIResourceManager::Type type,
+ ui::SystemUIResourceLayer* layer) OVERRIDE;
+ virtual void Unsubscribe(ui::SystemUIResourceManager::Type type,
+ ui::SystemUIResourceLayer* layer) OVERRIDE;
+ void RefreshResources();
jdduke (slow) 2014/07/23 18:17:45 A comment about what |RefreshResources()| accompli
powei 2014/07/23 21:56:09 Done.
+
+ private:
+ friend class TestSystemUIResourceManagerImpl;
+ class Entry;
+
+ // Start loading the resource bitmap. virtual for testing.
+ virtual void BuildResource(ui::SystemUIResourceManager::Type type);
+
+ Entry* GetEntry(ui::SystemUIResourceManager::Type type);
+ static void LoadBitmap(ui::SystemUIResourceManager::Type,
+ SkBitmap* bitmap_holder);
+ void OnFinishedLoadBitmap(ui::SystemUIResourceManager::Type,
+ SkBitmap* bitmap_holder);
+
+ typedef base::ScopedPtrHashMap<int, Entry> SystemUIResourceMap;
+ SystemUIResourceMap resource_map_;
+ UIResourceProvider* ui_resource_provider_;
+
+ base::WeakPtrFactory<SystemUIResourceManagerImpl> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SystemUIResourceManagerImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_SYSTEM_UI_RESOURCE_MANAGER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698