mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL plumbs resize notifications from SkyView to Engine. I've taken the opportunity to reorganize how notifications generated by SkyView are plumbed to the GPU and UI threads. This approach should reduce the amount of plumbing needed for new notifications. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/880443003
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
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_UI_ENGINE_H_
|
|
#define SKY_SHELL_UI_ENGINE_H_
|
|
|
|
#include "base/macros.h"
|
|
#include "base/memory/scoped_ptr.h"
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "sky/engine/public/web/WebFrameClient.h"
|
|
#include "sky/engine/public/web/WebViewClient.h"
|
|
#include "sky/shell/ui_delegate.h"
|
|
#include "ui/gfx/geometry/size.h"
|
|
|
|
namespace sky {
|
|
namespace shell {
|
|
class PlatformImpl;
|
|
|
|
class Engine : public UIDelegate,
|
|
public blink::WebFrameClient,
|
|
public blink::WebViewClient {
|
|
public:
|
|
Engine();
|
|
~Engine() override;
|
|
|
|
base::WeakPtr<Engine> GetWeakPtr();
|
|
|
|
void Init();
|
|
|
|
void OnViewportMetricsChanged(const gfx::Size& size,
|
|
float device_pixel_ratio) override;
|
|
|
|
private:
|
|
scoped_ptr<PlatformImpl> platform_impl_;
|
|
blink::WebView* web_view_;
|
|
|
|
base::WeakPtrFactory<Engine> weak_factory_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(Engine);
|
|
};
|
|
|
|
} // namespace shell
|
|
} // namespace sky
|
|
|
|
#endif // SKY_SHELL_UI_ENGINE_H_
|