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

Side by Side Diff: ppapi/cpp/instance.cc

Issue 8951014: Change the DidChangeView update to take a new ViewChanged resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 9 years 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/cpp/instance.h" 5 #include "ppapi/cpp/instance.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_input_event.h" 8 #include "ppapi/c/ppb_input_event.h"
9 #include "ppapi/c/ppb_instance.h" 9 #include "ppapi/c/ppb_instance.h"
10 #include "ppapi/c/ppb_messaging.h" 10 #include "ppapi/c/ppb_messaging.h"
11 #include "ppapi/cpp/graphics_2d.h" 11 #include "ppapi/cpp/graphics_2d.h"
12 #include "ppapi/cpp/graphics_3d.h" 12 #include "ppapi/cpp/graphics_3d.h"
13 #include "ppapi/cpp/image_data.h" 13 #include "ppapi/cpp/image_data.h"
14 #include "ppapi/cpp/logging.h" 14 #include "ppapi/cpp/logging.h"
15 #include "ppapi/cpp/module.h" 15 #include "ppapi/cpp/module.h"
16 #include "ppapi/cpp/module_impl.h" 16 #include "ppapi/cpp/module_impl.h"
17 #include "ppapi/cpp/point.h" 17 #include "ppapi/cpp/point.h"
18 #include "ppapi/cpp/resource.h" 18 #include "ppapi/cpp/resource.h"
19 #include "ppapi/cpp/var.h" 19 #include "ppapi/cpp/var.h"
20 #include "ppapi/cpp/view.h"
20 21
21 namespace pp { 22 namespace pp {
22 23
23 namespace { 24 namespace {
24 25
25 template <> const char* interface_name<PPB_InputEvent>() { 26 template <> const char* interface_name<PPB_InputEvent>() {
26 return PPB_INPUT_EVENT_INTERFACE; 27 return PPB_INPUT_EVENT_INTERFACE;
27 } 28 }
28 29
29 template <> const char* interface_name<PPB_Instance>() { 30 template <> const char* interface_name<PPB_Instance>() {
(...skipping 17 matching lines...) Expand all
47 // If they're not unregistered at this point, they will usually have a 48 // If they're not unregistered at this point, they will usually have a
48 // dangling reference to the instance, which can cause a crash later. 49 // dangling reference to the instance, which can cause a crash later.
49 PP_DCHECK(interface_name_to_objects_.empty()); 50 PP_DCHECK(interface_name_to_objects_.empty());
50 } 51 }
51 52
52 bool Instance::Init(uint32_t /*argc*/, const char* /*argn*/[], 53 bool Instance::Init(uint32_t /*argc*/, const char* /*argn*/[],
53 const char* /*argv*/[]) { 54 const char* /*argv*/[]) {
54 return true; 55 return true;
55 } 56 }
56 57
58 void Instance::DidChangeView(const View& view) {
59 // Call the deprecated version for source backwards-compat.
60 DidChangeView(view.GetRect(), view.GetClipRect());
61 }
62
57 void Instance::DidChangeView(const pp::Rect& /*position*/, 63 void Instance::DidChangeView(const pp::Rect& /*position*/,
58 const pp::Rect& /*clip*/) { 64 const pp::Rect& /*clip*/) {
59 } 65 }
60 66
61 void Instance::DidChangeFocus(bool /*has_focus*/) { 67 void Instance::DidChangeFocus(bool /*has_focus*/) {
62 } 68 }
63 69
64 70
65 bool Instance::HandleDocumentLoad(const URLLoader& /*url_loader*/) { 71 bool Instance::HandleDocumentLoad(const URLLoader& /*url_loader*/) {
66 return false; 72 return false;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (!that) 162 if (!that)
157 return NULL; 163 return NULL;
158 InterfaceNameToObjectMap::iterator found = 164 InterfaceNameToObjectMap::iterator found =
159 that->interface_name_to_objects_.find(interface_name); 165 that->interface_name_to_objects_.find(interface_name);
160 if (found == that->interface_name_to_objects_.end()) 166 if (found == that->interface_name_to_objects_.end())
161 return NULL; 167 return NULL;
162 return found->second; 168 return found->second;
163 } 169 }
164 170
165 } // namespace pp 171 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/instance.h ('k') | ppapi/cpp/module.cc » ('j') | ppapi/cpp/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698