Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: apps/moterm/moterm_view.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « apps/moterm/moterm_view.h ('k') | examples/moterm_example_app/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « apps/moterm/moterm_view.h ('k') | examples/moterm_example_app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698