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

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

Issue 141028: Focus the location bar on about:blank (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 | « chrome/browser/browser_focus_uitest.cc ('k') | no next file » | 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) 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 render_manager_.interstitial_page()->FocusThroughTabTraversal(reverse); 805 render_manager_.interstitial_page()->FocusThroughTabTraversal(reverse);
806 return; 806 return;
807 } 807 }
808 render_view_host()->SetInitialFocus(reverse); 808 render_view_host()->SetInitialFocus(reverse);
809 } 809 }
810 810
811 bool TabContents::FocusLocationBarByDefault() { 811 bool TabContents::FocusLocationBarByDefault() {
812 DOMUI* dom_ui = GetDOMUIForCurrentState(); 812 DOMUI* dom_ui = GetDOMUIForCurrentState();
813 if (dom_ui) 813 if (dom_ui)
814 return dom_ui->focus_location_bar_by_default(); 814 return dom_ui->focus_location_bar_by_default();
815 NavigationEntry* entry = controller_.GetActiveEntry();
816 if (entry && entry->url() == GURL("about:blank"))
817 return true;
815 return false; 818 return false;
816 } 819 }
817 820
818 void TabContents::AddInfoBar(InfoBarDelegate* delegate) { 821 void TabContents::AddInfoBar(InfoBarDelegate* delegate) {
819 // Look through the existing InfoBarDelegates we have for a match. If we've 822 // Look through the existing InfoBarDelegates we have for a match. If we've
820 // already got one that matches, then we don't add the new one. 823 // already got one that matches, then we don't add the new one.
821 for (int i = 0; i < infobar_delegate_count(); ++i) { 824 for (int i = 0; i < infobar_delegate_count(); ++i) {
822 if (GetInfoBarDelegateAt(i)->EqualsDelegate(delegate)) 825 if (GetInfoBarDelegateAt(i)->EqualsDelegate(delegate))
823 return; 826 return;
824 } 827 }
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 NavigationController::LoadCommittedDetails& committed_details = 2336 NavigationController::LoadCommittedDetails& committed_details =
2334 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); 2337 *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
2335 ExpireInfoBars(committed_details); 2338 ExpireInfoBars(committed_details);
2336 break; 2339 break;
2337 } 2340 }
2338 2341
2339 default: 2342 default:
2340 NOTREACHED(); 2343 NOTREACHED();
2341 } 2344 }
2342 } 2345 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698