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

Unified Diff: cc/resources/shared_ui_resource.h

Issue 22870016: Update the nine patch layer to use UI resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing and addressing previous comments Created 7 years, 4 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: cc/resources/shared_ui_resource.h
diff --git a/cc/resources/shared_ui_resource.h b/cc/resources/shared_ui_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed58a81c17390c5e380e00468b4657735d3cf89c
--- /dev/null
+++ b/cc/resources/shared_ui_resource.h
@@ -0,0 +1,41 @@
+// Copyright 2013 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 CC_RESOURCES_SHARED_UI_RESOURCE_H_
+#define CC_RESOURCES_SHARED_UI_RESOURCE_H_
+
+#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
+#include "cc/resources/ui_resource.h"
+#include "cc/resources/ui_resource_client.h"
+#include "ui/gfx/size.h"
+
+namespace cc {
+
+class LayerTreeHost;
+
+class CC_EXPORT SharedUIResource : public UIResource {
+ public:
+ static scoped_ptr<SharedUIResource> Create(UIResourceId id, gfx::Size size) {
+ return make_scoped_ptr(new SharedUIResource(id, size));
+ }
+
+ // UIResource
+ virtual UIResourceId id() OVERRIDE { return id_; }
+ virtual gfx::Size GetSize() OVERRIDE { return size_; }
+
+ private:
+ SharedUIResource(UIResourceId id, gfx::Size size) : id_(id), size_(size) {
+ DCHECK(size.width() && size.height());
+ }
+
+ UIResourceId id_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedUIResource);
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_SHARED_UI_RESOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698