diff options
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 13 | ||||
-rw-r--r-- | chrome/views/custom_frame_window.cc | 10 | ||||
-rw-r--r-- | chrome/views/custom_frame_window.h | 3 |
3 files changed, 15 insertions, 11 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index 38ab339..df1cd2b 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -108,6 +108,9 @@ DraggedTabController::~DraggedTabController() { // bounds, it won't be able to clean up properly since its cleanup routine // uses GetIndexForDraggedContents, which will be invalid. view_.reset(NULL); + // Make sure the TabContents doesn't think we're still its delegate. + if (dragged_contents_ && dragged_contents_->delegate() == this) + dragged_contents_->set_delegate(NULL); ChangeDraggedContents(NULL); // This removes our observer. } @@ -290,17 +293,15 @@ gfx::Point DraggedTabController::GetWindowCreatePoint() const { void DraggedTabController::ChangeDraggedContents(TabContents* new_contents) { if (dragged_contents_) { - dragged_contents_->set_delegate(NULL); NotificationService::current()->RemoveObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source<TabContents>(dragged_contents_)); + NOTIFY_TAB_CONTENTS_DESTROYED, + Source<TabContents>(dragged_contents_)); } dragged_contents_ = new_contents; if (dragged_contents_) { - dragged_contents_->set_delegate(this); NotificationService::current()->AddObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source<TabContents>(dragged_contents_)); + NOTIFY_TAB_CONTENTS_DESTROYED, + Source<TabContents>(dragged_contents_)); } } diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index 3221e76..33df287 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -886,7 +886,8 @@ class NonClientViewLayout : public LayoutManager { CustomFrameWindow::CustomFrameWindow(WindowDelegate* window_delegate) : Window(window_delegate), is_active_(false), - lock_updates_(false) { + lock_updates_(false), + saved_window_style_(0) { InitClass(); non_client_view_ = new DefaultNonClientView(this); } @@ -1339,13 +1340,12 @@ void CustomFrameWindow::InitClass() { void CustomFrameWindow::LockUpdates() { lock_updates_ = true; - // This message causes invalidations to be discarded until it is called again - // with WPARAM TRUE (see UnlockUpdates). - SendMessage(GetHWND(), WM_SETREDRAW, FALSE, 0); + saved_window_style_ = GetWindowLong(GetHWND(), GWL_STYLE); + SetWindowLong(GetHWND(), GWL_STYLE, saved_window_style_ & ~WS_VISIBLE); } void CustomFrameWindow::UnlockUpdates() { - SendMessage(GetHWND(), WM_SETREDRAW, TRUE, 0); + SetWindowLong(GetHWND(), GWL_STYLE, saved_window_style_); lock_updates_ = false; } diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h index 0c2b7f9..85c6b2d 100644 --- a/chrome/views/custom_frame_window.h +++ b/chrome/views/custom_frame_window.h @@ -89,6 +89,9 @@ class CustomFrameWindow : public Window { // True if updates to this window are currently locked. bool lock_updates_; + // The window styles of the window before updates were locked. + DWORD saved_window_style_; + // Static resource initialization. static void InitClass(); enum ResizeCursor { |