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

Side by Side Diff: ui/compositor/test/test_compositor_host_mac.mm

Issue 667923002: Standardize usage of virtual/override/final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 (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 "ui/compositor/test/test_compositor_host.h" 5 #include "ui/compositor/test/test_compositor_host.h"
6 6
7 #import <AppKit/NSApplication.h> 7 #import <AppKit/NSApplication.h>
8 #import <AppKit/NSOpenGL.h> 8 #import <AppKit/NSOpenGL.h>
9 #import <AppKit/NSView.h> 9 #import <AppKit/NSView.h>
10 #import <AppKit/NSWindow.h> 10 #import <AppKit/NSWindow.h>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 }; 64 };
65 65
66 // Tests that use the AppKit framework need to have the NSApplication 66 // Tests that use the AppKit framework need to have the NSApplication
67 // initialized prior to doing anything with display objects such as windows, 67 // initialized prior to doing anything with display objects such as windows,
68 // views, or controls. 68 // views, or controls.
69 class AppKitHost : public FoundationHost { 69 class AppKitHost : public FoundationHost {
70 protected: 70 protected:
71 AppKitHost() { 71 AppKitHost() {
72 [NSApplication sharedApplication]; 72 [NSApplication sharedApplication];
73 } 73 }
74 virtual ~AppKitHost() { 74 ~AppKitHost() override {}
75 }
76 private: 75 private:
77 DISALLOW_COPY_AND_ASSIGN(AppKitHost); 76 DISALLOW_COPY_AND_ASSIGN(AppKitHost);
78 }; 77 };
79 78
80 // TestCompositorHostMac provides a window surface and a coordinated compositor 79 // TestCompositorHostMac provides a window surface and a coordinated compositor
81 // for use in the compositor unit tests. 80 // for use in the compositor unit tests.
82 class TestCompositorHostMac : public TestCompositorHost, 81 class TestCompositorHostMac : public TestCompositorHost,
83 public AppKitHost { 82 public AppKitHost {
84 public: 83 public:
85 TestCompositorHostMac(const gfx::Rect& bounds, 84 TestCompositorHostMac(const gfx::Rect& bounds,
86 ui::ContextFactory* context_factory); 85 ui::ContextFactory* context_factory);
87 virtual ~TestCompositorHostMac(); 86 ~TestCompositorHostMac() override;
88 87
89 private: 88 private:
90 // TestCompositorHost: 89 // TestCompositorHost:
91 virtual void Show() override; 90 void Show() override;
92 virtual ui::Compositor* GetCompositor() override; 91 ui::Compositor* GetCompositor() override;
93 92
94 gfx::Rect bounds_; 93 gfx::Rect bounds_;
95 94
96 ui::ContextFactory* context_factory_; 95 ui::ContextFactory* context_factory_;
97 96
98 scoped_ptr<ui::Compositor> compositor_; 97 scoped_ptr<ui::Compositor> compositor_;
99 98
100 // Owned. Released when window is closed. 99 // Owned. Released when window is closed.
101 NSWindow* window_; 100 NSWindow* window_;
102 101
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 144 }
146 145
147 // static 146 // static
148 TestCompositorHost* TestCompositorHost::Create( 147 TestCompositorHost* TestCompositorHost::Create(
149 const gfx::Rect& bounds, 148 const gfx::Rect& bounds,
150 ui::ContextFactory* context_factory) { 149 ui::ContextFactory* context_factory) {
151 return new TestCompositorHostMac(bounds, context_factory); 150 return new TestCompositorHostMac(bounds, context_factory);
152 } 151 }
153 152
154 } // namespace ui 153 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.h ('k') | ui/compositor/test/test_layer_animation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698