Chromium Code Reviews| Index: apps/moterm/moterm_model.h |
| diff --git a/apps/moterm/moterm_model.h b/apps/moterm/moterm_model.h |
| index e222aa234fa540c2fc021433f9112c87c4fb518d..478b5166976355cbbef1404ae9fe3db60f05d5d6 100644 |
| --- a/apps/moterm/moterm_model.h |
| +++ b/apps/moterm/moterm_model.h |
| @@ -103,11 +103,26 @@ class MotermModel { |
| Rectangle dirty_rect; |
| }; |
| + class Delegate { |
| + public: |
| + // Called when a response is received (i.e., the terminal wants to put data |
| + // into the input stream). |
| + virtual void OnResponse(const void* buf, size_t size) = 0; |
| + |
| + protected: |
| + Delegate() {} |
| + ~Delegate() {} |
|
jamesr
2015/09/09 16:49:45
virtual (since you have a vtable already)
|
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(Delegate); |
| + }; |
| + |
| // Maximum number of rows/columns. |
| static const unsigned kMaxRows = 500; // TODO(vtl): Made up number. |
| static const unsigned kMaxColumns = T_NUMCOL; |
| - MotermModel(const Size& max_size, const Size& size); |
| + // If non-null, |delegate| must outlive this object. |
| + MotermModel(const Size& max_size, const Size& size, Delegate* delegate); |
| ~MotermModel(); |
| // Process the given input bytes, reporting (additional) state changes to |
| @@ -162,6 +177,7 @@ class MotermModel { |
| static void OnRespondThunk(void* ctx, const void* buf, size_t size); |
| const Size max_size_; |
| + Delegate* const delegate_; |
| scoped_ptr<teken_char_t[]> characters_; |
| scoped_ptr<teken_attr_t[]> attributes_; |