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/browser/views/tabs/tab_strip.h" | 5 #include "chrome/browser/views/tabs/tab_strip.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/gfx/canvas.h" | 8 #include "app/gfx/canvas.h" |
9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 | 732 |
733 | 733 |
734 /////////////////////////////////////////////////////////////////////////////// | 734 /////////////////////////////////////////////////////////////////////////////// |
735 // TabStrip, TabStripModelObserver implementation: | 735 // TabStrip, TabStripModelObserver implementation: |
736 | 736 |
737 void TabStrip::TabInsertedAt(TabContents* contents, | 737 void TabStrip::TabInsertedAt(TabContents* contents, |
738 int index, | 738 int index, |
739 bool foreground) { | 739 bool foreground) { |
740 DCHECK(contents); | 740 DCHECK(contents); |
741 DCHECK(index == TabStripModel::kNoTab || model_->ContainsIndex(index)); | 741 DCHECK(index == TabStripModel::kNoTab || model_->ContainsIndex(index)); |
742 | 742 // This tab may be attached to another browser window, we should notify |
| 743 // renderer. |
| 744 contents->render_view_host()->UpdateBrowserWindowId( |
| 745 contents->controller().window_id().id()); |
743 if (active_animation_.get()) | 746 if (active_animation_.get()) |
744 active_animation_->Stop(); | 747 active_animation_->Stop(); |
745 | 748 |
746 bool contains_tab = false; | 749 bool contains_tab = false; |
747 Tab* tab = NULL; | 750 Tab* tab = NULL; |
748 // First see if this Tab is one that was dragged out of this TabStrip and is | 751 // First see if this Tab is one that was dragged out of this TabStrip and is |
749 // now being dragged back in. In this case, the DraggedTabController actually | 752 // now being dragged back in. In this case, the DraggedTabController actually |
750 // has the Tab already constructed and we can just insert it into our list | 753 // has the Tab already constructed and we can just insert it into our list |
751 // again. | 754 // again. |
752 if (IsDragSessionActive()) { | 755 if (IsDragSessionActive()) { |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 &TabStrip::ResizeLayoutTabs), | 1636 &TabStrip::ResizeLayoutTabs), |
1634 kResizeTabsTimeMs); | 1637 kResizeTabsTimeMs); |
1635 } | 1638 } |
1636 } else { | 1639 } else { |
1637 // Mouse moved quickly out of the tab strip and then into it again, so | 1640 // Mouse moved quickly out of the tab strip and then into it again, so |
1638 // cancel the timer so that the strip doesn't move when the mouse moves | 1641 // cancel the timer so that the strip doesn't move when the mouse moves |
1639 // back over it. | 1642 // back over it. |
1640 resize_layout_factory_.RevokeAll(); | 1643 resize_layout_factory_.RevokeAll(); |
1641 } | 1644 } |
1642 } | 1645 } |
OLD | NEW |