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