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

Side by Side Diff: ppapi/shared_impl/ppb_input_event_shared.cc

Issue 9391013: Make a global enum to differentiate impl & proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/shared_impl/ppb_input_event_shared.h" 5 #include "ppapi/shared_impl/ppb_input_event_shared.h"
6 6
7 #include "ppapi/shared_impl/var.h" 7 #include "ppapi/shared_impl/var.h"
8 8
9 using ppapi::thunk::PPB_InputEvent_API; 9 using ppapi::thunk::PPB_InputEvent_API;
10 10
(...skipping 14 matching lines...) Expand all
25 key_code(0), 25 key_code(0),
26 character_text(), 26 character_text(),
27 composition_target_segment(-1), 27 composition_target_segment(-1),
28 composition_selection_start(0), 28 composition_selection_start(0),
29 composition_selection_end(0) { 29 composition_selection_end(0) {
30 } 30 }
31 31
32 InputEventData::~InputEventData() { 32 InputEventData::~InputEventData() {
33 } 33 }
34 34
35 PPB_InputEvent_Shared::PPB_InputEvent_Shared(const InitAsImpl&, 35 PPB_InputEvent_Shared::PPB_InputEvent_Shared(ResourceObjectType type,
36 PP_Instance instance, 36 PP_Instance instance,
37 const InputEventData& data) 37 const InputEventData& data)
38 : Resource(instance), 38 : Resource(type, instance),
39 data_(data) { 39 data_(data) {
40 } 40 }
41 41
42 PPB_InputEvent_Shared::PPB_InputEvent_Shared(const InitAsProxy&,
43 PP_Instance instance,
44 const InputEventData& data)
45 : Resource(HostResource::MakeInstanceOnly(instance)),
46 data_(data) {
47 }
48
49 PPB_InputEvent_API* PPB_InputEvent_Shared::AsPPB_InputEvent_API() { 42 PPB_InputEvent_API* PPB_InputEvent_Shared::AsPPB_InputEvent_API() {
50 return this; 43 return this;
51 } 44 }
52 45
53 const InputEventData& PPB_InputEvent_Shared::GetInputEventData() const { 46 const InputEventData& PPB_InputEvent_Shared::GetInputEventData() const {
54 return data_; 47 return data_;
55 } 48 }
56 49
57 PP_InputEvent_Type PPB_InputEvent_Shared::GetType() { 50 PP_InputEvent_Type PPB_InputEvent_Shared::GetType() {
58 return data_.event_type; 51 return data_.event_type;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 112 }
120 113
121 void PPB_InputEvent_Shared::GetIMESelection(uint32_t* start, uint32_t* end) { 114 void PPB_InputEvent_Shared::GetIMESelection(uint32_t* start, uint32_t* end) {
122 if (start) 115 if (start)
123 *start = data_.composition_selection_start; 116 *start = data_.composition_selection_start;
124 if (end) 117 if (end)
125 *end = data_.composition_selection_end; 118 *end = data_.composition_selection_end;
126 } 119 }
127 120
128 } // namespace ppapi 121 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698