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

Unified Diff: ui/base/nine_image_painter_factory.cc

Issue 143953007: Changes look for scrollbars on windows (2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 11 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/nine_image_painter_factory.h ('k') | ui/gfx/gfx.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/nine_image_painter_factory.cc
diff --git a/ui/base/nine_image_painter_factory.cc b/ui/base/nine_image_painter_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b22ba678c3c7d1b1c1ad8f25790d1ee5c6c80852
--- /dev/null
+++ b/ui/base/nine_image_painter_factory.cc
@@ -0,0 +1,32 @@
+// 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.
+
+#include "ui/base/nine_image_painter_factory.h"
+
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/nine_image_painter.h"
+
+namespace ui {
+
+namespace {
+
+std::vector<gfx::ImageSkia> ImageIdsToImages(const int image_ids[]) {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ std::vector<gfx::ImageSkia> images(9);
+ for (size_t i = 0; i < 9; ++i) {
+ if (image_ids[i] != 0)
+ images[i] = *rb.GetImageSkiaNamed(image_ids[i]);
+ }
+ return images;
+}
+
+} // namespace
+
+scoped_ptr<gfx::NineImagePainter> CreateNineImagePainter(
+ const int image_ids[]) {
+ return scoped_ptr<gfx::NineImagePainter>(
+ new gfx::NineImagePainter(ImageIdsToImages(image_ids)));
+}
+
+} // namespace ui
« no previous file with comments | « ui/base/nine_image_painter_factory.h ('k') | ui/gfx/gfx.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698