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 "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/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" | 9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" |
10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" | 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // a mouse moved event at the current mouse position. This tickles the Tab | 82 // a mouse moved event at the current mouse position. This tickles the Tab |
83 // the mouse is currently over to show the "hot" state of the close button. | 83 // the mouse is currently over to show the "hot" state of the close button. |
84 void HighlightCloseButton() { | 84 void HighlightCloseButton() { |
85 if (tabstrip_->IsDragSessionActive() || | 85 if (tabstrip_->IsDragSessionActive() || |
86 !tabstrip_->ShouldHighlightCloseButtonAfterRemove()) { | 86 !tabstrip_->ShouldHighlightCloseButtonAfterRemove()) { |
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) && !defined(USE_AURA) |
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 | 97 |
98 widget->ResetLastMouseMoveFlag(); | 98 widget->ResetLastMouseMoveFlag(); |
99 | 99 |
100 // 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 |
101 // saying the mouse just moved, but sending the same coordinates. | 101 // saying the mouse just moved, but sending the same coordinates. |
102 DWORD pos = GetMessagePos(); | 102 DWORD pos = GetMessagePos(); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 // Animate the view back to its correct position. | 579 // Animate the view back to its correct position. |
580 GenerateIdealBounds(); | 580 GenerateIdealBounds(); |
581 AnimateToIdealBounds(); | 581 AnimateToIdealBounds(); |
582 } | 582 } |
583 bounds_animator_.AnimateViewTo(tab, ideal_bounds(TabIndexOfTab(tab))); | 583 bounds_animator_.AnimateViewTo(tab, ideal_bounds(TabIndexOfTab(tab))); |
584 // Install a delegate to reset the dragging state when done. We have to leave | 584 // Install a delegate to reset the dragging state when done. We have to leave |
585 // dragging true for the tab otherwise it'll draw beneath the new tab button. | 585 // dragging true for the tab otherwise it'll draw beneath the new tab button. |
586 bounds_animator_.SetAnimationDelegate( | 586 bounds_animator_.SetAnimationDelegate( |
587 tab, new ResetDraggingStateDelegate(tab), true); | 587 tab, new ResetDraggingStateDelegate(tab), true); |
588 } | 588 } |
OLD | NEW |