| OLD | NEW |
| 1 // Copyright 2014 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 #ifndef SKY_VIEWER_INTERNALS_H_ | 5 #ifndef SKY_VIEWER_INTERNALS_H_ |
| 6 #define SKY_VIEWER_INTERNALS_H_ | 6 #define SKY_VIEWER_INTERNALS_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "dart/runtime/include/dart_api.h" | 10 #include "dart/runtime/include/dart_api.h" |
| 11 #include "mojo/public/interfaces/application/shell.mojom.h" | 11 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 12 #include "sky/services/testing/test_harness.mojom.h" | 12 #include "sky/services/testing/test_harness.mojom.h" |
| 13 | 13 |
| 14 namespace sky { | 14 namespace sky { |
| 15 class DocumentView; | 15 class DocumentView; |
| 16 | 16 |
| 17 class Internals : public base::SupportsUserData::Data, | 17 class Internals : public base::SupportsUserData::Data, |
| 18 public mojo::Shell { | 18 public mojo::Shell { |
| 19 public: | 19 public: |
| 20 ~Internals() override; | 20 ~Internals() override; |
| 21 | 21 |
| 22 static void Create(Dart_Isolate isolate, DocumentView* document_view); | 22 static void Create(Dart_Isolate isolate, DocumentView* document_view); |
| 23 | 23 |
| 24 // mojo::Shell method: | 24 // mojo::Shell method: |
| 25 void ConnectToApplication( | 25 void ConnectToApplication( |
| 26 const mojo::String& application_url, | 26 const mojo::String& application_url, |
| 27 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 27 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 28 mojo::ServiceProviderPtr exposed_services) override; | 28 mojo::ServiceProviderPtr exposed_services) override; |
| 29 | 29 |
| 30 std::string RenderTreeAsText(); | |
| 31 std::string ContentAsText(); | |
| 32 void NotifyTestComplete(const std::string& test_result); | 30 void NotifyTestComplete(const std::string& test_result); |
| 33 | 31 |
| 34 mojo::Handle TakeShellProxyHandle(); | 32 mojo::Handle TakeShellProxyHandle(); |
| 35 mojo::Handle TakeServicesProvidedToEmbedder(); | 33 mojo::Handle TakeServicesProvidedToEmbedder(); |
| 36 mojo::Handle TakeServicesProvidedByEmbedder(); | 34 mojo::Handle TakeServicesProvidedByEmbedder(); |
| 37 mojo::Handle TakeServiceRegistry(); | 35 mojo::Handle TakeServiceRegistry(); |
| 38 | 36 |
| 39 private: | 37 private: |
| 40 explicit Internals(DocumentView* document_view); | 38 explicit Internals(DocumentView* document_view); |
| 41 | 39 |
| 42 base::WeakPtr<DocumentView> document_view_; | 40 base::WeakPtr<DocumentView> document_view_; |
| 43 mojo::Binding<mojo::Shell> shell_binding_; | 41 mojo::Binding<mojo::Shell> shell_binding_; |
| 44 TestHarnessPtr test_harness_; | 42 TestHarnessPtr test_harness_; |
| 45 | 43 |
| 46 MOJO_DISALLOW_COPY_AND_ASSIGN(Internals); | 44 MOJO_DISALLOW_COPY_AND_ASSIGN(Internals); |
| 47 }; | 45 }; |
| 48 | 46 |
| 49 } // namespace sky | 47 } // namespace sky |
| 50 | 48 |
| 51 #endif // SKY_VIEWER_INTERNALS_H_ | 49 #endif // SKY_VIEWER_INTERNALS_H_ |
| OLD | NEW |