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

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

Issue 530913003: Remove unnecessary codes (associated with save image feature) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebNavigationPolicy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 scaledPoint.scale(1 / pageScaleFactor(), 1 / pageScaleFactor()); 3311 scaledPoint.scale(1 / pageScaleFactor(), 1 / pageScaleFactor());
3312 return hitTestResultForWindowPos(scaledPoint); 3312 return hitTestResultForWindowPos(scaledPoint);
3313 } 3313 }
3314 3314
3315 void WebViewImpl::copyImageAt(const WebPoint& point) 3315 void WebViewImpl::copyImageAt(const WebPoint& point)
3316 { 3316 {
3317 if (!m_page) 3317 if (!m_page)
3318 return; 3318 return;
3319 3319
3320 HitTestResult result = hitTestResultForWindowPos(point); 3320 HitTestResult result = hitTestResultForWindowPos(point);
3321 Node* node = result.innerNonSharedNode();
3322 ASSERT(node);
3321 3323
3322 if (result.absoluteImageURLIncludingCanvasDataURL().isEmpty()) { 3324 if (!isHTMLCanvasElement(*node) && result.absoluteImageURL().isEmpty()) {
3323 // There isn't actually an image at these coordinates. Might be because 3325 // There isn't actually an image at these coordinates. Might be because
3324 // the window scrolled while the context menu was open or because the pa ge 3326 // the window scrolled while the context menu was open or because the pa ge
3325 // changed itself between when we thought there was an image here and wh en 3327 // changed itself between when we thought there was an image here and wh en
3326 // we actually tried to retreive the image. 3328 // we actually tried to retreive the image.
3327 // 3329 //
3328 // FIXME: implement a cache of the most recent HitTestResult to avoid ha ving 3330 // FIXME: implement a cache of the most recent HitTestResult to avoid ha ving
3329 // to do two hit tests. 3331 // to do two hit tests.
3330 return; 3332 return;
3331 } 3333 }
3332 3334
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4319 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4321 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4320 4322
4321 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4323 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4322 return false; 4324 return false;
4323 4325
4324 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4326 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4325 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4327 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4326 } 4328 }
4327 4329
4328 } // namespace blink 4330 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebNavigationPolicy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698