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

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

Issue 1547223002: Convert Pass()→std::move() in //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « ash/test/test_shelf_delegate.cc ('k') | ash/wm/lock_state_controller.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_hud_debug.h" 5 #include "ash/touch/touch_hud_debug.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 value->SetInteger("id", id); 107 value->SetInteger("id", id);
108 value->SetString("type", std::string(GetTouchEventLabel(type))); 108 value->SetString("type", std::string(GetTouchEventLabel(type)));
109 value->SetString("location", location.ToString()); 109 value->SetString("location", location.ToString());
110 value->SetDouble("timestamp", timestamp); 110 value->SetDouble("timestamp", timestamp);
111 value->SetDouble("radius_x", radius_x); 111 value->SetDouble("radius_x", radius_x);
112 value->SetDouble("radius_y", radius_y); 112 value->SetDouble("radius_y", radius_y);
113 value->SetDouble("pressure", pressure); 113 value->SetDouble("pressure", pressure);
114 value->SetInteger("tracking_id", tracking_id); 114 value->SetInteger("tracking_id", tracking_id);
115 value->SetInteger("source_device", source_device); 115 value->SetInteger("source_device", source_device);
116 116
117 return value.Pass(); 117 return value;
118 } 118 }
119 119
120 int id; 120 int id;
121 ui::EventType type; 121 ui::EventType type;
122 gfx::Point location; 122 gfx::Point location;
123 double timestamp; 123 double timestamp;
124 float radius_x; 124 float radius_x;
125 float radius_y; 125 float radius_y;
126 float pressure; 126 float pressure;
127 int tracking_id; 127 int tracking_id;
(...skipping 22 matching lines...) Expand all
150 bool active() const { 150 bool active() const {
151 return !log_.empty() && log_.back().type != ui::ET_TOUCH_RELEASED && 151 return !log_.empty() && log_.back().type != ui::ET_TOUCH_RELEASED &&
152 log_.back().type != ui::ET_TOUCH_CANCELLED; 152 log_.back().type != ui::ET_TOUCH_CANCELLED;
153 } 153 }
154 154
155 // Returns a list containing data from all events for the touch point. 155 // Returns a list containing data from all events for the touch point.
156 scoped_ptr<base::ListValue> GetAsList() const { 156 scoped_ptr<base::ListValue> GetAsList() const {
157 scoped_ptr<base::ListValue> list(new base::ListValue()); 157 scoped_ptr<base::ListValue> list(new base::ListValue());
158 for (const_iterator i = log_.begin(); i != log_.end(); ++i) 158 for (const_iterator i = log_.begin(); i != log_.end(); ++i)
159 list->Append((*i).GetAsDictionary().release()); 159 list->Append((*i).GetAsDictionary().release());
160 return list.Pass(); 160 return list;
161 } 161 }
162 162
163 void Reset() { 163 void Reset() {
164 log_.clear(); 164 log_.clear();
165 } 165 }
166 166
167 private: 167 private:
168 std::vector<TouchPointLog> log_; 168 std::vector<TouchPointLog> log_;
169 169
170 DISALLOW_COPY_AND_ASSIGN(TouchTrace); 170 DISALLOW_COPY_AND_ASSIGN(TouchTrace);
(...skipping 16 matching lines...) Expand all
187 for (int i = 0; i < kMaxPaths; ++i) 187 for (int i = 0; i < kMaxPaths; ++i)
188 traces_[i].Reset(); 188 traces_[i].Reset();
189 } 189 }
190 190
191 scoped_ptr<base::ListValue> GetAsList() const { 191 scoped_ptr<base::ListValue> GetAsList() const {
192 scoped_ptr<base::ListValue> list(new base::ListValue()); 192 scoped_ptr<base::ListValue> list(new base::ListValue());
193 for (int i = 0; i < kMaxPaths; ++i) { 193 for (int i = 0; i < kMaxPaths; ++i) {
194 if (!traces_[i].log().empty()) 194 if (!traces_[i].log().empty())
195 list->Append(traces_[i].GetAsList().release()); 195 list->Append(traces_[i].GetAsList().release());
196 } 196 }
197 return list.Pass(); 197 return list;
198 } 198 }
199 199
200 int GetTraceIndex(int touch_id) const { 200 int GetTraceIndex(int touch_id) const {
201 return touch_id_to_trace_index_.at(touch_id); 201 return touch_id_to_trace_index_.at(touch_id);
202 } 202 }
203 203
204 const TouchTrace* traces() const { 204 const TouchTrace* traces() const {
205 return traces_; 205 return traces_;
206 } 206 }
207 207
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 for (aura::Window::Windows::iterator iter = roots.begin(); 363 for (aura::Window::Windows::iterator iter = roots.begin();
364 iter != roots.end(); ++iter) { 364 iter != roots.end(); ++iter) {
365 RootWindowController* controller = GetRootWindowController(*iter); 365 RootWindowController* controller = GetRootWindowController(*iter);
366 TouchHudDebug* hud = controller->touch_hud_debug(); 366 TouchHudDebug* hud = controller->touch_hud_debug();
367 if (hud) { 367 if (hud) {
368 scoped_ptr<base::ListValue> list = hud->GetLogAsList(); 368 scoped_ptr<base::ListValue> list = hud->GetLogAsList();
369 if (!list->empty()) 369 if (!list->empty())
370 value->Set(base::Int64ToString(hud->display_id()), list.release()); 370 value->Set(base::Int64ToString(hud->display_id()), list.release());
371 } 371 }
372 } 372 }
373 return value.Pass(); 373 return value;
374 } 374 }
375 375
376 void TouchHudDebug::ChangeToNextMode() { 376 void TouchHudDebug::ChangeToNextMode() {
377 switch (mode_) { 377 switch (mode_) {
378 case FULLSCREEN: 378 case FULLSCREEN:
379 SetMode(REDUCED_SCALE); 379 SetMode(REDUCED_SCALE);
380 break; 380 break;
381 case REDUCED_SCALE: 381 case REDUCED_SCALE:
382 SetMode(INVISIBLE); 382 SetMode(INVISIBLE);
383 break; 383 break;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 RootWindowController* controller) { 469 RootWindowController* controller) {
470 controller->set_touch_hud_debug(this); 470 controller->set_touch_hud_debug(this);
471 } 471 }
472 472
473 void TouchHudDebug::UnsetHudForRootWindowController( 473 void TouchHudDebug::UnsetHudForRootWindowController(
474 RootWindowController* controller) { 474 RootWindowController* controller) {
475 controller->set_touch_hud_debug(NULL); 475 controller->set_touch_hud_debug(NULL);
476 } 476 }
477 477
478 } // namespace ash 478 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_shelf_delegate.cc ('k') | ash/wm/lock_state_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698