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

Unified Diff: chrome/browser/browser.cc

Issue 12863: Changed the Browser::Reload() function to check the url... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 12 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 6194)
+++ chrome/browser/browser.cc (working copy)
@@ -581,12 +581,25 @@
// If we are showing an interstitial, treat this as an OpenURL.
TabContents* current_tab = GetSelectedTabContents();
+ std::wstring current_url;
+ LocationBarView* lbv = GetLocationBarView();
+ AutocompleteEditView* aev = NULL;
+
+ if ((lbv)&&(current_tab->ShouldDisplayURL())) {
+ aev = lbv->location_entry();
+ current_url = UTF8ToWide(current_tab->GetURL().spec());
+ }
+
if (current_tab) {
WebContents* web_contents = current_tab->AsWebContents();
if (web_contents && web_contents->showing_interstitial_page()) {
NavigationEntry* entry = current_tab->controller()->GetActiveEntry();
DCHECK(entry); // Should exist if interstitial is showing.
OpenURL(entry->url(), GURL(), CURRENT_TAB, PageTransition::RELOAD);
+
+ if (aev) {
+ aev->SetWindowTextAndCaretPos(current_url, current_url.length() - 1);
+ }
return;
}
}
@@ -595,6 +608,10 @@
// As this is caused by a user action, give the focus to the page.
current_tab->Focus();
current_tab->controller()->Reload(true);
+
+ if (aev) {
+ aev->SetWindowTextAndCaretPos(current_url, current_url.length() - 1);
+ }
}
}
@@ -2355,4 +2372,4 @@
DCHECK(prefs);
prefs->RegisterDictionaryPref(window_pref.c_str());
-}
+}
« 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