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 CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 std::string* actual_mime_type); | 358 std::string* actual_mime_type); |
359 | 359 |
360 void TransferActiveWheelFlingAnimation( | 360 void TransferActiveWheelFlingAnimation( |
361 const WebKit::WebActiveWheelFlingParameters& params); | 361 const WebKit::WebActiveWheelFlingParameters& params); |
362 | 362 |
363 // Returns true if the focused element is editable text from the perspective | 363 // Returns true if the focused element is editable text from the perspective |
364 // of IME support (also used for on-screen keyboard). Works correctly inside | 364 // of IME support (also used for on-screen keyboard). Works correctly inside |
365 // supported PPAPI plug-ins. | 365 // supported PPAPI plug-ins. |
366 bool HasIMETextFocus(); | 366 bool HasIMETextFocus(); |
367 | 367 |
| 368 // Callback for use with GetWindowSnapshot. |
| 369 typedef base::Callback<void( |
| 370 const gfx::Size&, const std::vector<unsigned char>&)> |
| 371 WindowSnapshotCallback; |
| 372 |
| 373 void GetWindowSnapshot(const WindowSnapshotCallback& callback); |
| 374 |
368 // IPC::Listener implementation ---------------------------------------------- | 375 // IPC::Listener implementation ---------------------------------------------- |
369 | 376 |
370 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 377 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
371 | 378 |
372 // WebKit::WebWidgetClient implementation ------------------------------------ | 379 // WebKit::WebWidgetClient implementation ------------------------------------ |
373 | 380 |
374 // Most methods are handled by RenderWidget. | 381 // Most methods are handled by RenderWidget. |
375 virtual void didFocus(); | 382 virtual void didFocus(); |
376 virtual void didBlur(); | 383 virtual void didBlur(); |
377 virtual void show(WebKit::WebNavigationPolicy policy); | 384 virtual void show(WebKit::WebNavigationPolicy policy); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 #elif defined(OS_MACOSX) | 1022 #elif defined(OS_MACOSX) |
1016 void OnCopyToFindPboard(); | 1023 void OnCopyToFindPboard(); |
1017 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); | 1024 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
1018 CONTENT_EXPORT void OnSelectPopupMenuItem(int selected_index); | 1025 CONTENT_EXPORT void OnSelectPopupMenuItem(int selected_index); |
1019 void OnSetInLiveResize(bool in_live_resize); | 1026 void OnSetInLiveResize(bool in_live_resize); |
1020 void OnSetWindowVisibility(bool visible); | 1027 void OnSetWindowVisibility(bool visible); |
1021 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 1028 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
1022 const gfx::Rect& view_frame); | 1029 const gfx::Rect& view_frame); |
1023 #endif | 1030 #endif |
1024 | 1031 |
| 1032 void OnWindowSnapshotCompleted(const int snapshot_id, |
| 1033 const gfx::Size& size, const std::vector<unsigned char>& png); |
| 1034 |
1025 | 1035 |
1026 // Adding a new message handler? Please add it in alphabetical order above | 1036 // Adding a new message handler? Please add it in alphabetical order above |
1027 // and put it in the same position in the .cc file. | 1037 // and put it in the same position in the .cc file. |
1028 | 1038 |
1029 // Misc private functions ---------------------------------------------------- | 1039 // Misc private functions ---------------------------------------------------- |
1030 void ZoomFactorHelper(PageZoom zoom, int zoom_center_x, int zoom_center_y, | 1040 void ZoomFactorHelper(PageZoom zoom, int zoom_center_x, int zoom_center_y, |
1031 float scaling_increment); | 1041 float scaling_increment); |
1032 | 1042 |
1033 void AltErrorPageFinished(WebKit::WebFrame* frame, | 1043 void AltErrorPageFinished(WebKit::WebFrame* frame, |
1034 const WebKit::WebURLError& original_error, | 1044 const WebKit::WebURLError& original_error, |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 // is fine. | 1497 // is fine. |
1488 ObserverList<RenderViewObserver> observers_; | 1498 ObserverList<RenderViewObserver> observers_; |
1489 | 1499 |
1490 // Used to inform didChangeSelection() when it is called in the context | 1500 // Used to inform didChangeSelection() when it is called in the context |
1491 // of handling a ViewMsg_SelectRange IPC. | 1501 // of handling a ViewMsg_SelectRange IPC. |
1492 bool handling_select_range_; | 1502 bool handling_select_range_; |
1493 | 1503 |
1494 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 1504 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
1495 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 1505 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
1496 | 1506 |
| 1507 // State associated with the GetWindowSnapshot function. |
| 1508 int next_snapshot_id_; |
| 1509 typedef std::map<int, WindowSnapshotCallback> |
| 1510 PendingSnapshotMap; |
| 1511 PendingSnapshotMap pending_snapshots_; |
| 1512 |
1497 // Plugins ------------------------------------------------------------------- | 1513 // Plugins ------------------------------------------------------------------- |
1498 | 1514 |
1499 // All the currently active plugin delegates for this RenderView; kept so | 1515 // All the currently active plugin delegates for this RenderView; kept so |
1500 // that we can enumerate them to send updates about things like window | 1516 // that we can enumerate them to send updates about things like window |
1501 // location or tab focus and visibily. These are non-owning references. | 1517 // location or tab focus and visibily. These are non-owning references. |
1502 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1518 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1503 | 1519 |
1504 #if defined(OS_WIN) | 1520 #if defined(OS_WIN) |
1505 // The ID of the focused NPAPI plug-in. | 1521 // The ID of the focused NPAPI plug-in. |
1506 int focused_plugin_id_; | 1522 int focused_plugin_id_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 // use the Observer interface to filter IPC messages and receive frame change | 1571 // use the Observer interface to filter IPC messages and receive frame change |
1556 // notifications. | 1572 // notifications. |
1557 // --------------------------------------------------------------------------- | 1573 // --------------------------------------------------------------------------- |
1558 | 1574 |
1559 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1575 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1560 }; | 1576 }; |
1561 | 1577 |
1562 } // namespace content | 1578 } // namespace content |
1563 | 1579 |
1564 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1580 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |