OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 // layout will be performed based on a width of 0 pixels, causing a | 697 // layout will be performed based on a width of 0 pixels, causing a |
698 // very long, narrow, inaccurate layout. Because some scripts on pages (as | 698 // very long, narrow, inaccurate layout. Because some scripts on pages (as |
699 // well as WebKit's anchor link location calculation) are run on the | 699 // well as WebKit's anchor link location calculation) are run on the |
700 // initial layout and not recalculated later, we need to ensure the first | 700 // initial layout and not recalculated later, we need to ensure the first |
701 // layout is performed with sane view dimensions even when we're opening a | 701 // layout is performed with sane view dimensions even when we're opening a |
702 // new background tab. | 702 // new background tab. |
703 if (WebContents* old_contents = GetActiveWebContents()) { | 703 if (WebContents* old_contents = GetActiveWebContents()) { |
704 if ((add_types & ADD_ACTIVE) == 0) { | 704 if ((add_types & ADD_ACTIVE) == 0) { |
705 contents->GetView()->SizeContents( | 705 contents->GetView()->SizeContents( |
706 old_contents->GetView()->GetContainerSize()); | 706 old_contents->GetView()->GetContainerSize()); |
707 // We need to hide the contents or else we get and execute paints for | |
708 // background tabs. With enough background tabs they will steal the | |
709 // backing store of the visible tab causing flashing. See bug 20831. | |
Charlie Reis
2013/08/19 22:18:03
Maybe add 20831 to the BUG list of the CL? There
jamesr
2013/08/19 23:50:40
Done.
| |
710 contents->WasHidden(); | |
711 } | 707 } |
712 } | 708 } |
713 } | 709 } |
714 | 710 |
715 void TabStripModel::CloseSelectedTabs() { | 711 void TabStripModel::CloseSelectedTabs() { |
716 InternalCloseTabs(selection_model_.selected_indices(), | 712 InternalCloseTabs(selection_model_.selected_indices(), |
717 CLOSE_CREATE_HISTORICAL_TAB | CLOSE_USER_GESTURE); | 713 CLOSE_CREATE_HISTORICAL_TAB | CLOSE_USER_GESTURE); |
718 } | 714 } |
719 | 715 |
720 void TabStripModel::SelectNextTab() { | 716 void TabStripModel::SelectNextTab() { |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1285 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1281 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1286 const WebContents* tab) { | 1282 const WebContents* tab) { |
1287 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1283 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1288 i != contents_data_.end(); ++i) { | 1284 i != contents_data_.end(); ++i) { |
1289 if ((*i)->group == tab) | 1285 if ((*i)->group == tab) |
1290 (*i)->group = NULL; | 1286 (*i)->group = NULL; |
1291 if ((*i)->opener == tab) | 1287 if ((*i)->opener == tab) |
1292 (*i)->opener = NULL; | 1288 (*i)->opener = NULL; |
1293 } | 1289 } |
1294 } | 1290 } |
OLD | NEW |