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 "apps/moterm/moterm_view.h" | 5 #include "apps/moterm/moterm_view.h" |
6 | 6 |
7 #ifndef GL_GLEXT_PROTOTYPES | 7 #ifndef GL_GLEXT_PROTOTYPES |
8 #define GL_GLEXT_PROTOTYPES | 8 #define GL_GLEXT_PROTOTYPES |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "third_party/skia/include/core/SkPaint.h" | 31 #include "third_party/skia/include/core/SkPaint.h" |
32 #include "third_party/skia/include/core/SkRect.h" | 32 #include "third_party/skia/include/core/SkRect.h" |
33 #include "third_party/skia/include/core/SkStream.h" | 33 #include "third_party/skia/include/core/SkStream.h" |
34 #include "third_party/skia/include/core/SkXfermode.h" | 34 #include "third_party/skia/include/core/SkXfermode.h" |
35 | 35 |
36 constexpr uint32_t kMotermImageResourceId = 1; | 36 constexpr uint32_t kMotermImageResourceId = 1; |
37 constexpr uint32_t kRootNodeId = mojo::gfx::composition::kSceneRootNodeId; | 37 constexpr uint32_t kRootNodeId = mojo::gfx::composition::kSceneRootNodeId; |
38 | 38 |
39 MotermView::MotermView( | 39 MotermView::MotermView( |
40 mojo::ApplicationImpl* app_impl, | 40 mojo::ApplicationImpl* app_impl, |
41 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request, | 41 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, |
42 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback) | 42 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request) |
43 : GaneshView(app_impl, "Moterm", create_view_callback), | 43 : GaneshView(app_impl, view_owner_request.Pass(), "Moterm"), |
44 choreographer_(scene(), this), | 44 choreographer_(scene(), this), |
45 input_handler_(view_service_provider(), this), | 45 input_handler_(view_service_provider(), this), |
46 model_(MotermModel::Size(240, 160), MotermModel::Size(24, 80), this), | 46 model_(MotermModel::Size(240, 160), MotermModel::Size(24, 80), this), |
47 force_next_draw_(false), | 47 force_next_draw_(false), |
48 ascent_(0), | 48 ascent_(0), |
49 line_height_(0), | 49 line_height_(0), |
50 advance_width_(0), | 50 advance_width_(0), |
51 keypad_application_mode_(false) { | 51 keypad_application_mode_(false) { |
52 // TODO(vtl): |service_provider_impl_|'s ctor doesn't like an invalid request, | 52 // TODO(vtl): |service_provider_impl_|'s ctor doesn't like an invalid request, |
53 // so we have to conditionally, explicitly bind. | 53 // so we have to conditionally, explicitly bind. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 void MotermView::OnKeyPressed(mojo::EventPtr key_event) { | 317 void MotermView::OnKeyPressed(mojo::EventPtr key_event) { |
318 std::string input_sequence = | 318 std::string input_sequence = |
319 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_); | 319 GetInputSequenceForKeyPressedEvent(*key_event, keypad_application_mode_); |
320 if (input_sequence.empty()) | 320 if (input_sequence.empty()) |
321 return; | 321 return; |
322 | 322 |
323 if (driver_) | 323 if (driver_) |
324 driver_->SendData(input_sequence.data(), input_sequence.size()); | 324 driver_->SendData(input_sequence.data(), input_sequence.size()); |
325 } | 325 } |
OLD | NEW |