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