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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 160206: Fix focus bug when reloading crashed tab (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 } 1772 }
1773 1773
1774 void TabContents::RenderViewReady(RenderViewHost* rvh) { 1774 void TabContents::RenderViewReady(RenderViewHost* rvh) {
1775 if (rvh != render_view_host()) { 1775 if (rvh != render_view_host()) {
1776 // Don't notify the world, since this came from a renderer in the 1776 // Don't notify the world, since this came from a renderer in the
1777 // background. 1777 // background.
1778 return; 1778 return;
1779 } 1779 }
1780 1780
1781 NotifyConnected(); 1781 NotifyConnected();
1782 bool was_crashed = is_crashed();
1782 SetIsCrashed(false); 1783 SetIsCrashed(false);
1784
1785 // Restore the focus to the tab (otherwise the focus will be on the top
1786 // window).
1787 if (was_crashed && FocusLocationBarByDefault())
1788 Focus();
1783 } 1789 }
1784 1790
1785 void TabContents::RenderViewGone(RenderViewHost* rvh) { 1791 void TabContents::RenderViewGone(RenderViewHost* rvh) {
1786 // Ask the print preview if this renderer was valuable. 1792 // Ask the print preview if this renderer was valuable.
1787 if (!printing_.OnRenderViewGone(rvh)) 1793 if (!printing_.OnRenderViewGone(rvh))
1788 return; 1794 return;
1789 if (rvh != render_view_host()) { 1795 if (rvh != render_view_host()) {
1790 // The pending page's RenderViewHost is gone. 1796 // The pending page's RenderViewHost is gone.
1791 return; 1797 return;
1792 } 1798 }
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 NavigationController::LoadCommittedDetails& committed_details = 2381 NavigationController::LoadCommittedDetails& committed_details =
2376 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); 2382 *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
2377 ExpireInfoBars(committed_details); 2383 ExpireInfoBars(committed_details);
2378 break; 2384 break;
2379 } 2385 }
2380 2386
2381 default: 2387 default:
2382 NOTREACHED(); 2388 NOTREACHED();
2383 } 2389 }
2384 } 2390 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/views/tab_contents/tab_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698