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

Side by Side Diff: mojo/services/native_viewport/platform_viewport_stub.cc

Issue 606883002: Add a headless configuration to Mojo's native viewport service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jamesr's questions 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/native_viewport/platform_viewport.h" 5 #include "mojo/services/native_viewport/platform_viewport_headless.h"
6
7 // Stub to build on platforms we don't fully support yet.
8 6
9 namespace mojo { 7 namespace mojo {
10 8
11 class PlatformViewportStub : public PlatformViewport {
12 public:
13 PlatformViewportStub(Delegate* delegate) : delegate_(delegate) {
14 }
15 virtual ~PlatformViewportStub() {
16 }
17
18 private:
19 // Overridden from PlatformViewport:
20 virtual void Init() OVERRIDE {
21 }
22 virtual void Show() OVERRIDE {
23 }
24 virtual void Hide() OVERRIDE {
25 }
26 virtual void Close() OVERRIDE {
27 delegate_->OnDestroyed();
28 }
29 virtual gfx::Size GetSize() OVERRIDE {
30 return gfx::Size();
31 }
32 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
33 }
34
35 Delegate* delegate_;
36
37 DISALLOW_COPY_AND_ASSIGN(PlatformViewportStub);
38 };
39
40 // static 9 // static
41 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) { 10 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) {
42 return scoped_ptr<PlatformViewport>( 11 return PlatformViewportHeadless::Create(delegate);
43 new PlatformViewportStub(delegate)).Pass();
44 } 12 }
45 13
46 } // namespace mojo 14 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698