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

Side by Side Diff: webkit/plugins/ppapi/event_conversion.cc

Issue 13219005: Replace string16 with base::string16 in src/webkit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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 <map> 5 #include <map>
6 6
7 #include "webkit/plugins/ppapi/event_conversion.h" 7 #include "webkit/plugins/ppapi/event_conversion.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/i18n/char_iterator.h" 10 #include "base/i18n/char_iterator.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 WebKeyboardEvent* BuildCharEvent(const InputEventData& event) { 363 WebKeyboardEvent* BuildCharEvent(const InputEventData& event) {
364 WebKeyboardEvent* key_event = new WebKeyboardEvent(); 364 WebKeyboardEvent* key_event = new WebKeyboardEvent();
365 key_event->type = WebInputEvent::Char; 365 key_event->type = WebInputEvent::Char;
366 key_event->timeStampSeconds = PPTimeTicksToEventTime(event.event_time_stamp); 366 key_event->timeStampSeconds = PPTimeTicksToEventTime(event.event_time_stamp);
367 key_event->modifiers = event.event_modifiers; 367 key_event->modifiers = event.event_modifiers;
368 368
369 // Make sure to not read beyond the buffer in case some bad code doesn't 369 // Make sure to not read beyond the buffer in case some bad code doesn't
370 // NULL-terminate it (this is called from plugins). 370 // NULL-terminate it (this is called from plugins).
371 size_t text_length_cap = WebKeyboardEvent::textLengthCap; 371 size_t text_length_cap = WebKeyboardEvent::textLengthCap;
372 string16 text16 = UTF8ToUTF16(event.character_text); 372 base::string16 text16 = UTF8ToUTF16(event.character_text);
373 373
374 memset(key_event->text, 0, text_length_cap); 374 memset(key_event->text, 0, text_length_cap);
375 memset(key_event->unmodifiedText, 0, text_length_cap); 375 memset(key_event->unmodifiedText, 0, text_length_cap);
376 for (size_t i = 0; 376 for (size_t i = 0;
377 i < std::min(text_length_cap, text16.size()); 377 i < std::min(text_length_cap, text16.size());
378 ++i) 378 ++i)
379 key_event->text[i] = text16[i]; 379 key_event->text[i] = text16[i];
380 return key_event; 380 return key_event;
381 } 381 }
382 382
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 return PP_INPUTEVENT_CLASS_TOUCH; 725 return PP_INPUTEVENT_CLASS_TOUCH;
726 case WebInputEvent::Undefined: 726 case WebInputEvent::Undefined:
727 default: 727 default:
728 NOTREACHED(); 728 NOTREACHED();
729 return PP_InputEvent_Class(0); 729 return PP_InputEvent_Class(0);
730 } 730 }
731 } 731 }
732 732
733 } // namespace ppapi 733 } // namespace ppapi
734 } // namespace webkit 734 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698