OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
28 #include "content/child/npapi/plugin_instance.h" | 28 #include "content/child/npapi/plugin_instance.h" |
29 #include "content/child/npapi/plugin_lib.h" | 29 #include "content/child/npapi/plugin_lib.h" |
30 #include "content/child/npapi/webplugin.h" | 30 #include "content/child/npapi/webplugin.h" |
31 #include "content/child/npapi/webplugin_ime_win.h" | 31 #include "content/child/npapi/webplugin_ime_win.h" |
32 #include "content/common/cursors/webcursor.h" | 32 #include "content/common/cursors/webcursor.h" |
33 #include "content/common/plugin_constants_win.h" | 33 #include "content/common/plugin_constants_win.h" |
34 #include "content/public/common/content_constants.h" | 34 #include "content/public/common/content_constants.h" |
35 #include "skia/ext/platform_canvas.h" | 35 #include "skia/ext/platform_canvas.h" |
36 #include "third_party/WebKit/public/web/WebInputEvent.h" | 36 #include "third_party/WebKit/public/web/WebInputEvent.h" |
37 #include "ui/gfx/win/dpi.h" | 37 #include "ui/gfx/screen_win.h" |
38 #include "ui/gfx/win/hwnd_util.h" | 38 #include "ui/gfx/win/hwnd_util.h" |
39 | 39 |
40 using blink::WebKeyboardEvent; | 40 using blink::WebKeyboardEvent; |
41 using blink::WebInputEvent; | 41 using blink::WebInputEvent; |
42 using blink::WebMouseEvent; | 42 using blink::WebMouseEvent; |
43 | 43 |
44 namespace content { | 44 namespace content { |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 } | 756 } |
757 | 757 |
758 bool WebPluginDelegateImpl::WindowedReposition( | 758 bool WebPluginDelegateImpl::WindowedReposition( |
759 const gfx::Rect& window_rect_in_dip, | 759 const gfx::Rect& window_rect_in_dip, |
760 const gfx::Rect& clip_rect_in_dip) { | 760 const gfx::Rect& clip_rect_in_dip) { |
761 if (!windowed_handle_) { | 761 if (!windowed_handle_) { |
762 NOTREACHED(); | 762 NOTREACHED(); |
763 return false; | 763 return false; |
764 } | 764 } |
765 | 765 |
766 gfx::Rect window_rect = gfx::win::DIPToScreenRect(window_rect_in_dip); | 766 gfx::Rect window_rect = gfx::ScreenWin::DIPToScreenRect(windowed_handle_, |
767 gfx::Rect clip_rect = gfx::win::DIPToScreenRect(clip_rect_in_dip); | 767 window_rect_in_dip); |
| 768 gfx::Rect clip_rect = gfx::ScreenWin::DIPToScreenRect(windowed_handle_, |
| 769 clip_rect_in_dip); |
768 if (window_rect_ == window_rect && clip_rect_ == clip_rect) | 770 if (window_rect_ == window_rect && clip_rect_ == clip_rect) |
769 return false; | 771 return false; |
770 | 772 |
771 // We only set the plugin's size here. Its position is moved elsewhere, which | 773 // We only set the plugin's size here. Its position is moved elsewhere, which |
772 // allows the window moves/scrolling/clipping to be synchronized with the page | 774 // allows the window moves/scrolling/clipping to be synchronized with the page |
773 // and other windows. | 775 // and other windows. |
774 // If the plugin window has no parent, then don't focus it because it isn't | 776 // If the plugin window has no parent, then don't focus it because it isn't |
775 // being displayed anywhere. See: | 777 // being displayed anywhere. See: |
776 // http://code.google.com/p/chromium/issues/detail?id=32658 | 778 // http://code.google.com/p/chromium/issues/detail?id=32658 |
777 if (window_rect.size() != window_rect_.size()) { | 779 if (window_rect.size() != window_rect_.size()) { |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 case WM_RBUTTONUP: | 1489 case WM_RBUTTONUP: |
1488 ::ReleaseCapture(); | 1490 ::ReleaseCapture(); |
1489 break; | 1491 break; |
1490 | 1492 |
1491 default: | 1493 default: |
1492 break; | 1494 break; |
1493 } | 1495 } |
1494 } | 1496 } |
1495 | 1497 |
1496 } // namespace content | 1498 } // namespace content |
OLD | NEW |