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

Side by Side Diff: ui/compositor/test/test_compositor_host_android.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/compositor/test/test_compositor_host.h" 5 #include "ui/compositor/test/test_compositor_host.h"
6 6
7 #include <memory>
8
7 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
11 #include "ui/compositor/compositor.h" 12 #include "ui/compositor/compositor.h"
12 #include "ui/gfx/native_widget_types.h" 13 #include "ui/gfx/native_widget_types.h"
13 14
14 namespace ui { 15 namespace ui {
15 16
16 class TestCompositorHostAndroid : public TestCompositorHost { 17 class TestCompositorHostAndroid : public TestCompositorHost {
17 public: 18 public:
18 TestCompositorHostAndroid(const gfx::Rect& bounds, 19 TestCompositorHostAndroid(const gfx::Rect& bounds,
19 ui::ContextFactory* context_factory) { 20 ui::ContextFactory* context_factory) {
20 compositor_.reset(new ui::Compositor(context_factory, 21 compositor_.reset(new ui::Compositor(context_factory,
21 base::ThreadTaskRunnerHandle::Get())); 22 base::ThreadTaskRunnerHandle::Get()));
22 // TODO(sievers): Support onscreen here. 23 // TODO(sievers): Support onscreen here.
23 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 24 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
24 compositor_->SetScaleAndSize(1.0f, 25 compositor_->SetScaleAndSize(1.0f,
25 gfx::Size(bounds.width(), bounds.height())); 26 gfx::Size(bounds.width(), bounds.height()));
26 } 27 }
27 28
28 // Overridden from TestCompositorHost: 29 // Overridden from TestCompositorHost:
29 void Show() override {} 30 void Show() override {}
30 ui::Compositor* GetCompositor() override { return compositor_.get(); } 31 ui::Compositor* GetCompositor() override { return compositor_.get(); }
31 32
32 private: 33 private:
33 scoped_ptr<ui::Compositor> compositor_; 34 std::unique_ptr<ui::Compositor> compositor_;
34 35
35 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostAndroid); 36 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostAndroid);
36 }; 37 };
37 38
38 TestCompositorHost* TestCompositorHost::Create( 39 TestCompositorHost* TestCompositorHost::Create(
39 const gfx::Rect& bounds, 40 const gfx::Rect& bounds,
40 ui::ContextFactory* context_factory) { 41 ui::ContextFactory* context_factory) {
41 return new TestCompositorHostAndroid(bounds, context_factory); 42 return new TestCompositorHostAndroid(bounds, context_factory);
42 } 43 }
43 44
44 } // namespace ui 45 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_provider.h ('k') | ui/compositor/test/test_compositor_host_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698