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

Side by Side Diff: examples/wm_flow/app/app.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/spinning_cube/spinning_cube_app.cc ('k') | examples/wm_flow/wm/wm.cc » ('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 <map> 5 #include <map>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "examples/bitmap_uploader/bitmap_uploader.h" 10 #include "examples/bitmap_uploader/bitmap_uploader.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 embeddee_->HelloBack(base::Bind(&WMFlowApp::HelloBackAck, 148 embeddee_->HelloBack(base::Bind(&WMFlowApp::HelloBackAck,
149 base::Unretained(this))); 149 base::Unretained(this)));
150 } 150 }
151 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override { 151 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {
152 STLDeleteValues(&uploaders_); 152 STLDeleteValues(&uploaders_);
153 } 153 }
154 154
155 // Overridden from mojo::ViewObserver: 155 // Overridden from mojo::ViewObserver:
156 void OnViewInputEvent(mojo::View* view, 156 void OnViewInputEvent(mojo::View* view,
157 const mojo::EventPtr& event) override { 157 const mojo::EventPtr& event) override {
158 if (event->action == mojo::EVENT_TYPE_MOUSE_RELEASED && 158 if (event->action == mojo::EVENT_TYPE_POINTER_UP &&
159 event->flags & mojo::EVENT_FLAGS_LEFT_MOUSE_BUTTON) { 159 event->flags & mojo::EVENT_FLAGS_LEFT_MOUSE_BUTTON) {
160 OpenNewWindow(); 160 OpenNewWindow();
161 } 161 }
162 } 162 }
163 void OnViewDestroyed(mojo::View* view) override { 163 void OnViewDestroyed(mojo::View* view) override {
164 if (uploaders_.find(view) != uploaders_.end()) { 164 if (uploaders_.find(view) != uploaders_.end()) {
165 delete uploaders_[view]; 165 delete uploaders_[view];
166 uploaders_.erase(view); 166 uploaders_.erase(view);
167 } 167 }
168 --embed_count_; 168 --embed_count_;
(...skipping 17 matching lines...) Expand all
186 186
187 DISALLOW_COPY_AND_ASSIGN(WMFlowApp); 187 DISALLOW_COPY_AND_ASSIGN(WMFlowApp);
188 }; 188 };
189 189
190 } // namespace examples 190 } // namespace examples
191 191
192 MojoResult MojoMain(MojoHandle shell_handle) { 192 MojoResult MojoMain(MojoHandle shell_handle) {
193 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp); 193 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp);
194 return runner.Run(shell_handle); 194 return runner.Run(shell_handle);
195 } 195 }
OLDNEW
« no previous file with comments | « examples/spinning_cube/spinning_cube_app.cc ('k') | examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698