| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/web_contents_view_win.h" | 5 #include "chrome/browser/tab_contents/web_contents_view_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/download/download_request_manager.h" | 12 #include "chrome/browser/download/download_request_manager.h" |
| 13 #include "chrome/browser/renderer_host/render_process_host.h" | 13 #include "chrome/browser/renderer_host/render_process_host.h" |
| 14 #include "chrome/browser/renderer_host/render_view_host.h" | 14 #include "chrome/browser/renderer_host/render_view_host.h" |
| 15 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" | 15 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 16 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 16 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 17 #include "chrome/browser/tab_contents/render_view_context_menu_controller.h" | 17 #include "chrome/browser/tab_contents/render_view_context_menu_controller.h" |
| 18 #include "chrome/browser/tab_contents/interstitial_page.h" | 18 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 19 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 19 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 20 #include "chrome/browser/tab_contents/web_contents.h" | 20 #include "chrome/browser/tab_contents/web_contents.h" |
| 21 #include "chrome/browser/tab_contents/web_drag_source.h" | 21 #include "chrome/browser/tab_contents/web_drag_source.h" |
| 22 #include "chrome/browser/tab_contents/web_drop_target.h" | 22 #include "chrome/browser/tab_contents/web_drop_target.h" |
| 23 #include "chrome/browser/views/find_bar_win.h" | 23 #include "chrome/browser/views/find_bar_win.h" |
| 24 #include "chrome/browser/views/sad_tab_view.h" | 24 #include "chrome/browser/views/sad_tab_view.h" |
| 25 #include "chrome/common/gfx/chrome_canvas.h" | 25 #include "chrome/common/gfx/chrome_canvas.h" |
| 26 #include "chrome/common/os_exchange_data.h" | 26 #include "chrome/common/os_exchange_data.h" |
| 27 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| 28 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 28 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 29 #include "webkit/glue/webdropdata.h" |
| 30 #include "webkit/glue/webinputevent.h" |
| 29 | 31 |
| 30 namespace { | 32 namespace { |
| 31 | 33 |
| 32 // Windows callback for OnDestroy to detach the plugin windows. | 34 // Windows callback for OnDestroy to detach the plugin windows. |
| 33 BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) { | 35 BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) { |
| 34 if (WebPluginDelegateImpl::IsPluginDelegateWindow(window)) { | 36 if (WebPluginDelegateImpl::IsPluginDelegateWindow(window)) { |
| 35 ::ShowWindow(window, SW_HIDE); | 37 ::ShowWindow(window, SW_HIDE); |
| 36 SetParent(window, NULL); | 38 SetParent(window, NULL); |
| 37 } | 39 } |
| 38 return TRUE; | 40 return TRUE; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 int number_of_matches, | 329 int number_of_matches, |
| 328 const gfx::Rect& selection_rect, | 330 const gfx::Rect& selection_rect, |
| 329 int active_match_ordinal, | 331 int active_match_ordinal, |
| 330 bool final_update) { | 332 bool final_update) { |
| 331 if (find_bar_.get()) { | 333 if (find_bar_.get()) { |
| 332 find_bar_->OnFindReply(request_id, number_of_matches, selection_rect, | 334 find_bar_->OnFindReply(request_id, number_of_matches, selection_rect, |
| 333 active_match_ordinal, final_update); | 335 active_match_ordinal, final_update); |
| 334 } | 336 } |
| 335 } | 337 } |
| 336 | 338 |
| 337 void WebContentsViewWin::ShowContextMenu( | 339 void WebContentsViewWin::ShowContextMenu(const ContextMenuParams& params) { |
| 338 const ViewHostMsg_ContextMenu_Params& params) { | |
| 339 RenderViewContextMenuController menu_controller(web_contents_, params); | 340 RenderViewContextMenuController menu_controller(web_contents_, params); |
| 340 RenderViewContextMenu menu(&menu_controller, | 341 RenderViewContextMenu menu(&menu_controller, |
| 341 GetHWND(), | 342 GetHWND(), |
| 342 params.node, | 343 params.node, |
| 343 params.misspelled_word, | 344 params.misspelled_word, |
| 344 params.dictionary_suggestions, | 345 params.dictionary_suggestions, |
| 345 web_contents_->profile()); | 346 web_contents_->profile()); |
| 346 | 347 |
| 347 POINT screen_pt = { params.x, params.y }; | 348 POINT screen_pt = { params.x, params.y }; |
| 348 MapWindowPoints(GetHWND(), HWND_DESKTOP, &screen_pt, 1); | 349 MapWindowPoints(GetHWND(), HWND_DESKTOP, &screen_pt, 1); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 } | 671 } |
| 671 return false; | 672 return false; |
| 672 } | 673 } |
| 673 | 674 |
| 674 void WebContentsViewWin::WheelZoom(int distance) { | 675 void WebContentsViewWin::WheelZoom(int distance) { |
| 675 if (web_contents_->delegate()) { | 676 if (web_contents_->delegate()) { |
| 676 bool zoom_in = distance > 0; | 677 bool zoom_in = distance > 0; |
| 677 web_contents_->delegate()->ContentsZoomChange(zoom_in); | 678 web_contents_->delegate()->ContentsZoomChange(zoom_in); |
| 678 } | 679 } |
| 679 } | 680 } |
| OLD | NEW |