flutter_flutter/shell/platform_view.h
Adam Barth c8e5668ddb Refactor SkyShell to allow multiple SkyViews
This CL separates the view-specific state from the process-global state. The
view-specific state now lives on Instance rather than Shell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1187503003.
2015-06-12 13:29:53 -07:00

46 lines
1011 B
C++

// Copyright 2015 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.
#ifndef SKY_SHELL_PLATFORM_VIEW_H_
#define SKY_SHELL_PLATFORM_VIEW_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "sky/shell/ui_delegate.h"
namespace sky {
namespace shell {
class PlatformView {
public:
struct Config {
base::WeakPtr<UIDelegate> ui_delegate;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner;
};
static PlatformView* Create(const Config& config);
virtual ~PlatformView();
void ConnectToViewportObserver(
mojo::InterfaceRequest<ViewportObserver> request);
protected:
explicit PlatformView(const Config& config);
void SurfaceWasCreated();
void SurfaceWasDestroyed();
Config config_;
gfx::AcceleratedWidget window_;
private:
DISALLOW_COPY_AND_ASSIGN(PlatformView);
};
} // namespace shell
} // namespace sky
#endif // SKY_SHELL_PLATFORM_VIEW_H_