| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_view_host.h" | 7 #include "content/browser/renderer_host/render_view_host.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 9 #include "content/browser/tab_contents/interstitial_page.h" | 9 #include "content/browser/tab_contents/interstitial_page.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 POINT point = { r.left, r.top }; | 67 POINT point = { r.left, r.top }; |
| 68 ClientToScreen(hwnd(), &point); | 68 ClientToScreen(hwnd(), &point); |
| 69 *out = gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top); | 69 *out = gfx::Rect(point.x, point.y, r.right - r.left, r.bottom - r.top); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void TabContentsViewWin::SetPageTitle(const std::wstring& title) { | 72 void TabContentsViewWin::SetPageTitle(const std::wstring& title) { |
| 73 } | 73 } |
| 74 | 74 |
| 75 void TabContentsViewWin::OnTabCrashed(base::TerminationStatus status, | 75 void TabContentsViewWin::OnTabCrashed(base::TerminationStatus status, |
| 76 int error_code) { | 76 int error_code) { |
| 77 view_ = NULL; |
| 77 } | 78 } |
| 78 | 79 |
| 79 void TabContentsViewWin::SizeContents(const gfx::Size& size) { | 80 void TabContentsViewWin::SizeContents(const gfx::Size& size) { |
| 80 gfx::Rect bounds; | 81 gfx::Rect bounds; |
| 81 GetContainerBounds(&bounds); | 82 GetContainerBounds(&bounds); |
| 82 if (bounds.size() != size) { | 83 if (bounds.size() != size) { |
| 83 SetWindowPos(hwnd(), NULL, 0, 0, size.width(), size.height(), | 84 SetWindowPos(hwnd(), NULL, 0, 0, size.width(), size.height(), |
| 84 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE); | 85 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE); |
| 85 } else { | 86 } else { |
| 86 // Our size matches what we want but the renderers size may not match. | 87 // Our size matches what we want but the renderers size may not match. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 234 |
| 234 gfx::Size size(window_pos->cx, window_pos->cy); | 235 gfx::Size size(window_pos->cx, window_pos->cy); |
| 235 if (tab_contents_->interstitial_page()) | 236 if (tab_contents_->interstitial_page()) |
| 236 tab_contents_->interstitial_page()->SetSize(size); | 237 tab_contents_->interstitial_page()->SetSize(size); |
| 237 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); | 238 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); |
| 238 if (rwhv) | 239 if (rwhv) |
| 239 rwhv->SetSize(size); | 240 rwhv->SetSize(size); |
| 240 | 241 |
| 241 return 0; | 242 return 0; |
| 242 } | 243 } |
| OLD | NEW |