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/ui/browser.cc

Issue 12390042: Fix focus for in-tab navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 9 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
« no previous file with comments | « no previous file | 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 931
932 // Update the location bar. This is synchronous. We specifically don't 932 // Update the location bar. This is synchronous. We specifically don't
933 // update the load state since the load hasn't started yet and updating it 933 // update the load state since the load hasn't started yet and updating it
934 // will put it out of sync with the actual state like whether we're 934 // will put it out of sync with the actual state like whether we're
935 // displaying a favicon, which controls the throbber. If we updated it here, 935 // displaying a favicon, which controls the throbber. If we updated it here,
936 // the throbber will show the default favicon for a split second when 936 // the throbber will show the default favicon for a split second when
937 // navigating away from the new tab page. 937 // navigating away from the new tab page.
938 ScheduleUIUpdate(contents, content::INVALIDATE_TYPE_URL); 938 ScheduleUIUpdate(contents, content::INVALIDATE_TYPE_URL);
939 939
940 if (contents_is_selected) 940 if (contents_is_selected)
941 contents->GetView()->Focus(); 941 contents->GetView()->SetInitialFocus();
942 } 942 }
943 943
944 /////////////////////////////////////////////////////////////////////////////// 944 ///////////////////////////////////////////////////////////////////////////////
945 // Browser, PageNavigator implementation: 945 // Browser, PageNavigator implementation:
946 946
947 WebContents* Browser::OpenURL(const OpenURLParams& params) { 947 WebContents* Browser::OpenURL(const OpenURLParams& params) {
948 return OpenURLFromTab(NULL, params); 948 return OpenURLFromTab(NULL, params);
949 } 949 }
950 950
951 /////////////////////////////////////////////////////////////////////////////// 951 ///////////////////////////////////////////////////////////////////////////////
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 if (contents && !allow_js_access) { 2261 if (contents && !allow_js_access) {
2262 contents->web_contents()->GetController().LoadURL( 2262 contents->web_contents()->GetController().LoadURL(
2263 target_url, 2263 target_url,
2264 content::Referrer(), 2264 content::Referrer(),
2265 content::PAGE_TRANSITION_LINK, 2265 content::PAGE_TRANSITION_LINK,
2266 std::string()); // No extra headers. 2266 std::string()); // No extra headers.
2267 } 2267 }
2268 2268
2269 return contents != NULL; 2269 return contents != NULL;
2270 } 2270 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698