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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 513723003: Add pixel readback to page popup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #include "platform/TraceEvent.h" 106 #include "platform/TraceEvent.h"
107 #include "platform/UserGestureIndicator.h" 107 #include "platform/UserGestureIndicator.h"
108 #include "platform/exported/WebActiveGestureAnimation.h" 108 #include "platform/exported/WebActiveGestureAnimation.h"
109 #include "platform/fonts/FontCache.h" 109 #include "platform/fonts/FontCache.h"
110 #include "platform/graphics/Color.h" 110 #include "platform/graphics/Color.h"
111 #include "platform/graphics/Image.h" 111 #include "platform/graphics/Image.h"
112 #include "platform/graphics/ImageBuffer.h" 112 #include "platform/graphics/ImageBuffer.h"
113 #include "platform/scroll/ScrollbarTheme.h" 113 #include "platform/scroll/ScrollbarTheme.h"
114 #include "platform/weborigin/SchemeRegistry.h" 114 #include "platform/weborigin/SchemeRegistry.h"
115 #include "public/platform/Platform.h" 115 #include "public/platform/Platform.h"
116 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
116 #include "public/platform/WebDragData.h" 117 #include "public/platform/WebDragData.h"
117 #include "public/platform/WebFloatPoint.h" 118 #include "public/platform/WebFloatPoint.h"
118 #include "public/platform/WebGestureCurve.h" 119 #include "public/platform/WebGestureCurve.h"
119 #include "public/platform/WebImage.h" 120 #include "public/platform/WebImage.h"
120 #include "public/platform/WebLayerTreeView.h" 121 #include "public/platform/WebLayerTreeView.h"
121 #include "public/platform/WebURLRequest.h" 122 #include "public/platform/WebURLRequest.h"
122 #include "public/platform/WebVector.h" 123 #include "public/platform/WebVector.h"
123 #include "public/web/WebAXObject.h" 124 #include "public/web/WebAXObject.h"
124 #include "public/web/WebActiveWheelFlingParameters.h" 125 #include "public/web/WebActiveWheelFlingParameters.h"
125 #include "public/web/WebAutofillClient.h" 126 #include "public/web/WebAutofillClient.h"
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 { 1555 {
1555 ASSERT(popup); 1556 ASSERT(popup);
1556 WebPagePopupImpl* popupImpl = toWebPagePopupImpl(popup); 1557 WebPagePopupImpl* popupImpl = toWebPagePopupImpl(popup);
1557 ASSERT(m_pagePopup.get() == popupImpl); 1558 ASSERT(m_pagePopup.get() == popupImpl);
1558 if (m_pagePopup.get() != popupImpl) 1559 if (m_pagePopup.get() != popupImpl)
1559 return; 1560 return;
1560 m_pagePopup->closePopup(); 1561 m_pagePopup->closePopup();
1561 m_pagePopup = nullptr; 1562 m_pagePopup = nullptr;
1562 } 1563 }
1563 1564
1565 LocalDOMWindow* WebViewImpl::pagePopupWindow()
1566 {
1567 return m_pagePopup ? m_pagePopup->window() : nullptr;
1568 }
1569
1564 Frame* WebViewImpl::focusedCoreFrame() const 1570 Frame* WebViewImpl::focusedCoreFrame() const
1565 { 1571 {
1566 return m_page ? m_page->focusController().focusedOrMainFrame() : 0; 1572 return m_page ? m_page->focusController().focusedOrMainFrame() : 0;
1567 } 1573 }
1568 1574
1569 WebViewImpl* WebViewImpl::fromPage(Page* page) 1575 WebViewImpl* WebViewImpl::fromPage(Page* page)
1570 { 1576 {
1571 if (!page) 1577 if (!page)
1572 return 0; 1578 return 0;
1573 return static_cast<WebViewImpl*>(page->chrome().client().webView()); 1579 return static_cast<WebViewImpl*>(page->chrome().client().webView());
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 if (!m_page) 2482 if (!m_page)
2477 return m_baseBackgroundColor; 2483 return m_baseBackgroundColor;
2478 if (!m_page->mainFrame()) 2484 if (!m_page->mainFrame())
2479 return m_baseBackgroundColor; 2485 return m_baseBackgroundColor;
2480 if (!m_page->mainFrame()->isLocalFrame()) 2486 if (!m_page->mainFrame()->isLocalFrame())
2481 return m_baseBackgroundColor; 2487 return m_baseBackgroundColor;
2482 FrameView* view = m_page->deprecatedLocalMainFrame()->view(); 2488 FrameView* view = m_page->deprecatedLocalMainFrame()->view();
2483 return view->documentBackgroundColor().rgb(); 2489 return view->documentBackgroundColor().rgb();
2484 } 2490 }
2485 2491
2492 WebPagePopup* WebViewImpl::popup() const
2493 {
2494 return m_pagePopup.get();
2495 }
2496
2486 bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length) 2497 bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length)
2487 { 2498 {
2488 const LocalFrame* focused = toLocalFrame(focusedCoreFrame()); 2499 const LocalFrame* focused = toLocalFrame(focusedCoreFrame());
2489 if (!focused) 2500 if (!focused)
2490 return false; 2501 return false;
2491 2502
2492 PlainTextRange selectionOffsets = focused->inputMethodController().getSelect ionOffsets(); 2503 PlainTextRange selectionOffsets = focused->inputMethodController().getSelect ionOffsets();
2493 if (selectionOffsets.isNull()) 2504 if (selectionOffsets.isNull())
2494 return false; 2505 return false;
2495 2506
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after
4274 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4285 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4275 4286
4276 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4287 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4277 return false; 4288 return false;
4278 4289
4279 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4290 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4280 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4291 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4281 } 4292 }
4282 4293
4283 } // namespace blink 4294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698