| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |