OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "components/html_viewer/html_factory.h" | 13 #include "components/html_viewer/html_factory.h" |
14 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
15 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" | 15 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" |
16 #include "mojo/shell/public/cpp/application_delegate.h" | 16 #include "mojo/shell/public/cpp/application_delegate.h" |
17 #include "mojo/shell/public/cpp/application_impl.h" | 17 #include "mojo/shell/public/cpp/application_impl.h" |
18 | 18 |
19 namespace html_viewer { | 19 namespace html_viewer { |
20 | 20 |
21 class GlobalState; | 21 class GlobalState; |
22 class HTMLDocument; | 22 class HTMLDocument; |
23 | 23 |
24 // ApplicationDelegate created by the content handler for a specific url. | 24 // ApplicationDelegate created by the content handler for a specific url. |
25 class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate, | 25 class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate, |
26 public HTMLFactory { | 26 public HTMLFactory { |
27 public: | 27 public: |
28 HTMLDocumentApplicationDelegate( | 28 HTMLDocumentApplicationDelegate( |
29 mojo::InterfaceRequest<mojo::Application> request, | 29 mojo::ApplicationRequest request, |
30 mojo::URLResponsePtr response, | 30 mojo::URLResponsePtr response, |
31 GlobalState* global_state, | 31 GlobalState* global_state, |
32 scoped_ptr<mojo::AppRefCount> parent_app_refcount, | 32 scoped_ptr<mojo::AppRefCount> parent_app_refcount, |
33 const mojo::Callback<void()>& destruct_callback); | 33 const mojo::Callback<void()>& destruct_callback); |
34 | 34 |
35 void set_html_factory(HTMLFactory* factory) { html_factory_ = factory; } | 35 void set_html_factory(HTMLFactory* factory) { html_factory_ = factory; } |
36 HTMLFactory* html_factory() { return html_factory_; } | 36 HTMLFactory* html_factory() { return html_factory_; } |
37 | 37 |
38 private: | 38 private: |
39 class ServiceConnectorQueue; | 39 class ServiceConnectorQueue; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 mojo::Callback<void()> destruct_callback_; | 80 mojo::Callback<void()> destruct_callback_; |
81 | 81 |
82 base::WeakPtrFactory<HTMLDocumentApplicationDelegate> weak_factory_; | 82 base::WeakPtrFactory<HTMLDocumentApplicationDelegate> weak_factory_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentApplicationDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentApplicationDelegate); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace html_viewer | 87 } // namespace html_viewer |
88 | 88 |
89 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 89 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
OLD | NEW |