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

Side by Side Diff: ppapi/cpp/dev/text_input_dev.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh 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
« no previous file with comments | « net/websockets/websocket_net_log_params_unittest.cc ('k') | ppapi/examples/ime/ime.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 "ppapi/cpp/dev/text_input_dev.h" 5 #include "ppapi/cpp/dev/text_input_dev.h"
6 6
7 #include "ppapi/c/dev/ppp_text_input_dev.h" 7 #include "ppapi/c/dev/ppp_text_input_dev.h"
8 #include "ppapi/cpp/instance.h" 8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/instance_handle.h" 9 #include "ppapi/cpp/instance_handle.h"
10 #include "ppapi/cpp/module_impl.h" 10 #include "ppapi/cpp/module_impl.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 &ppp_text_input); 47 &ppp_text_input);
48 instance->AddPerInstanceObject(kPPPTextInputInterface, this); 48 instance->AddPerInstanceObject(kPPPTextInputInterface, this);
49 } 49 }
50 50
51 TextInput_Dev::~TextInput_Dev() { 51 TextInput_Dev::~TextInput_Dev() {
52 Instance::RemovePerInstanceObject(instance_, kPPPTextInputInterface, this); 52 Instance::RemovePerInstanceObject(instance_, kPPPTextInputInterface, this);
53 } 53 }
54 54
55 void TextInput_Dev::RequestSurroundingText(uint32_t) { 55 void TextInput_Dev::RequestSurroundingText(uint32_t) {
56 // Default implementation. Send a null range. 56 // Default implementation. Send a null range.
57 UpdateSurroundingText("", 0, 0); 57 UpdateSurroundingText(std::string(), 0, 0);
58 } 58 }
59 59
60 void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) { 60 void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) {
61 if (has_interface<PPB_TextInput_Dev_0_2>()) { 61 if (has_interface<PPB_TextInput_Dev_0_2>()) {
62 get_interface<PPB_TextInput_Dev_0_2>()->SetTextInputType( 62 get_interface<PPB_TextInput_Dev_0_2>()->SetTextInputType(
63 instance_.pp_instance(), type); 63 instance_.pp_instance(), type);
64 } else if (has_interface<PPB_TextInput_Dev_0_1>()) { 64 } else if (has_interface<PPB_TextInput_Dev_0_1>()) {
65 get_interface<PPB_TextInput_Dev_0_1>()->SetTextInputType( 65 get_interface<PPB_TextInput_Dev_0_1>()->SetTextInputType(
66 instance_.pp_instance(), type); 66 instance_.pp_instance(), type);
67 } 67 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 uint32_t caret, 99 uint32_t caret,
100 uint32_t anchor) { 100 uint32_t anchor) {
101 if (has_interface<PPB_TextInput_Dev_0_2>()) { 101 if (has_interface<PPB_TextInput_Dev_0_2>()) {
102 get_interface<PPB_TextInput_Dev_0_2>()->UpdateSurroundingText( 102 get_interface<PPB_TextInput_Dev_0_2>()->UpdateSurroundingText(
103 instance_.pp_instance(), text.c_str(), caret, anchor); 103 instance_.pp_instance(), text.c_str(), caret, anchor);
104 } 104 }
105 } 105 }
106 106
107 107
108 } // namespace pp 108 } // namespace pp
OLDNEW
« no previous file with comments | « net/websockets/websocket_net_log_params_unittest.cc ('k') | ppapi/examples/ime/ime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698