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

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

Issue 9481015: Make the PPP wrappers take an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH DESCRIPTION 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
« no previous file with comments | « ppapi/cpp/dev/find_dev.h ('k') | ppapi/cpp/dev/printing_dev.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/find_dev.h" 5 #include "ppapi/cpp/dev/find_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_find_dev.h" 7 #include "ppapi/c/dev/ppb_find_dev.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"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 const PPP_Find_Dev ppp_find = { 45 const PPP_Find_Dev ppp_find = {
46 &StartFind, 46 &StartFind,
47 &SelectFindResult, 47 &SelectFindResult,
48 &StopFind 48 &StopFind
49 }; 49 };
50 50
51 } // namespace 51 } // namespace
52 52
53 Find_Dev::Find_Dev(const InstanceHandle& instance) 53 Find_Dev::Find_Dev(Instance* instance) : associated_instance_(instance) {
54 : associated_instance_(instance) {
55 Module::Get()->AddPluginInterface(kPPPFindInterface, &ppp_find); 54 Module::Get()->AddPluginInterface(kPPPFindInterface, &ppp_find);
56 Instance::AddPerInstanceObject(instance, kPPPFindInterface, this); 55 instance->AddPerInstanceObject(kPPPFindInterface, this);
57 } 56 }
58 57
59 Find_Dev::~Find_Dev() { 58 Find_Dev::~Find_Dev() {
60 Instance::RemovePerInstanceObject(associated_instance_, 59 Instance::RemovePerInstanceObject(associated_instance_,
61 kPPPFindInterface, this); 60 kPPPFindInterface, this);
62 } 61 }
63 62
64 void Find_Dev::NumberOfFindResultsChanged(int32_t total, bool final_result) { 63 void Find_Dev::NumberOfFindResultsChanged(int32_t total, bool final_result) {
65 if (has_interface<PPB_Find_Dev>()) { 64 if (has_interface<PPB_Find_Dev>()) {
66 get_interface<PPB_Find_Dev>()->NumberOfFindResultsChanged( 65 get_interface<PPB_Find_Dev>()->NumberOfFindResultsChanged(
67 associated_instance_.pp_instance(), total, PP_FromBool(final_result)); 66 associated_instance_.pp_instance(), total, PP_FromBool(final_result));
68 } 67 }
69 } 68 }
70 69
71 void Find_Dev::SelectedFindResultChanged(int32_t index) { 70 void Find_Dev::SelectedFindResultChanged(int32_t index) {
72 if (has_interface<PPB_Find_Dev>()) { 71 if (has_interface<PPB_Find_Dev>()) {
73 get_interface<PPB_Find_Dev>()->SelectedFindResultChanged( 72 get_interface<PPB_Find_Dev>()->SelectedFindResultChanged(
74 associated_instance_.pp_instance(), index); 73 associated_instance_.pp_instance(), index);
75 } 74 }
76 } 75 }
77 76
78 } // namespace pp 77 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/find_dev.h ('k') | ppapi/cpp/dev/printing_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698