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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 std::string* actual_mime_type); | 372 std::string* actual_mime_type); |
373 | 373 |
374 void TransferActiveWheelFlingAnimation( | 374 void TransferActiveWheelFlingAnimation( |
375 const WebKit::WebActiveWheelFlingParameters& params); | 375 const WebKit::WebActiveWheelFlingParameters& params); |
376 | 376 |
377 // Returns true if the focused element is editable text from the perspective | 377 // Returns true if the focused element is editable text from the perspective |
378 // of IME support (also used for on-screen keyboard). Works correctly inside | 378 // of IME support (also used for on-screen keyboard). Works correctly inside |
379 // supported PPAPI plug-ins. | 379 // supported PPAPI plug-ins. |
380 bool HasIMETextFocus(); | 380 bool HasIMETextFocus(); |
381 | 381 |
| 382 // Callback for use with GetWindowSnapshot. |
| 383 typedef base::Callback<void( |
| 384 const gfx::Size&, const std::vector<unsigned char>&)> |
| 385 WindowSnapshotCallback; |
| 386 |
| 387 void GetWindowSnapshot(const WindowSnapshotCallback& callback); |
| 388 |
382 // IPC::Listener implementation ---------------------------------------------- | 389 // IPC::Listener implementation ---------------------------------------------- |
383 | 390 |
384 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 391 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
385 | 392 |
386 // WebKit::WebWidgetClient implementation ------------------------------------ | 393 // WebKit::WebWidgetClient implementation ------------------------------------ |
387 | 394 |
388 // Most methods are handled by RenderWidget. | 395 // Most methods are handled by RenderWidget. |
389 virtual void didFocus(); | 396 virtual void didFocus(); |
390 virtual void didBlur(); | 397 virtual void didBlur(); |
391 virtual void show(WebKit::WebNavigationPolicy policy); | 398 virtual void show(WebKit::WebNavigationPolicy policy); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 #elif defined(OS_MACOSX) | 1031 #elif defined(OS_MACOSX) |
1025 void OnCopyToFindPboard(); | 1032 void OnCopyToFindPboard(); |
1026 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); | 1033 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
1027 void OnSelectPopupMenuItem(int selected_index); | 1034 void OnSelectPopupMenuItem(int selected_index); |
1028 void OnSetInLiveResize(bool in_live_resize); | 1035 void OnSetInLiveResize(bool in_live_resize); |
1029 void OnSetWindowVisibility(bool visible); | 1036 void OnSetWindowVisibility(bool visible); |
1030 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 1037 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
1031 const gfx::Rect& view_frame); | 1038 const gfx::Rect& view_frame); |
1032 #endif | 1039 #endif |
1033 | 1040 |
| 1041 void OnWindowSnapshotCompleted(const int snapshot_id, |
| 1042 const gfx::Size& size, const std::vector<unsigned char>& png); |
| 1043 |
1034 | 1044 |
1035 // Adding a new message handler? Please add it in alphabetical order above | 1045 // Adding a new message handler? Please add it in alphabetical order above |
1036 // and put it in the same position in the .cc file. | 1046 // and put it in the same position in the .cc file. |
1037 | 1047 |
1038 // Misc private functions ---------------------------------------------------- | 1048 // Misc private functions ---------------------------------------------------- |
1039 void ZoomFactorHelper(PageZoom zoom, int zoom_center_x, int zoom_center_y, | 1049 void ZoomFactorHelper(PageZoom zoom, int zoom_center_x, int zoom_center_y, |
1040 float scaling_increment); | 1050 float scaling_increment); |
1041 | 1051 |
1042 void AltErrorPageFinished(WebKit::WebFrame* frame, | 1052 void AltErrorPageFinished(WebKit::WebFrame* frame, |
1043 const WebKit::WebURLError& original_error, | 1053 const WebKit::WebURLError& original_error, |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 // is fine. | 1502 // is fine. |
1493 ObserverList<RenderViewObserver> observers_; | 1503 ObserverList<RenderViewObserver> observers_; |
1494 | 1504 |
1495 // Used to inform didChangeSelection() when it is called in the context | 1505 // Used to inform didChangeSelection() when it is called in the context |
1496 // of handling a ViewMsg_SelectRange IPC. | 1506 // of handling a ViewMsg_SelectRange IPC. |
1497 bool handling_select_range_; | 1507 bool handling_select_range_; |
1498 | 1508 |
1499 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 1509 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
1500 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 1510 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
1501 | 1511 |
| 1512 // State associated with the GetWindowSnapshot function. |
| 1513 int next_snapshot_id_; |
| 1514 typedef std::map<int, WindowSnapshotCallback> |
| 1515 PendingSnapshotMap; |
| 1516 PendingSnapshotMap pending_snapshots_; |
| 1517 |
1502 // Plugins ------------------------------------------------------------------- | 1518 // Plugins ------------------------------------------------------------------- |
1503 | 1519 |
1504 // All the currently active plugin delegates for this RenderView; kept so | 1520 // All the currently active plugin delegates for this RenderView; kept so |
1505 // that we can enumerate them to send updates about things like window | 1521 // that we can enumerate them to send updates about things like window |
1506 // location or tab focus and visibily. These are non-owning references. | 1522 // location or tab focus and visibily. These are non-owning references. |
1507 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1523 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1508 | 1524 |
1509 #if defined(OS_WIN) | 1525 #if defined(OS_WIN) |
1510 // The ID of the focused NPAPI plug-in. | 1526 // The ID of the focused NPAPI plug-in. |
1511 int focused_plugin_id_; | 1527 int focused_plugin_id_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 // use the Observer interface to filter IPC messages and receive frame change | 1576 // use the Observer interface to filter IPC messages and receive frame change |
1561 // notifications. | 1577 // notifications. |
1562 // --------------------------------------------------------------------------- | 1578 // --------------------------------------------------------------------------- |
1563 | 1579 |
1564 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1580 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1565 }; | 1581 }; |
1566 | 1582 |
1567 } // namespace content | 1583 } // namespace content |
1568 | 1584 |
1569 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1585 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |