| 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 APPS_MOTERM_MOTERM_VIEW_H_ | 5 #ifndef APPS_MOTERM_MOTERM_VIEW_H_ |
| 6 #define APPS_MOTERM_MOTERM_VIEW_H_ | 6 #define APPS_MOTERM_MOTERM_VIEW_H_ |
| 7 | 7 |
| 8 #include "apps/moterm/gl_helper.h" | 8 #include "apps/moterm/gl_helper.h" |
| 9 #include "apps/moterm/moterm_driver.h" | 9 #include "apps/moterm/moterm_driver.h" |
| 10 #include "apps/moterm/moterm_model.h" | 10 #include "apps/moterm/moterm_model.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "skia/ext/refptr.h" | 21 #include "skia/ext/refptr.h" |
| 22 #include "third_party/skia/include/core/SkBitmapDevice.h" | 22 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 23 #include "third_party/skia/include/core/SkTypeface.h" | 23 #include "third_party/skia/include/core/SkTypeface.h" |
| 24 | 24 |
| 25 namespace mojo { | 25 namespace mojo { |
| 26 class Shell; | 26 class Shell; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class MotermView : public mojo::ViewObserver, | 29 class MotermView : public mojo::ViewObserver, |
| 30 public GlHelper::Client, | 30 public GlHelper::Client, |
| 31 public MotermModel::Delegate, |
| 31 public MotermDriver::Client, | 32 public MotermDriver::Client, |
| 32 public mojo::InterfaceFactory<mojo::terminal::Terminal>, | 33 public mojo::InterfaceFactory<mojo::terminal::Terminal>, |
| 33 public mojo::terminal::Terminal { | 34 public mojo::terminal::Terminal { |
| 34 public: | 35 public: |
| 35 MotermView( | 36 MotermView( |
| 36 mojo::Shell* shell, | 37 mojo::Shell* shell, |
| 37 mojo::View* view, | 38 mojo::View* view, |
| 38 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request); | 39 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request); |
| 39 ~MotermView() override; | 40 ~MotermView() override; |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 // |mojo::ViewObserver|: | 43 // |mojo::ViewObserver|: |
| 43 void OnViewDestroyed(mojo::View* view) override; | 44 void OnViewDestroyed(mojo::View* view) override; |
| 44 void OnViewBoundsChanged(mojo::View* view, | 45 void OnViewBoundsChanged(mojo::View* view, |
| 45 const mojo::Rect& old_bounds, | 46 const mojo::Rect& old_bounds, |
| 46 const mojo::Rect& new_bounds) override; | 47 const mojo::Rect& new_bounds) override; |
| 47 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; | 48 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; |
| 48 | 49 |
| 49 // |GlHelper::Client|: | 50 // |GlHelper::Client|: |
| 50 void OnSurfaceIdChanged(mojo::SurfaceIdPtr surface_id) override; | 51 void OnSurfaceIdChanged(mojo::SurfaceIdPtr surface_id) override; |
| 51 void OnContextLost() override; | 52 void OnContextLost() override; |
| 52 void OnFrameDisplayed(uint32_t frame_id) override; | 53 void OnFrameDisplayed(uint32_t frame_id) override; |
| 53 | 54 |
| 55 // |MotermModel::Delegate|: |
| 56 void OnResponse(const void* buf, size_t size) override; |
| 57 |
| 54 // |MotermDriver::Client|: | 58 // |MotermDriver::Client|: |
| 55 void OnDataReceived(const void* bytes, size_t num_bytes) override; | 59 void OnDataReceived(const void* bytes, size_t num_bytes) override; |
| 56 void OnClosed() override; | 60 void OnClosed() override; |
| 57 void OnDestroyed() override; | 61 void OnDestroyed() override; |
| 58 | 62 |
| 59 // |mojo::InterfaceFactory<mojo::terminal::Terminal>|: | 63 // |mojo::InterfaceFactory<mojo::terminal::Terminal>|: |
| 60 void Create( | 64 void Create( |
| 61 mojo::ApplicationConnection* connection, | 65 mojo::ApplicationConnection* connection, |
| 62 mojo::InterfaceRequest<mojo::terminal::Terminal> request) override; | 66 mojo::InterfaceRequest<mojo::terminal::Terminal> request) override; |
| 63 | 67 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 int ascent_; | 115 int ascent_; |
| 112 int line_height_; | 116 int line_height_; |
| 113 int advance_width_; | 117 int advance_width_; |
| 114 | 118 |
| 115 skia::RefPtr<SkBitmapDevice> bitmap_device_; | 119 skia::RefPtr<SkBitmapDevice> bitmap_device_; |
| 116 | 120 |
| 117 DISALLOW_COPY_AND_ASSIGN(MotermView); | 121 DISALLOW_COPY_AND_ASSIGN(MotermView); |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 #endif // APPS_MOTERM_MOTERM_VIEW_H_ | 124 #endif // APPS_MOTERM_MOTERM_VIEW_H_ |
| OLD | NEW |