| 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_CONTENT_HANDLER_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_CONTENT_HANDLER_IMPL_H_ |
| 6 #define COMPONENTS_HTML_VIEWER_CONTENT_HANDLER_IMPL_H_ | 6 #define COMPONENTS_HTML_VIEWER_CONTENT_HANDLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 #include "mojo/shell/public/cpp/application_impl.h" | 10 #include "mojo/shell/public/cpp/application_impl.h" |
| 11 #include "mojo/shell/public/interfaces/content_handler.mojom.h" | 11 #include "mojo/shell/public/interfaces/content_handler.mojom.h" |
| 12 | 12 |
| 13 namespace html_viewer { | 13 namespace html_viewer { |
| 14 | 14 |
| 15 class GlobalState; | 15 class GlobalState; |
| 16 | 16 |
| 17 class ContentHandlerImpl : public mojo::ContentHandler { | 17 class ContentHandlerImpl : public mojo::shell::mojom::ContentHandler { |
| 18 public: | 18 public: |
| 19 ContentHandlerImpl(GlobalState* global_state, | 19 ContentHandlerImpl( |
| 20 mojo::ApplicationImpl* app, | 20 GlobalState* global_state, |
| 21 mojo::InterfaceRequest<ContentHandler> request); | 21 mojo::ApplicationImpl* app, |
| 22 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request); |
| 22 ~ContentHandlerImpl() override; | 23 ~ContentHandlerImpl() override; |
| 23 | 24 |
| 24 protected: | 25 protected: |
| 25 GlobalState* global_state() const { return global_state_; } | 26 GlobalState* global_state() const { return global_state_; } |
| 26 mojo::ApplicationImpl* app() const { return app_; } | 27 mojo::ApplicationImpl* app() const { return app_; } |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 // Overridden from ContentHandler: | 30 // Overridden from shell::mojom::ContentHandler: |
| 30 void StartApplication( | 31 void StartApplication( |
| 31 mojo::InterfaceRequest<mojo::Application> request, | 32 mojo::ApplicationRequest request, |
| 32 mojo::URLResponsePtr response, | 33 mojo::URLResponsePtr response, |
| 33 const mojo::Callback<void()>& destruct_callback) override; | 34 const mojo::Callback<void()>& destruct_callback) override; |
| 34 | 35 |
| 35 GlobalState* global_state_; | 36 GlobalState* global_state_; |
| 36 mojo::ApplicationImpl* app_; | 37 mojo::ApplicationImpl* app_; |
| 37 mojo::StrongBinding<mojo::ContentHandler> binding_; | 38 mojo::StrongBinding<mojo::shell::mojom::ContentHandler> binding_; |
| 38 scoped_ptr<mojo::AppRefCount> app_refcount_; | 39 scoped_ptr<mojo::AppRefCount> app_refcount_; |
| 39 | 40 |
| 40 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); | 41 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace html_viewer | 44 } // namespace html_viewer |
| 44 | 45 |
| 45 #endif // COMPONENTS_HTML_VIEWER_CONTENT_HANDLER_IMPL_H_ | 46 #endif // COMPONENTS_HTML_VIEWER_CONTENT_HANDLER_IMPL_H_ |
| OLD | NEW |