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

Side by Side Diff: ppapi/examples/ime/ime.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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 | « ppapi/examples/gamepad/gamepad.cc ('k') | ppapi/examples/printing/printing.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 (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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ppapi/c/dev/ppb_cursor_control_dev.h" 10 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // Implement TextFieldStatusHandler. 105 // Implement TextFieldStatusHandler.
106 virtual void FocusIn(const pp::Rect& caret) { 106 virtual void FocusIn(const pp::Rect& caret) {
107 textinput_control_.SetTextInputType(PP_TEXTINPUT_TYPE_TEXT); 107 textinput_control_.SetTextInputType(PP_TEXTINPUT_TYPE_TEXT);
108 textinput_control_.UpdateCaretPosition(caret); 108 textinput_control_.UpdateCaretPosition(caret);
109 } 109 }
110 virtual void FocusOut() { 110 virtual void FocusOut() {
111 textinput_control_.CancelCompositionText(); 111 textinput_control_.CancelCompositionText();
112 textinput_control_.SetTextInputType(PP_TEXTINPUT_TYPE_NONE); 112 textinput_control_.SetTextInputType(PP_TEXTINPUT_TYPE_NONE);
113 } 113 }
114 virtual void UpdateSelection(const std::string& text) { 114 virtual void UpdateSelection(const std::string& text) {
115 textinput_control_.UpdateSurroundingText(text, 0, text.size()); 115 textinput_control_.UpdateSurroundingText(
116 text, 0, static_cast<uint32_t>(text.size()));
116 } 117 }
117 118
118 private: 119 private:
119 pp::TextInputController textinput_control_; 120 pp::TextInputController textinput_control_;
120 }; 121 };
121 122
122 // Hand-made text field for demonstrating text input API. 123 // Hand-made text field for demonstrating text input API.
123 class MyTextField { 124 class MyTextField {
124 public: 125 public:
125 MyTextField(pp::Instance* instance, TextFieldStatusHandler* handler, 126 MyTextField(pp::Instance* instance, TextFieldStatusHandler* handler,
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 } 725 }
725 }; 726 };
726 727
727 namespace pp { 728 namespace pp {
728 729
729 Module* CreateModule() { 730 Module* CreateModule() {
730 return new MyModule(); 731 return new MyModule();
731 } 732 }
732 733
733 } // namespace pp 734 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/examples/gamepad/gamepad.cc ('k') | ppapi/examples/printing/printing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698