mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
ServiceRegistry enables a chain of Mojo applications to accumulate services without wrapping and forwarding the incoming ServiceProvider request. Sky's DocumentView adds ViewManagerClient to the ServiceRegistry (if any) that's provided to it via ConnectToApplication(). Sky applications can add additional services with embedder.serviceRegistry.addServices(). R=abarth@chromium.org Review URL: https://codereview.chromium.org/958673002
54 lines
1.5 KiB
C++
54 lines
1.5 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_VIEWER_INTERNALS_H_
|
|
#define SKY_VIEWER_INTERNALS_H_
|
|
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "base/supports_user_data.h"
|
|
#include "dart/runtime/include/dart_api.h"
|
|
#include "mojo/public/interfaces/application/shell.mojom.h"
|
|
#include "sky/services/testing/test_harness.mojom.h"
|
|
|
|
namespace sky {
|
|
class DocumentView;
|
|
|
|
class Internals : public base::SupportsUserData::Data,
|
|
public mojo::Shell {
|
|
public:
|
|
virtual ~Internals();
|
|
|
|
static void Create(Dart_Isolate isolate, DocumentView* document_view);
|
|
|
|
// mojo::Shell method:
|
|
void ConnectToApplication(
|
|
const mojo::String& application_url,
|
|
mojo::InterfaceRequest<mojo::ServiceProvider> services,
|
|
mojo::ServiceProviderPtr exposed_services) override;
|
|
|
|
std::string RenderTreeAsText();
|
|
std::string ContentAsText();
|
|
void NotifyTestComplete(const std::string& test_result);
|
|
|
|
mojo::Handle TakeShellProxyHandle();
|
|
mojo::Handle TakeServicesProvidedToEmbedder();
|
|
mojo::Handle TakeServicesProvidedByEmbedder();
|
|
mojo::Handle TakeServiceRegistry();
|
|
|
|
void pauseAnimations(double pauseTime);
|
|
|
|
private:
|
|
explicit Internals(DocumentView* document_view);
|
|
|
|
base::WeakPtr<DocumentView> document_view_;
|
|
mojo::Binding<mojo::Shell> shell_binding_;
|
|
TestHarnessPtr test_harness_;
|
|
|
|
MOJO_DISALLOW_COPY_AND_ASSIGN(Internals);
|
|
};
|
|
|
|
} // namespace sky
|
|
|
|
#endif // SKY_VIEWER_INTERNALS_H_
|