| OLD | NEW |
| 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 "chrome/renderer/pepper_plugin_delegate_impl.h" | 5 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include "app/surface/transport_dib.h" | 7 #include "app/surface/transport_dib.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "chrome/renderer/render_view.h" |
| 9 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 10 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 10 | 11 |
| 11 #if defined(OS_MACOSX) | 12 #if defined(OS_MACOSX) |
| 12 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 13 #include "chrome/renderer/render_thread.h" | 14 #include "chrome/renderer/render_thread.h" |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // Implements the Image2D using a TransportDIB. | 19 // Implements the Image2D using a TransportDIB. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 TransportDIB* dib = TransportDIB::Map(dib_handle); | 125 TransportDIB* dib = TransportDIB::Map(dib_handle); |
| 125 #else | 126 #else |
| 126 static int next_dib_id = 0; | 127 static int next_dib_id = 0; |
| 127 TransportDIB* dib = TransportDIB::Create(buffer_size, next_dib_id++); | 128 TransportDIB* dib = TransportDIB::Create(buffer_size, next_dib_id++); |
| 128 if (!dib) | 129 if (!dib) |
| 129 return NULL; | 130 return NULL; |
| 130 #endif | 131 #endif |
| 131 | 132 |
| 132 return new PlatformImage2DImpl(width, height, dib); | 133 return new PlatformImage2DImpl(width, height, dib); |
| 133 } | 134 } |
| 135 |
| 136 void PepperPluginDelegateImpl::DidChangeNumberOfFindResults(int identifier, |
| 137 int total, |
| 138 bool final_result) { |
| 139 if (total == 0) { |
| 140 render_view_->ReportNoFindInPageResults(identifier); |
| 141 } else { |
| 142 render_view_->reportFindInPageMatchCount(identifier, total, final_result); |
| 143 } |
| 144 } |
| 145 |
| 146 void PepperPluginDelegateImpl::DidChangeSelectedFindResult(int identifier, |
| 147 int index) { |
| 148 render_view_->reportFindInPageSelection( |
| 149 identifier, index + 1, WebKit::WebRect()); |
| 150 } |
| OLD | NEW |