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

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

Issue 259263003: Fix to remove customised String over IPC for SmartClip (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: changes done according to review comments Created 6 years, 7 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
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 3430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3441 if (!page()) 3441 if (!page())
3442 return; 3442 return;
3443 3443
3444 page()->contextMenuController().clearContextMenu(); 3444 page()->contextMenuController().clearContextMenu();
3445 m_contextMenuAllowed = true; 3445 m_contextMenuAllowed = true;
3446 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse dOrMainFrame())) 3446 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse dOrMainFrame()))
3447 focusedFrame->eventHandler().sendContextMenuEventForKey(); 3447 focusedFrame->eventHandler().sendContextMenuEventForKey();
3448 m_contextMenuAllowed = false; 3448 m_contextMenuAllowed = false;
3449 } 3449 }
3450 3450
3451 WebString WebViewImpl::getSmartClipData(WebRect rect) 3451 void WebViewImpl::getSmartClipData(WebRect rect, WebString* clipText, WebRect* c lipRect)
3452 { 3452 {
3453 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); 3453 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame());
3454 if (!frame) 3454 if (!frame)
3455 return WebString(); 3455 return;
3456 return WebCore::SmartClip(frame).dataForRect(rect).toString(); 3456 SmartClipData clipData = WebCore::SmartClip(frame).dataForRect(rect);
3457 *clipText = clipData.getClipData();
3458 *clipRect = clipData.getRect();
3457 } 3459 }
3458 3460
3459 void WebViewImpl::hidePopups() 3461 void WebViewImpl::hidePopups()
3460 { 3462 {
3461 hideSelectPopup(); 3463 hideSelectPopup();
3462 if (m_pagePopup) 3464 if (m_pagePopup)
3463 closePagePopup(m_pagePopup.get()); 3465 closePagePopup(m_pagePopup.get());
3464 } 3466 }
3465 3467
3466 void WebViewImpl::setIsTransparent(bool isTransparent) 3468 void WebViewImpl::setIsTransparent(bool isTransparent)
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
4086 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4088 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4087 4089
4088 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4090 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4089 return false; 4091 return false;
4090 4092
4091 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4093 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4092 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4094 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4093 } 4095 }
4094 4096
4095 } // namespace blink 4097 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebView.h » ('j') | public/web/WebView.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698