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

Side by Side Diff: ash/touch/touch_observer_hud.cc

Issue 11568006: events: Update scroll and touch handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « ash/touch/touch_observer_hud.h ('k') | ash/wm/activation_controller.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/touch/touch_observer_hud.h" 5 #include "ash/touch/touch_observer_hud.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 break; 175 break;
176 default: 176 default:
177 status = "?"; 177 status = "?";
178 break; 178 break;
179 } 179 }
180 std::string string = base::StringPrintf("%2d: %s %s", 180 std::string string = base::StringPrintf("%2d: %s %s",
181 index, status, touch_positions_[index].ToString().c_str()); 181 index, status, touch_positions_[index].ToString().c_str());
182 touch_labels_[index]->SetText(UTF8ToUTF16(string)); 182 touch_labels_[index]->SetText(UTF8ToUTF16(string));
183 } 183 }
184 184
185 ui::EventResult TouchObserverHUD::OnTouchEvent(ui::TouchEvent* event) { 185 void TouchObserverHUD::OnTouchEvent(ui::TouchEvent* event) {
186 if (event->touch_id() >= kMaxTouchPoints) 186 if (event->touch_id() >= kMaxTouchPoints)
187 return ui::ER_UNHANDLED; 187 return;
188 188
189 if (event->type() != ui::ET_TOUCH_CANCELLED) 189 if (event->type() != ui::ET_TOUCH_CANCELLED)
190 touch_positions_[event->touch_id()] = event->root_location(); 190 touch_positions_[event->touch_id()] = event->root_location();
191 if (event->type() == ui::ET_TOUCH_PRESSED) 191 if (event->type() == ui::ET_TOUCH_PRESSED)
192 canvas_->Start(event->touch_id(), touch_positions_[event->touch_id()]); 192 canvas_->Start(event->touch_id(), touch_positions_[event->touch_id()]);
193 else 193 else
194 canvas_->Update(event->touch_id(), touch_positions_[event->touch_id()]); 194 canvas_->Update(event->touch_id(), touch_positions_[event->touch_id()]);
195 touch_status_[event->touch_id()] = event->type(); 195 touch_status_[event->touch_id()] = event->type();
196 touch_labels_[event->touch_id()]->SetVisible(true); 196 touch_labels_[event->touch_id()]->SetVisible(true);
197 UpdateTouchPointLabel(event->touch_id()); 197 UpdateTouchPointLabel(event->touch_id());
198 198
199 widget_->SetSize(widget_->GetContentsView()->GetPreferredSize()); 199 widget_->SetSize(widget_->GetContentsView()->GetPreferredSize());
200
201 return ui::ER_UNHANDLED;
202 } 200 }
203 201
204 void TouchObserverHUD::OnWidgetClosing(views::Widget* widget) { 202 void TouchObserverHUD::OnWidgetClosing(views::Widget* widget) {
205 DCHECK_EQ(widget, widget_); 203 DCHECK_EQ(widget, widget_);
206 widget_ = NULL; 204 widget_ = NULL;
207 } 205 }
208 206
209 } // namespace internal 207 } // namespace internal
210 } // namespace ash 208 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud.h ('k') | ash/wm/activation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698