OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/string16.h" | 17 #include "base/string16.h.h" |
18 #include "cc/layers/texture_layer_client.h" | 18 #include "cc/layers/texture_layer_client.h" |
19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
20 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 20 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
21 #include "ppapi/c/dev/ppp_find_dev.h" | 21 #include "ppapi/c/dev/ppp_find_dev.h" |
22 #include "ppapi/c/dev/ppp_printing_dev.h" | 22 #include "ppapi/c/dev/ppp_printing_dev.h" |
23 #include "ppapi/c/dev/ppp_selection_dev.h" | 23 #include "ppapi/c/dev/ppp_selection_dev.h" |
24 #include "ppapi/c/dev/ppp_text_input_dev.h" | 24 #include "ppapi/c/dev/ppp_text_input_dev.h" |
25 #include "ppapi/c/dev/ppp_zoom_dev.h" | 25 #include "ppapi/c/dev/ppp_zoom_dev.h" |
26 #include "ppapi/c/pp_completion_callback.h" | 26 #include "ppapi/c/pp_completion_callback.h" |
27 #include "ppapi/c/pp_instance.h" | 27 #include "ppapi/c/pp_instance.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 const std::vector<std::string>& arg_values, | 178 const std::vector<std::string>& arg_values, |
179 bool full_frame); | 179 bool full_frame); |
180 bool HandleDocumentLoad(PPB_URLLoader_Impl* loader); | 180 bool HandleDocumentLoad(PPB_URLLoader_Impl* loader); |
181 bool HandleInputEvent(const WebKit::WebInputEvent& event, | 181 bool HandleInputEvent(const WebKit::WebInputEvent& event, |
182 WebKit::WebCursorInfo* cursor_info); | 182 WebKit::WebCursorInfo* cursor_info); |
183 PP_Var GetInstanceObject(); | 183 PP_Var GetInstanceObject(); |
184 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip, | 184 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip, |
185 const std::vector<gfx::Rect>& cut_outs_rects); | 185 const std::vector<gfx::Rect>& cut_outs_rects); |
186 | 186 |
187 // Handlers for composition events. | 187 // Handlers for composition events. |
188 bool HandleCompositionStart(const string16& text); | 188 bool HandleCompositionStart(const base::string16& text); |
189 bool HandleCompositionUpdate( | 189 bool HandleCompositionUpdate( |
190 const string16& text, | 190 const base::string16& text, |
191 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 191 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
192 int selection_start, | 192 int selection_start, |
193 int selection_end); | 193 int selection_end); |
194 bool HandleCompositionEnd(const string16& text); | 194 bool HandleCompositionEnd(const base::string16& text); |
195 bool HandleTextInput(const string16& text); | 195 bool HandleTextInput(const base::string16& text); |
196 | 196 |
197 // Gets the current text input status. | 197 // Gets the current text input status. |
198 ui::TextInputType text_input_type() const { return text_input_type_; } | 198 ui::TextInputType text_input_type() const { return text_input_type_; } |
199 gfx::Rect GetCaretBounds() const; | 199 gfx::Rect GetCaretBounds() const; |
200 bool IsPluginAcceptingCompositionEvents() const; | 200 bool IsPluginAcceptingCompositionEvents() const; |
201 void GetSurroundingText(string16* text, ui::Range* range) const; | 201 void GetSurroundingText(base::string16* text, ui::Range* range) const; |
202 | 202 |
203 // Notifications about focus changes, see has_webkit_focus_ below. | 203 // Notifications about focus changes, see has_webkit_focus_ below. |
204 void SetWebKitFocus(bool has_focus); | 204 void SetWebKitFocus(bool has_focus); |
205 void SetContentAreaFocus(bool has_focus); | 205 void SetContentAreaFocus(bool has_focus); |
206 | 206 |
207 // Notification about page visibility. The default is "visible". | 207 // Notification about page visibility. The default is "visible". |
208 void PageVisibilityChanged(bool is_visible); | 208 void PageVisibilityChanged(bool is_visible); |
209 | 209 |
210 // Notifications that the view is about to paint, has started painting, and | 210 // Notifications that the view is about to paint, has started painting, and |
211 // has flushed the painted content to the screen. These messages are used to | 211 // has flushed the painted content to the screen. These messages are used to |
(...skipping 10 matching lines...) Expand all Loading... |
222 const gfx::Rect& paint_bounds, | 222 const gfx::Rect& paint_bounds, |
223 TransportDIB** dib, | 223 TransportDIB** dib, |
224 gfx::Rect* dib_bounds, | 224 gfx::Rect* dib_bounds, |
225 gfx::Rect* clip, | 225 gfx::Rect* clip, |
226 float* scale_factor); | 226 float* scale_factor); |
227 | 227 |
228 // Tracks all live PluginObjects. | 228 // Tracks all live PluginObjects. |
229 void AddPluginObject(PluginObject* plugin_object); | 229 void AddPluginObject(PluginObject* plugin_object); |
230 void RemovePluginObject(PluginObject* plugin_object); | 230 void RemovePluginObject(PluginObject* plugin_object); |
231 | 231 |
232 string16 GetSelectedText(bool html); | 232 base::string16 GetSelectedText(bool html); |
233 string16 GetLinkAtPosition(const gfx::Point& point); | 233 base::string16 GetLinkAtPosition(const gfx::Point& point); |
234 void RequestSurroundingText(size_t desired_number_of_characters); | 234 void RequestSurroundingText(size_t desired_number_of_characters); |
235 void Zoom(double factor, bool text_only); | 235 void Zoom(double factor, bool text_only); |
236 bool StartFind(const string16& search_text, | 236 bool StartFind(const base::string16& search_text, |
237 bool case_sensitive, | 237 bool case_sensitive, |
238 int identifier); | 238 int identifier); |
239 void SelectFindResult(bool forward); | 239 void SelectFindResult(bool forward); |
240 void StopFind(); | 240 void StopFind(); |
241 | 241 |
242 bool SupportsPrintInterface(); | 242 bool SupportsPrintInterface(); |
243 bool IsPrintScalingDisabled(); | 243 bool IsPrintScalingDisabled(); |
244 int PrintBegin(const WebKit::WebPrintParams& print_params); | 244 int PrintBegin(const WebKit::WebPrintParams& print_params); |
245 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); | 245 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); |
246 void PrintEnd(); | 246 void PrintEnd(); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 // Internal helper function for PrintPage(). | 558 // Internal helper function for PrintPage(). |
559 bool PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, | 559 bool PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, |
560 int num_ranges, | 560 int num_ranges, |
561 WebKit::WebCanvas* canvas); | 561 WebKit::WebCanvas* canvas); |
562 | 562 |
563 void DoSetCursor(WebKit::WebCursorInfo* cursor); | 563 void DoSetCursor(WebKit::WebCursorInfo* cursor); |
564 | 564 |
565 // Internal helper functions for HandleCompositionXXX(). | 565 // Internal helper functions for HandleCompositionXXX(). |
566 bool SendCompositionEventToPlugin( | 566 bool SendCompositionEventToPlugin( |
567 PP_InputEvent_Type type, | 567 PP_InputEvent_Type type, |
568 const string16& text); | 568 const base::string16& text); |
569 bool SendCompositionEventWithUnderlineInformationToPlugin( | 569 bool SendCompositionEventWithUnderlineInformationToPlugin( |
570 PP_InputEvent_Type type, | 570 PP_InputEvent_Type type, |
571 const string16& text, | 571 const base::string16& text, |
572 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 572 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
573 int selection_start, | 573 int selection_start, |
574 int selection_end); | 574 int selection_end); |
575 | 575 |
576 // Internal helper function for XXXInputEvents(). | 576 // Internal helper function for XXXInputEvents(). |
577 void RequestInputEventsHelper(uint32_t event_classes); | 577 void RequestInputEventsHelper(uint32_t event_classes); |
578 | 578 |
579 // Checks if the security origin of the document containing this instance can | 579 // Checks if the security origin of the document containing this instance can |
580 // assess the security origin of the main frame document. | 580 // assess the security origin of the main frame document. |
581 bool CanAccessMainFrame() const; | 581 bool CanAccessMainFrame() const; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; | 785 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; |
786 | 786 |
787 friend class PpapiPluginInstanceTest; | 787 friend class PpapiPluginInstanceTest; |
788 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 788 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
789 }; | 789 }; |
790 | 790 |
791 } // namespace ppapi | 791 } // namespace ppapi |
792 } // namespace webkit | 792 } // namespace webkit |
793 | 793 |
794 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 794 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |