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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2541423003: Fix context menu "Copy image" not working sometimes at hidpi. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 } 1911 }
1912 1912
1913 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) { 1913 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) {
1914 if (!frame_->hasSelection()) 1914 if (!frame_->hasSelection())
1915 return; 1915 return;
1916 1916
1917 frame_->replaceMisspelledRange(text); 1917 frame_->replaceMisspelledRange(text);
1918 } 1918 }
1919 1919
1920 void RenderFrameImpl::OnCopyImageAt(int x, int y) { 1920 void RenderFrameImpl::OnCopyImageAt(int x, int y) {
1921 frame_->copyImageAt(WebPoint(x, y)); 1921 blink::WebFloatRect viewport_position(x, y, 0, 0);
1922 GetRenderWidget()->convertWindowToViewport(&viewport_position);
1923 frame_->copyImageAt(WebPoint(viewport_position.x, viewport_position.y));
1922 } 1924 }
1923 1925
1924 void RenderFrameImpl::OnSaveImageAt(int x, int y) { 1926 void RenderFrameImpl::OnSaveImageAt(int x, int y) {
1925 frame_->saveImageAt(WebPoint(x, y)); 1927 blink::WebFloatRect viewport_position(x, y, 0, 0);
1928 GetRenderWidget()->convertWindowToViewport(&viewport_position);
1929 frame_->saveImageAt(WebPoint(viewport_position.x, viewport_position.y));
1926 } 1930 }
1927 1931
1928 void RenderFrameImpl::OnAddMessageToConsole(ConsoleMessageLevel level, 1932 void RenderFrameImpl::OnAddMessageToConsole(ConsoleMessageLevel level,
1929 const std::string& message) { 1933 const std::string& message) {
1930 AddMessageToConsole(level, message); 1934 AddMessageToConsole(level, message);
1931 } 1935 }
1932 1936
1933 void RenderFrameImpl::OnJavaScriptExecuteRequest( 1937 void RenderFrameImpl::OnJavaScriptExecuteRequest(
1934 const base::string16& jscript, 1938 const base::string16& jscript,
1935 int id, 1939 int id,
(...skipping 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after
6671 // event target. Potentially a Pepper plugin will receive the event. 6675 // event target. Potentially a Pepper plugin will receive the event.
6672 // In order to tell whether a plugin gets the last mouse event and which it 6676 // In order to tell whether a plugin gets the last mouse event and which it
6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6677 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6678 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6675 // |pepper_last_mouse_event_target_|. 6679 // |pepper_last_mouse_event_target_|.
6676 pepper_last_mouse_event_target_ = nullptr; 6680 pepper_last_mouse_event_target_ = nullptr;
6677 #endif 6681 #endif
6678 } 6682 }
6679 6683
6680 } // namespace content 6684 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698