Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: content/renderer/render_view_impl.h

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

Powered by Google App Engine
This is Rietveld 408576698