| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/memory/scoped_ptr.h" | 5 #include <memory> |
| 6 |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 8 #include "ui/gfx/image/image.h" | 9 #include "ui/gfx/image/image.h" |
| 9 #include "ui/gfx/image/image_unittest_util.h" | 10 #include "ui/gfx/image/image_unittest_util.h" |
| 10 | 11 |
| 11 #if defined(TOOLKIT_VIEWS) | 12 #if defined(TOOLKIT_VIEWS) |
| 12 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
| 13 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 #if defined(TOOLKIT_VIEWS) | 19 #if defined(TOOLKIT_VIEWS) |
| 19 TEST(UiGfxImageTest, ViewsImageView) { | 20 TEST(UiGfxImageTest, ViewsImageView) { |
| 20 gfx::Image image(gfx::test::CreatePlatformImage()); | 21 gfx::Image image(gfx::test::CreatePlatformImage()); |
| 21 | 22 |
| 22 scoped_ptr<views::View> container(new views::View()); | 23 std::unique_ptr<views::View> container(new views::View()); |
| 23 container->SetBounds(0, 0, 200, 200); | 24 container->SetBounds(0, 0, 200, 200); |
| 24 container->SetVisible(true); | 25 container->SetVisible(true); |
| 25 | 26 |
| 26 scoped_ptr<views::ImageView> image_view(new views::ImageView()); | 27 std::unique_ptr<views::ImageView> image_view(new views::ImageView()); |
| 27 image_view->SetImage(*image.ToImageSkia()); | 28 image_view->SetImage(*image.ToImageSkia()); |
| 28 container->AddChildView(image_view.get()); | 29 container->AddChildView(image_view.get()); |
| 29 } | 30 } |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 } // namespace | 33 } // namespace |
| OLD | NEW |