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

Side by Side Diff: chrome/browser/tabs/tab_strip_model.cc

Issue 14050: Fix for Issue 3258: Tabs created when tabstrip is compressed pending resize r... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years 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
« no previous file with comments | « no previous file | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/gfx/point.h" 7 #include "base/gfx/point.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/browser.h" 9 #include "chrome/browser/browser.h"
10 #include "chrome/browser/browser_about_handler.h" 10 #include "chrome/browser/browser_about_handler.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 526
527 bool TabStripModel::InternalCloseTabContentsAt(int index, 527 bool TabStripModel::InternalCloseTabContentsAt(int index,
528 bool create_historical_tab) { 528 bool create_historical_tab) {
529 TabContents* detached_contents = GetContentsAt(index); 529 TabContents* detached_contents = GetContentsAt(index);
530 530
531 if (TabHasUnloadListener(index)) { 531 if (TabHasUnloadListener(index)) {
532 // If the page has unload listeners, then we tell the renderer to fire 532 // If the page has unload listeners, then we tell the renderer to fire
533 // them. Once they have fired, we'll get a message back saying whether 533 // them. Once they have fired, we'll get a message back saying whether
534 // to proceed closing the page or not, which sends us back to this method 534 // to proceed closing the page or not, which sends us back to this method
535 // with the HasUnloadListener bit cleared. 535 // with the HasUnloadListener bit cleared.
536 WebContents* web_contents = GetContentsAt(index)->AsWebContents(); 536 WebContents* web_contents = detached_contents->AsWebContents();
537 // If we hit this code path, the tab had better be a WebContents tab. 537 // If we hit this code path, the tab had better be a WebContents tab.
538 DCHECK(web_contents); 538 DCHECK(web_contents);
539 web_contents->render_view_host()->FirePageBeforeUnload(); 539 web_contents->render_view_host()->FirePageBeforeUnload();
540 return false; 540 return false;
541 } 541 }
542 542
543 // TODO: Now that we know the tab has no unload/beforeunload listeners, 543 // TODO: Now that we know the tab has no unload/beforeunload listeners,
544 // we should be able to do a fast shutdown of the RenderViewProcess. 544 // we should be able to do a fast shutdown of the RenderViewProcess.
545 // Make sure that we actually do. 545 // Make sure that we actually do.
546 546
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } 603 }
604 604
605 // static 605 // static
606 bool TabStripModel::OpenerMatches(TabContentsData* data, 606 bool TabStripModel::OpenerMatches(TabContentsData* data,
607 NavigationController* opener, 607 NavigationController* opener,
608 bool use_group) { 608 bool use_group) {
609 return data->opener == opener || (use_group && data->group == opener); 609 return data->opener == opener || (use_group && data->group == opener);
610 } 610 }
611 611
612 612
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698