mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This removes the symmetrical nature of ServiceProvider and consistently passes and uses a ServiceProvider + ServiceProvider& pair in places that wish to bidirectionally expose services, such as the view manager. The view manager library now deals with InterfaceRequest<ServiceProvider> and ServiceProviderPtr objects (i.e. c++ wrappers for handles) instead of a concrete implementation of ServiceProvider to make it easier for callers. A number of places that were assuming a particular ServiceProvider would always exist are updated to reflect the nullability of the parameters in mojom and places that do not wish to ever look up or provide services now pass nullptr instead of doomed pipe handles. The JS application startup classes are reworked a bit to accomodate exposing services on the third ConnectToApplication/AcceptConnection parameter. BUG=449432 R=abarth@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/858103002
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
// Copyright 2014 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_ENGINE_CORE_HTML_HTMLIFRAMEELEMENT_H_
|
|
#define SKY_ENGINE_CORE_HTML_HTMLIFRAMEELEMENT_H_
|
|
|
|
#include "gen/sky/core/HTMLNames.h"
|
|
#include "mojo/services/view_manager/public/cpp/view_observer.h"
|
|
#include "sky/engine/core/dom/DOMURLUtils.h"
|
|
#include "sky/engine/core/dom/Document.h"
|
|
#include "sky/engine/core/html/HTMLElement.h"
|
|
#include "sky/engine/wtf/OwnPtr.h"
|
|
|
|
namespace blink {
|
|
|
|
class RemoteFrame;
|
|
|
|
class HTMLIFrameElement : public HTMLElement,
|
|
public mojo::ViewObserver {
|
|
DEFINE_WRAPPERTYPEINFO();
|
|
public:
|
|
static PassRefPtr<HTMLIFrameElement> create(Document&);
|
|
|
|
virtual ~HTMLIFrameElement();
|
|
|
|
mojo::View* contentView() const { return m_contentView; }
|
|
|
|
ScriptValue takeServiceProvider(ScriptState*);
|
|
|
|
private:
|
|
explicit HTMLIFrameElement(Document&);
|
|
|
|
// HTMLElement methods:
|
|
virtual RenderObject* createRenderer(RenderStyle* style) override;
|
|
|
|
virtual void insertedInto(ContainerNode*) override;
|
|
virtual void removedFrom(ContainerNode*) override;
|
|
|
|
// ViewObserver methods:
|
|
void OnViewDestroyed(mojo::View* view) override;
|
|
|
|
private:
|
|
void createView();
|
|
|
|
mojo::View* m_contentView;
|
|
mojo::ServiceProviderPtr m_services;
|
|
};
|
|
|
|
} // namespace blink
|
|
|
|
#endif // SKY_ENGINE_CORE_HTML_HTMLIFRAMEELEMENT_H_
|