| 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/views/hwnd_view.h" | 5 #include "chrome/views/hwnd_view.h" |
| 6 | 6 |
| 7 #include "chrome/common/gfx/chrome_canvas.h" | 7 #include "chrome/common/gfx/chrome_canvas.h" |
| 8 #include "chrome/common/win_util.h" | 8 #include "chrome/common/win_util.h" |
| 9 #include "chrome/views/focus_manager.h" | 9 #include "chrome/views/focus_manager.h" |
| 10 #include "chrome/views/scroll_view.h" | 10 #include "chrome/views/scroll_view.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // know when the position of any ancestor changes, or our visibility relative | 24 // know when the position of any ancestor changes, or our visibility relative |
| 25 // to other views changed as it'll effect our position relative to the root. | 25 // to other views changed as it'll effect our position relative to the root. |
| 26 SetNotifyWhenVisibleBoundsInRootChanges(true); | 26 SetNotifyWhenVisibleBoundsInRootChanges(true); |
| 27 } | 27 } |
| 28 | 28 |
| 29 HWNDView::~HWNDView() { | 29 HWNDView::~HWNDView() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void HWNDView::Attach(HWND hwnd) { | 32 void HWNDView::Attach(HWND hwnd) { |
| 33 DCHECK(hwnd_ == NULL); | 33 DCHECK(hwnd_ == NULL); |
| 34 DCHECK(hwnd) << "Impossible detatched tab case; See crbug.com/6316"; |
| 35 |
| 34 hwnd_ = hwnd; | 36 hwnd_ = hwnd; |
| 35 | 37 |
| 36 // First hide the new window. We don't want anything to draw (like sub-hwnd | 38 // First hide the new window. We don't want anything to draw (like sub-hwnd |
| 37 // borders), when we change the parent below. | 39 // borders), when we change the parent below. |
| 38 ShowWindow(hwnd_, SW_HIDE); | 40 ShowWindow(hwnd_, SW_HIDE); |
| 39 | 41 |
| 40 // Need to set the HWND's parent before changing its size to avoid flashing. | 42 // Need to set the HWND's parent before changing its size to avoid flashing. |
| 41 ::SetParent(hwnd_, GetWidget()->GetHWND()); | 43 ::SetParent(hwnd_, GetWidget()->GetHWND()); |
| 42 UpdateHWNDBounds(); | 44 UpdateHWNDBounds(); |
| 43 | 45 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 if (installed_clip_) | 186 if (installed_clip_) |
| 185 canvas->FillRectInt(SkColorSetRGB(255, 255, 255), 0, 0, width(), height()); | 187 canvas->FillRectInt(SkColorSetRGB(255, 255, 255), 0, 0, width(), height()); |
| 186 } | 188 } |
| 187 | 189 |
| 188 std::string HWNDView::GetClassName() const { | 190 std::string HWNDView::GetClassName() const { |
| 189 return kViewClassName; | 191 return kViewClassName; |
| 190 } | 192 } |
| 191 | 193 |
| 192 } // namespace views | 194 } // namespace views |
| 193 | 195 |
| OLD | NEW |