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