Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/ui/views/tabs/base_tab_strip.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/ui/views/tabs/base_tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/base_tab_strip.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/ui/title_prefix_matcher.h" 8 #include "chrome/browser/ui/title_prefix_matcher.h"
9 #include "chrome/browser/ui/view_ids.h" 9 #include "chrome/browser/ui/view_ids.h"
10 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" 10 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // This function is not required (and indeed may crash!) for removes 87 // This function is not required (and indeed may crash!) for removes
88 // spawned by non-mouse closes and drag-detaches. 88 // spawned by non-mouse closes and drag-detaches.
89 return; 89 return;
90 } 90 }
91 91
92 #if defined(OS_WIN) 92 #if defined(OS_WIN)
93 views::Widget* widget = tabstrip_->GetWidget(); 93 views::Widget* widget = tabstrip_->GetWidget();
94 // This can be null during shutdown. See http://crbug.com/42737. 94 // This can be null during shutdown. See http://crbug.com/42737.
95 if (!widget) 95 if (!widget)
96 return; 96 return;
97
98 widget->ResetLastMouseMoveFlag();
99
97 // Force the close button (that slides under the mouse) to highlight by 100 // Force the close button (that slides under the mouse) to highlight by
98 // saying the mouse just moved, but sending the same coordinates. 101 // saying the mouse just moved, but sending the same coordinates.
99 DWORD pos = GetMessagePos(); 102 DWORD pos = GetMessagePos();
100 POINT cursor_point = {GET_X_LPARAM(pos), GET_Y_LPARAM(pos)}; 103 POINT cursor_point = {GET_X_LPARAM(pos), GET_Y_LPARAM(pos)};
101 MapWindowPoints(NULL, widget->GetNativeView(), &cursor_point, 1); 104 MapWindowPoints(NULL, widget->GetNativeView(), &cursor_point, 1);
102
103 static_cast<views::WidgetWin*>(widget)->ResetLastMouseMoveFlag();
104 // Return to message loop - otherwise we may disrupt some operation that's
105 // in progress.
106 SendMessage(widget->GetNativeView(), WM_MOUSEMOVE, 0, 105 SendMessage(widget->GetNativeView(), WM_MOUSEMOVE, 0,
107 MAKELPARAM(cursor_point.x, cursor_point.y)); 106 MAKELPARAM(cursor_point.x, cursor_point.y));
108 #else 107 #else
109 NOTIMPLEMENTED(); 108 NOTIMPLEMENTED();
110 #endif 109 #endif
111 } 110 }
112 111
113 BaseTabStrip* tabstrip_; 112 BaseTabStrip* tabstrip_;
114 BaseTab* tab_; 113 BaseTab* tab_;
115 114
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Animate the view back to its correct position. 593 // Animate the view back to its correct position.
595 GenerateIdealBounds(); 594 GenerateIdealBounds();
596 AnimateToIdealBounds(); 595 AnimateToIdealBounds();
597 } 596 }
598 bounds_animator_.AnimateViewTo(tab, ideal_bounds(TabIndexOfTab(tab))); 597 bounds_animator_.AnimateViewTo(tab, ideal_bounds(TabIndexOfTab(tab)));
599 // Install a delegate to reset the dragging state when done. We have to leave 598 // Install a delegate to reset the dragging state when done. We have to leave
600 // dragging true for the tab otherwise it'll draw beneath the new tab button. 599 // dragging true for the tab otherwise it'll draw beneath the new tab button.
601 bounds_animator_.SetAnimationDelegate( 600 bounds_animator_.SetAnimationDelegate(
602 tab, new ResetDraggingStateDelegate(tab), true); 601 tab, new ResetDraggingStateDelegate(tab), true);
603 } 602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698