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

Side by Side Diff: examples/wm_flow/wm/wm.cc

Issue 1033513003: Cleans up events to just the parts we're actually using (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 5 years, 9 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 | « examples/wm_flow/app/app.cc ('k') | mojo/converters/input_events/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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "examples/wm_flow/wm/frame_controller.h" 5 #include "examples/wm_flow/wm/frame_controller.h"
6 #include "mojo/application/application_runner_chromium.h" 6 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_delegate.h" 8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/service_provider_impl.h" 10 #include "mojo/public/cpp/application/service_provider_impl.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 mojo::ServiceProviderPtr exposed_services) override { 69 mojo::ServiceProviderPtr exposed_services) override {
70 DCHECK(root_); 70 DCHECK(root_);
71 mojo::View* app_view = NULL; 71 mojo::View* app_view = NULL;
72 CreateTopLevelWindow(&app_view); 72 CreateTopLevelWindow(&app_view);
73 app_view->Embed(url, services.Pass(), exposed_services.Pass()); 73 app_view->Embed(url, services.Pass(), exposed_services.Pass());
74 } 74 }
75 75
76 // Overridden from mojo::ViewObserver: 76 // Overridden from mojo::ViewObserver:
77 void OnViewInputEvent(mojo::View* view, 77 void OnViewInputEvent(mojo::View* view,
78 const mojo::EventPtr& event) override { 78 const mojo::EventPtr& event) override {
79 if (event->action == mojo::EVENT_TYPE_MOUSE_RELEASED && 79 if (event->action == mojo::EVENT_TYPE_POINTER_UP &&
80 event->flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON && 80 event->flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON &&
81 view->parent() == window_container_) { 81 view->parent() == window_container_) {
82 CloseWindow(view); 82 CloseWindow(view);
83 } 83 }
84 } 84 }
85 void OnViewDestroyed(mojo::View* view) override { 85 void OnViewDestroyed(mojo::View* view) override {
86 view->RemoveObserver(this); 86 view->RemoveObserver(this);
87 } 87 }
88 88
89 void CloseWindow(mojo::View* view) { 89 void CloseWindow(mojo::View* view) {
(...skipping 30 matching lines...) Expand all
120 120
121 DISALLOW_COPY_AND_ASSIGN(SimpleWM); 121 DISALLOW_COPY_AND_ASSIGN(SimpleWM);
122 }; 122 };
123 123
124 } // namespace examples 124 } // namespace examples
125 125
126 MojoResult MojoMain(MojoHandle shell_handle) { 126 MojoResult MojoMain(MojoHandle shell_handle) {
127 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM); 127 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM);
128 return runner.Run(shell_handle); 128 return runner.Run(shell_handle);
129 } 129 }
OLDNEW
« no previous file with comments | « examples/wm_flow/app/app.cc ('k') | mojo/converters/input_events/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698