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

Side by Side Diff: ppapi/cpp/private/find_private.cc

Issue 195893044: Add a PPB_Find_Private function to set the tickmarks on the page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « ppapi/cpp/private/find_private.h ('k') | ppapi/proxy/ppapi_messages.h » ('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 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
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
OLDNEW
« no previous file with comments | « ppapi/cpp/private/find_private.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698