| 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/dom_ui/dom_ui_host.h" | 12 #include "chrome/browser/dom_ui/dom_ui_host.h" |
| 13 #include "chrome/browser/download/download_request_manager.h" | 13 #include "chrome/browser/download/download_request_manager.h" |
| 14 #include "chrome/browser/renderer_host/render_process_host.h" | 14 #include "chrome/browser/renderer_host/render_process_host.h" |
| 15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" |
| 16 #include "chrome/browser/renderer_host/render_view_host_factory.h" |
| 16 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" | 17 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 17 #include "chrome/browser/tab_contents/render_view_context_menu_win.h" | 18 #include "chrome/browser/tab_contents/render_view_context_menu_win.h" |
| 18 #include "chrome/browser/tab_contents/interstitial_page.h" | 19 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 19 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 20 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 20 #include "chrome/browser/tab_contents/web_contents.h" | 21 #include "chrome/browser/tab_contents/web_contents.h" |
| 21 #include "chrome/browser/tab_contents/web_drag_source.h" | 22 #include "chrome/browser/tab_contents/web_drag_source.h" |
| 22 #include "chrome/browser/tab_contents/web_drop_target.h" | 23 #include "chrome/browser/tab_contents/web_drop_target.h" |
| 23 #include "chrome/browser/views/sad_tab_view.h" | 24 #include "chrome/browser/views/sad_tab_view.h" |
| 24 #include "chrome/common/gfx/chrome_canvas.h" | 25 #include "chrome/common/gfx/chrome_canvas.h" |
| 25 #include "chrome/common/os_exchange_data.h" | 26 #include "chrome/common/os_exchange_data.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 82 } |
| 82 | 83 |
| 83 RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( | 84 RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( |
| 84 RenderWidgetHost* render_widget_host) { | 85 RenderWidgetHost* render_widget_host) { |
| 85 if (render_widget_host->view()) { | 86 if (render_widget_host->view()) { |
| 86 // During testing, the view will already be set up in most cases to the | 87 // During testing, the view will already be set up in most cases to the |
| 87 // test view, so we don't want to clobber it with a real one. To verify that | 88 // test view, so we don't want to clobber it with a real one. To verify that |
| 88 // this actually is happening (and somebody isn't accidentally creating the | 89 // this actually is happening (and somebody isn't accidentally creating the |
| 89 // view twice), we check for the RVH Factory, which will be set when we're | 90 // view twice), we check for the RVH Factory, which will be set when we're |
| 90 // making special ones (which go along with the special views). | 91 // making special ones (which go along with the special views). |
| 91 DCHECK(web_contents()->render_manager()->has_render_view_host_factory()); | 92 DCHECK(RenderViewHostFactory::has_factory()); |
| 92 return render_widget_host->view(); | 93 return render_widget_host->view(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 RenderWidgetHostViewWin* view = | 96 RenderWidgetHostViewWin* view = |
| 96 new RenderWidgetHostViewWin(render_widget_host); | 97 new RenderWidgetHostViewWin(render_widget_host); |
| 97 view->Create(GetNativeView()); | 98 view->Create(GetNativeView()); |
| 98 view->ShowWindow(SW_SHOW); | 99 view->ShowWindow(SW_SHOW); |
| 99 return view; | 100 return view; |
| 100 } | 101 } |
| 101 | 102 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 } | 591 } |
| 591 return false; | 592 return false; |
| 592 } | 593 } |
| 593 | 594 |
| 594 void WebContentsViewWin::WheelZoom(int distance) { | 595 void WebContentsViewWin::WheelZoom(int distance) { |
| 595 if (web_contents()->delegate()) { | 596 if (web_contents()->delegate()) { |
| 596 bool zoom_in = distance > 0; | 597 bool zoom_in = distance > 0; |
| 597 web_contents()->delegate()->ContentsZoomChange(zoom_in); | 598 web_contents()->delegate()->ContentsZoomChange(zoom_in); |
| 598 } | 599 } |
| 599 } | 600 } |
| OLD | NEW |