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

Side by Side Diff: chrome/browser/browser.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
« no previous file with comments | « no previous file | chrome/browser/browser_focus_uitest.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-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/idle_timer.h" 10 #include "base/idle_timer.h"
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 TabContents* current_tab = GetSelectedTabContents(); 729 TabContents* current_tab = GetSelectedTabContents();
730 if (current_tab) { 730 if (current_tab) {
731 if (current_tab->showing_interstitial_page()) { 731 if (current_tab->showing_interstitial_page()) {
732 NavigationEntry* entry = current_tab->controller().GetActiveEntry(); 732 NavigationEntry* entry = current_tab->controller().GetActiveEntry();
733 DCHECK(entry); // Should exist if interstitial is showing. 733 DCHECK(entry); // Should exist if interstitial is showing.
734 OpenURL(entry->url(), GURL(), CURRENT_TAB, PageTransition::RELOAD); 734 OpenURL(entry->url(), GURL(), CURRENT_TAB, PageTransition::RELOAD);
735 return; 735 return;
736 } 736 }
737 737
738 // As this is caused by a user action, give the focus to the page. 738 // As this is caused by a user action, give the focus to the page.
739 current_tab->Focus(); 739 if (!current_tab->FocusLocationBarByDefault())
740 current_tab->Focus();
740 current_tab->controller().Reload(true); 741 current_tab->controller().Reload(true);
741 } 742 }
742 } 743 }
743 744
744 void Browser::Home(WindowOpenDisposition disposition) { 745 void Browser::Home(WindowOpenDisposition disposition) {
745 UserMetrics::RecordAction(L"Home", profile_); 746 UserMetrics::RecordAction(L"Home", profile_);
746 OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK); 747 OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK);
747 } 748 }
748 749
749 void Browser::OpenCurrentURL() { 750 void Browser::OpenCurrentURL() {
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after
2776 /////////////////////////////////////////////////////////////////////////////// 2777 ///////////////////////////////////////////////////////////////////////////////
2777 // BrowserToolbarModel (private): 2778 // BrowserToolbarModel (private):
2778 2779
2779 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2780 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2780 // This |current_tab| can be NULL during the initialization of the 2781 // This |current_tab| can be NULL during the initialization of the
2781 // toolbar during window creation (i.e. before any tabs have been added 2782 // toolbar during window creation (i.e. before any tabs have been added
2782 // to the window). 2783 // to the window).
2783 TabContents* current_tab = browser_->GetSelectedTabContents(); 2784 TabContents* current_tab = browser_->GetSelectedTabContents();
2784 return current_tab ? &current_tab->controller() : NULL; 2785 return current_tab ? &current_tab->controller() : NULL;
2785 } 2786 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698