| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
| 10 #include "mojo/gpu/gl_texture.h" | 10 #include "mojo/gpu/gl_texture.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 void SetComposingRegion(int32_t start, int32_t end) override { DrawText(); } | 240 void SetComposingRegion(int32_t start, int32_t end) override { DrawText(); } |
| 241 | 241 |
| 242 void SetComposingText(const mojo::String& text, | 242 void SetComposingText(const mojo::String& text, |
| 243 int32_t new_cursor_position) override { | 243 int32_t new_cursor_position) override { |
| 244 DrawText(); | 244 DrawText(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void SetSelection(int32_t start, int32_t end) override { DrawText(); } | 247 void SetSelection(int32_t start, int32_t end) override { DrawText(); } |
| 248 | 248 |
| 249 void Submit(keyboard::SubmitAction action) override {} |
| 250 |
| 249 // mojo::ViewObserver implementation. | 251 // mojo::ViewObserver implementation. |
| 250 void OnViewDestroyed(mojo::View* view) override { | 252 void OnViewDestroyed(mojo::View* view) override { |
| 251 if (view == text_view_) { | 253 if (view == text_view_) { |
| 252 text_view_->RemoveObserver(this); | 254 text_view_->RemoveObserver(this); |
| 253 text_view_ = nullptr; | 255 text_view_ = nullptr; |
| 254 } | 256 } |
| 255 } | 257 } |
| 256 | 258 |
| 257 void OnViewBoundsChanged(mojo::View* view, | 259 void OnViewBoundsChanged(mojo::View* view, |
| 258 const mojo::Rect& old_bounds, | 260 const mojo::Rect& old_bounds, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 396 |
| 395 DISALLOW_COPY_AND_ASSIGN(KeyboardDelegate); | 397 DISALLOW_COPY_AND_ASSIGN(KeyboardDelegate); |
| 396 }; | 398 }; |
| 397 | 399 |
| 398 } // namespace examples | 400 } // namespace examples |
| 399 | 401 |
| 400 MojoResult MojoMain(MojoHandle application_request) { | 402 MojoResult MojoMain(MojoHandle application_request) { |
| 401 mojo::ApplicationRunnerChromium runner(new examples::KeyboardDelegate); | 403 mojo::ApplicationRunnerChromium runner(new examples::KeyboardDelegate); |
| 402 return runner.Run(application_request); | 404 return runner.Run(application_request); |
| 403 } | 405 } |
| OLD | NEW |