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

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: changed according to review comments by eseidel Created 6 years, 6 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 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after
3403 if (!page()) 3403 if (!page())
3404 return; 3404 return;
3405 3405
3406 page()->contextMenuController().clearContextMenu(); 3406 page()->contextMenuController().clearContextMenu();
3407 m_contextMenuAllowed = true; 3407 m_contextMenuAllowed = true;
3408 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse dOrMainFrame())) 3408 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse dOrMainFrame()))
3409 focusedFrame->eventHandler().sendContextMenuEventForKey(); 3409 focusedFrame->eventHandler().sendContextMenuEventForKey();
3410 m_contextMenuAllowed = false; 3410 m_contextMenuAllowed = false;
3411 } 3411 }
3412 3412
3413 WebString WebViewImpl::getSmartClipData(WebRect rect) 3413 void WebViewImpl::getSmartClipData(WebRect rect, WebString* clipText, WebRect* c lipRect)
3414 { 3414 {
3415 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); 3415 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame());
3416 if (!frame) 3416 if (!frame)
3417 return WebString(); 3417 return;
3418 return WebCore::SmartClip(frame).dataForRect(rect).toString(); 3418 SmartClipData clipData = WebCore::SmartClip(frame).dataForRect(rect);
3419 *clipText = clipData.clipData();
3420 *clipRect = clipData.rect();
3419 } 3421 }
3420 3422
3421 void WebViewImpl::hidePopups() 3423 void WebViewImpl::hidePopups()
3422 { 3424 {
3423 hideSelectPopup(); 3425 hideSelectPopup();
3424 if (m_pagePopup) 3426 if (m_pagePopup)
3425 closePagePopup(m_pagePopup.get()); 3427 closePagePopup(m_pagePopup.get());
3426 } 3428 }
3427 3429
3428 void WebViewImpl::setIsTransparent(bool isTransparent) 3430 void WebViewImpl::setIsTransparent(bool isTransparent)
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
4047 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4049 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4048 4050
4049 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4051 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4050 return false; 4052 return false;
4051 4053
4052 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4054 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4053 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4055 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4054 } 4056 }
4055 4057
4056 } // namespace blink 4058 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698