| OLD | NEW |
| 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 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "ppapi/proxy/broker_dispatcher.h" | 17 #include "ppapi/proxy/broker_dispatcher.h" |
| 18 #include "ppapi/proxy/proxy_channel.h" | 18 #include "ppapi/proxy/proxy_channel.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h" |
| 19 #include "webkit/plugins/ppapi/plugin_delegate.h" | 20 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 20 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
| 21 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
| 22 | 23 |
| 23 class FilePath; | 24 class FilePath; |
| 24 class PepperPluginDelegateImpl; | 25 class PepperPluginDelegateImpl; |
| 25 class RenderView; | 26 class RenderView; |
| 26 | 27 |
| 27 namespace gfx { | 28 namespace gfx { |
| 28 class Point; | 29 class Point; |
| 29 class Rect; | 30 class Rect; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace IPC { | 33 namespace IPC { |
| 33 struct ChannelHandle; | 34 struct ChannelHandle; |
| 34 } | 35 } |
| 35 | 36 |
| 36 namespace webkit { | 37 namespace webkit { |
| 37 struct WebPluginInfo; | 38 struct WebPluginInfo; |
| 38 namespace ppapi { | 39 namespace ppapi { |
| 39 class PepperFilePath; | 40 class PepperFilePath; |
| 40 class PluginInstance; | 41 class PluginInstance; |
| 41 class PluginModule; | 42 class PluginModule; |
| 42 } | 43 } |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace WebKit { | 46 namespace WebKit { |
| 47 struct WebCompositionUnderline; |
| 46 class WebFileChooserCompletion; | 48 class WebFileChooserCompletion; |
| 47 struct WebFileChooserParams; | 49 struct WebFileChooserParams; |
| 48 } | 50 } |
| 49 | 51 |
| 50 namespace webkit_glue { | 52 namespace webkit_glue { |
| 51 struct CustomContextMenuContext; | 53 struct CustomContextMenuContext; |
| 52 } | 54 } |
| 53 | 55 |
| 54 class TransportDIB; | 56 class TransportDIB; |
| 55 | 57 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 base::ProcessHandle broker_process_handle, | 157 base::ProcessHandle broker_process_handle, |
| 156 const IPC::ChannelHandle& handle); | 158 const IPC::ChannelHandle& handle); |
| 157 | 159 |
| 158 // Removes broker from pending_connect_broker_ if present. Returns true if so. | 160 // Removes broker from pending_connect_broker_ if present. Returns true if so. |
| 159 bool StopWaitingForPpapiBrokerConnection(PpapiBrokerImpl* broker); | 161 bool StopWaitingForPpapiBrokerConnection(PpapiBrokerImpl* broker); |
| 160 | 162 |
| 161 // Notification that the render view has been focused or defocused. This | 163 // Notification that the render view has been focused or defocused. This |
| 162 // notifies all of the plugins. | 164 // notifies all of the plugins. |
| 163 void OnSetFocus(bool has_focus); | 165 void OnSetFocus(bool has_focus); |
| 164 | 166 |
| 165 // Returns whether or not a Pepper plugin is focused. | 167 // IME status. |
| 166 bool IsPluginFocused() const; | 168 bool IsPluginFocused() const; |
| 169 WebKit::WebRect GetCaretBounds() const; |
| 170 WebKit::WebTextInputType GetTextInputType() const; |
| 171 bool CanComposeInline() const; |
| 172 |
| 173 // IME events. |
| 174 void OnImeSetComposition( |
| 175 const string16& text, |
| 176 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
| 177 int selection_start, |
| 178 int selection_end); |
| 179 void OnImeConfirmComposition(const string16& text); |
| 167 | 180 |
| 168 // PluginDelegate implementation. | 181 // PluginDelegate implementation. |
| 169 virtual void PluginFocusChanged(bool focused) OVERRIDE; | 182 virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance, |
| 183 bool focused) OVERRIDE; |
| 184 virtual void PluginTextInputTypeChanged( |
| 185 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| 170 virtual void PluginCrashed(webkit::ppapi::PluginInstance* instance); | 186 virtual void PluginCrashed(webkit::ppapi::PluginInstance* instance); |
| 171 virtual void InstanceCreated( | 187 virtual void InstanceCreated( |
| 172 webkit::ppapi::PluginInstance* instance); | 188 webkit::ppapi::PluginInstance* instance); |
| 173 virtual void InstanceDeleted( | 189 virtual void InstanceDeleted( |
| 174 webkit::ppapi::PluginInstance* instance); | 190 webkit::ppapi::PluginInstance* instance); |
| 175 virtual SkBitmap* GetSadPluginBitmap(); | 191 virtual SkBitmap* GetSadPluginBitmap(); |
| 176 virtual PlatformAudio* CreateAudio( | 192 virtual PlatformAudio* CreateAudio( |
| 177 uint32_t sample_rate, | 193 uint32_t sample_rate, |
| 178 uint32_t sample_count, | 194 uint32_t sample_count, |
| 179 PlatformAudio::Client* client); | 195 PlatformAudio::Client* client); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 347 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
| 332 IDMapOwnPointer> pending_connect_tcps_; | 348 IDMapOwnPointer> pending_connect_tcps_; |
| 333 | 349 |
| 334 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 350 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 335 IDMapOwnPointer> pending_context_menus_; | 351 IDMapOwnPointer> pending_context_menus_; |
| 336 | 352 |
| 337 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; | 353 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 338 BrokerMap pending_connect_broker_; | 354 BrokerMap pending_connect_broker_; |
| 339 | 355 |
| 340 // Whether or not the focus is on a PPAPI plugin | 356 // Whether or not the focus is on a PPAPI plugin |
| 341 bool is_pepper_plugin_focused_; | 357 webkit::ppapi::PluginInstance* focused_plugin_; |
| 358 |
| 359 // Current text input composition text. Empty if no composition is on process. |
| 360 string16 composition_text_; |
| 342 | 361 |
| 343 // Set of instances to receive a notification when the enterprise policy has | 362 // Set of instances to receive a notification when the enterprise policy has |
| 344 // been updated. | 363 // been updated. |
| 345 std::set<webkit::ppapi::PluginInstance*> subscribed_to_policy_updates_; | 364 std::set<webkit::ppapi::PluginInstance*> subscribed_to_policy_updates_; |
| 346 | 365 |
| 347 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 366 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 348 }; | 367 }; |
| 349 | 368 |
| 350 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 369 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |