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_VIEWER_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_VIEWER_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_VIEWER_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_VIEWER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "mojo/shell/public/cpp/application_delegate.h" | 10 #include "mojo/shell/public/cpp/application_delegate.h" |
11 #include "mojo/shell/public/cpp/interface_factory_impl.h" | 11 #include "mojo/shell/public/cpp/interface_factory_impl.h" |
12 #include "mojo/shell/public/interfaces/content_handler.mojom.h" | 12 #include "mojo/shell/public/interfaces/content_handler.mojom.h" |
13 | 13 |
14 namespace html_viewer { | 14 namespace html_viewer { |
15 | 15 |
16 class GlobalState; | 16 class GlobalState; |
17 | 17 |
18 class HTMLViewer : public mojo::ApplicationDelegate, | 18 class HTMLViewer |
19 public mojo::InterfaceFactory<mojo::ContentHandler> { | 19 : public mojo::ApplicationDelegate, |
| 20 public mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler> { |
20 public: | 21 public: |
21 HTMLViewer(); | 22 HTMLViewer(); |
22 ~HTMLViewer() override; | 23 ~HTMLViewer() override; |
23 | 24 |
24 protected: | 25 protected: |
25 GlobalState* global_state() const { return global_state_.get(); } | 26 GlobalState* global_state() const { return global_state_.get(); } |
26 mojo::ApplicationImpl* app() const { return app_; } | 27 mojo::ApplicationImpl* app() const { return app_; } |
27 | 28 |
28 // Overridden from ApplicationDelegate: | 29 // Overridden from ApplicationDelegate: |
29 void Initialize(mojo::ApplicationImpl* app) override; | 30 void Initialize(mojo::ApplicationImpl* app) override; |
30 | 31 |
31 private: | 32 private: |
32 // Overridden from ApplicationDelegate: | 33 // Overridden from ApplicationDelegate: |
33 bool AcceptConnection( | 34 bool AcceptConnection( |
34 mojo::ApplicationConnection* connection) override; | 35 mojo::ApplicationConnection* connection) override; |
35 | 36 |
36 // Overridden from InterfaceFactory<ContentHandler> | 37 // Overridden from InterfaceFactory<shell::mojom::ContentHandler> |
37 void Create(mojo::ApplicationConnection* connection, | 38 void Create(mojo::ApplicationConnection* connection, |
38 mojo::InterfaceRequest<mojo::ContentHandler> request) override; | 39 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> |
| 40 request) override; |
39 | 41 |
40 scoped_ptr<GlobalState> global_state_; | 42 scoped_ptr<GlobalState> global_state_; |
41 mojo::ApplicationImpl* app_; | 43 mojo::ApplicationImpl* app_; |
42 | 44 |
43 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); | 45 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); |
44 }; | 46 }; |
45 | 47 |
46 } // namespace html_viewer | 48 } // namespace html_viewer |
47 | 49 |
48 #endif // COMPONENTS_HTML_VIEWER_HTML_VIEWER_H_ | 50 #endif // COMPONENTS_HTML_VIEWER_HTML_VIEWER_H_ |
OLD | NEW |