| 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/browser/tab_contents/tab_contents_view_win.h" | 5 #include "content/browser/tab_contents/tab_contents_view_win.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/renderer_host/render_view_host_factory.h" | 8 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 11 #include "content/browser/tab_contents/interstitial_page_impl.h" | 11 #include "content/browser/tab_contents/interstitial_page_impl.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "content/browser/tab_contents/web_contents_drag_win.h" | 13 #include "content/browser/tab_contents/web_contents_drag_win.h" |
| 14 #include "content/browser/tab_contents/web_drag_dest_win.h" | 14 #include "content/browser/tab_contents/web_drag_dest_win.h" |
| 15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 16 #include "content/public/browser/web_contents_view_win_delegate.h" | 16 #include "content/public/browser/web_contents_view_delegate.h" |
| 17 #include "ui/gfx/screen.h" | 17 #include "ui/gfx/screen.h" |
| 18 | 18 |
| 19 using content::RenderViewHost; | 19 using content::RenderViewHost; |
| 20 using content::RenderWidgetHostView; | 20 using content::RenderWidgetHostView; |
| 21 using content::WebContents; | 21 using content::WebContents; |
| 22 using content::WebContentsViewWinDelegate; | 22 using content::WebContentsViewDelegate; |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // We need to have a parent window for the compositing code to work correctly. | 26 // We need to have a parent window for the compositing code to work correctly. |
| 27 // | 27 // |
| 28 // A tab will not have a parent HWND whenever it is not active in its | 28 // A tab will not have a parent HWND whenever it is not active in its |
| 29 // host window - for example at creation time and when it's in the | 29 // host window - for example at creation time and when it's in the |
| 30 // background, so we provide a default widget to host them. | 30 // background, so we provide a default widget to host them. |
| 31 // | 31 // |
| 32 // It may be tempting to use GetDesktopWindow() instead, but this is | 32 // It may be tempting to use GetDesktopWindow() instead, but this is |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 BEGIN_MSG_MAP_EX(TabContentsViewWin) | 53 BEGIN_MSG_MAP_EX(TabContentsViewWin) |
| 54 END_MSG_MAP() | 54 END_MSG_MAP() |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace namespace | 57 } // namespace namespace |
| 58 | 58 |
| 59 TabContentsViewWin::TabContentsViewWin(WebContents* web_contents, | 59 TabContentsViewWin::TabContentsViewWin(WebContents* web_contents, |
| 60 WebContentsViewWinDelegate* delegate) | 60 WebContentsViewDelegate* delegate) |
| 61 : tab_contents_(static_cast<TabContents*>(web_contents)), | 61 : tab_contents_(static_cast<TabContents*>(web_contents)), |
| 62 view_(NULL), | 62 view_(NULL), |
| 63 delegate_(delegate), | 63 delegate_(delegate), |
| 64 close_tab_after_drag_ends_(false) { | 64 close_tab_after_drag_ends_(false) { |
| 65 } | 65 } |
| 66 | 66 |
| 67 TabContentsViewWin::~TabContentsViewWin() { | 67 TabContentsViewWin::~TabContentsViewWin() { |
| 68 if (IsWindow(hwnd())) | 68 if (IsWindow(hwnd())) |
| 69 DestroyWindow(hwnd()); | 69 DestroyWindow(hwnd()); |
| 70 } | 70 } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 si.nMin = 1; | 470 si.nMin = 1; |
| 471 si.nMax = 100; | 471 si.nMax = 100; |
| 472 si.nPage = 10; | 472 si.nPage = 10; |
| 473 si.nPos = 50; | 473 si.nPos = 50; |
| 474 | 474 |
| 475 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); | 475 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); |
| 476 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); | 476 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); |
| 477 | 477 |
| 478 return 1; | 478 return 1; |
| 479 } | 479 } |
| OLD | NEW |