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. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Since we create these windows parented to the desktop window initially, we | 57 // Since we create these windows parented to the desktop window initially, we |
58 // don't want to create them initially visible. | 58 // don't want to create them initially visible. |
59 set_window_style(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); | 59 set_window_style(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); |
60 WidgetWin::Init(GetDesktopWindow(), gfx::Rect(), false); | 60 WidgetWin::Init(GetDesktopWindow(), gfx::Rect(), false); |
61 | 61 |
62 // Remove the root view drop target so we can register our own. | 62 // Remove the root view drop target so we can register our own. |
63 RevokeDragDrop(GetHWND()); | 63 RevokeDragDrop(GetHWND()); |
64 drop_target_ = new WebDropTarget(GetHWND(), web_contents_); | 64 drop_target_ = new WebDropTarget(GetHWND(), web_contents_); |
65 } | 65 } |
66 | 66 |
67 RenderWidgetHostViewWin* WebContentsViewWin::CreateViewForWidget( | 67 RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget( |
68 RenderWidgetHost* render_widget_host) { | 68 RenderWidgetHost* render_widget_host) { |
69 DCHECK(!render_widget_host->view()); | 69 DCHECK(!render_widget_host->view()); |
70 RenderWidgetHostViewWin* view = | 70 RenderWidgetHostViewWin* view = |
71 new RenderWidgetHostViewWin(render_widget_host); | 71 new RenderWidgetHostViewWin(render_widget_host); |
72 view->Create(GetHWND()); | 72 view->Create(GetHWND()); |
73 view->ShowWindow(SW_SHOW); | 73 view->ShowWindow(SW_SHOW); |
74 return view; | 74 return view; |
75 } | 75 } |
76 | 76 |
77 gfx::NativeView WebContentsViewWin::GetNativeView() const { | 77 gfx::NativeView WebContentsViewWin::GetNativeView() const { |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 } | 665 } |
666 return false; | 666 return false; |
667 } | 667 } |
668 | 668 |
669 void WebContentsViewWin::WheelZoom(int distance) { | 669 void WebContentsViewWin::WheelZoom(int distance) { |
670 if (web_contents_->delegate()) { | 670 if (web_contents_->delegate()) { |
671 bool zoom_in = distance > 0; | 671 bool zoom_in = distance > 0; |
672 web_contents_->delegate()->ContentsZoomChange(zoom_in); | 672 web_contents_->delegate()->ContentsZoomChange(zoom_in); |
673 } | 673 } |
674 } | 674 } |
OLD | NEW |