OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/private/find_private.h" | 5 #include "ppapi/cpp/private/find_private.h" |
6 | 6 |
7 #include "ppapi/c/private/ppb_find_private.h" | 7 #include "ppapi/c/private/ppb_find_private.h" |
8 #include "ppapi/cpp/instance.h" | 8 #include "ppapi/cpp/instance.h" |
9 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
| 11 #include "ppapi/cpp/rect.h" |
11 | 12 |
12 namespace pp { | 13 namespace pp { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 template <> const char* interface_name<PPB_Find_Private>() { | 17 template <> const char* interface_name<PPB_Find_Private>() { |
17 return PPB_FIND_PRIVATE_INTERFACE; | 18 return PPB_FIND_PRIVATE_INTERFACE; |
18 } | 19 } |
19 | 20 |
20 static const char kPPPFindInterface[] = PPP_FIND_PRIVATE_INTERFACE; | 21 static const char kPPPFindInterface[] = PPP_FIND_PRIVATE_INTERFACE; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
79 void Find_Private::SelectedFindResultChanged(int32_t index) { | 80 void Find_Private::SelectedFindResultChanged(int32_t index) { |
80 if (has_interface<PPB_Find_Private>()) { | 81 if (has_interface<PPB_Find_Private>()) { |
81 get_interface<PPB_Find_Private>()->SelectedFindResultChanged( | 82 get_interface<PPB_Find_Private>()->SelectedFindResultChanged( |
82 associated_instance_.pp_instance(), index); | 83 associated_instance_.pp_instance(), index); |
83 } | 84 } |
84 } | 85 } |
85 | 86 |
| 87 void Find_Private::SetTickmarks(const std::vector<pp::Rect>& tickmarks) { |
| 88 if (has_interface<PPB_Find_Private>()) { |
| 89 if (tickmarks.empty()) |
| 90 return; |
| 91 std::vector<PP_Rect> tickmarks_converted(tickmarks.begin(), |
| 92 tickmarks.end()); |
| 93 get_interface<PPB_Find_Private>()->SetTickmarks( |
| 94 associated_instance_.pp_instance(), &tickmarks_converted[0], |
| 95 static_cast<uint32_t>(tickmarks.size())); |
| 96 } |
| 97 } |
| 98 |
86 } // namespace pp | 99 } // namespace pp |
OLD | NEW |