OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // OS_WIN | 10 #endif // OS_WIN |
(...skipping 5043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5054 entry->GetURL(), Referrer(), disposition, | 5054 entry->GetURL(), Referrer(), disposition, |
5055 content::PAGE_TRANSITION_RELOAD, false)); | 5055 content::PAGE_TRANSITION_RELOAD, false)); |
5056 return; | 5056 return; |
5057 } | 5057 } |
5058 | 5058 |
5059 // As this is caused by a user action, give the focus to the page. | 5059 // As this is caused by a user action, give the focus to the page. |
5060 // | 5060 // |
5061 // Also notify RenderViewHostDelegate of the user gesture; this is | 5061 // Also notify RenderViewHostDelegate of the user gesture; this is |
5062 // normally done in Browser::Navigate, but a reload bypasses Navigate. | 5062 // normally done in Browser::Navigate, but a reload bypasses Navigate. |
5063 WebContents* tab = GetOrCloneTabForDisposition(disposition); | 5063 WebContents* tab = GetOrCloneTabForDisposition(disposition); |
5064 tab->GetRenderViewHost()->GetDelegate()->OnUserGesture(); | 5064 tab->UserGestureDone(); |
5065 if (!tab->FocusLocationBarByDefault()) | 5065 if (!tab->FocusLocationBarByDefault()) |
5066 tab->Focus(); | 5066 tab->Focus(); |
5067 if (ignore_cache) | 5067 if (ignore_cache) |
5068 tab->GetController().ReloadIgnoringCache(true); | 5068 tab->GetController().ReloadIgnoringCache(true); |
5069 else | 5069 else |
5070 tab->GetController().Reload(true); | 5070 tab->GetController().Reload(true); |
5071 } | 5071 } |
5072 | 5072 |
5073 WebContents* Browser::GetOrCloneTabForDisposition( | 5073 WebContents* Browser::GetOrCloneTabForDisposition( |
5074 WindowOpenDisposition disposition) { | 5074 WindowOpenDisposition disposition) { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5395 if (contents && !allow_js_access) { | 5395 if (contents && !allow_js_access) { |
5396 contents->web_contents()->GetController().LoadURL( | 5396 contents->web_contents()->GetController().LoadURL( |
5397 target_url, | 5397 target_url, |
5398 content::Referrer(), | 5398 content::Referrer(), |
5399 content::PAGE_TRANSITION_LINK, | 5399 content::PAGE_TRANSITION_LINK, |
5400 std::string()); // No extra headers. | 5400 std::string()); // No extra headers. |
5401 } | 5401 } |
5402 | 5402 |
5403 return contents != NULL; | 5403 return contents != NULL; |
5404 } | 5404 } |
OLD | NEW |