diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 21:06:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 21:06:59 +0000 |
commit | 8fe497be04f86438c531ad222d6d0434afc85676 (patch) | |
tree | 306ba5087eb4c906a1a8bc0bb6a9600b3e20f898 | |
parent | fb76593391e388bf791f3a6e0d2b72c09ad24202 (diff) | |
download | chromium_src-8fe497be04f86438c531ad222d6d0434afc85676.zip chromium_src-8fe497be04f86438c531ad222d6d0434afc85676.tar.gz chromium_src-8fe497be04f86438c531ad222d6d0434afc85676.tar.bz2 |
Fix a flicker of the URL bar after you enter it. The code
inBrowser::OpenURLFromTab was not using the current tab when no source was
specified. This means we didn't update the correct tab.
This change uses the computed current URL for updating, and also clarifies the
comments in the TabContentsDelegate about what NULL means.
BUG=9799
Review URL: http://codereview.chromium.org/63125
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13458 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 8 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 35e4e22..5c5c581 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -671,8 +671,8 @@ void Browser::OpenCurrentURL() { UserMetrics::RecordAction(L"LoadURL", profile_); LocationBar* location_bar = window_->GetLocationBar(); OpenURL(GURL(WideToUTF8(location_bar->GetInputString())), GURL(), - location_bar->GetWindowOpenDisposition(), - location_bar->GetPageTransition()); + location_bar->GetWindowOpenDisposition(), + location_bar->GetPageTransition()); } void Browser::Go(WindowOpenDisposition disposition) { @@ -1719,8 +1719,8 @@ void Browser::OpenURLFromTab(TabContents* source, // Update the location bar and load state. These are both synchronous // updates inside of ScheduleUIUpdate. - ScheduleUIUpdate(source, TabContents::INVALIDATE_URL | - TabContents::INVALIDATE_LOAD); + ScheduleUIUpdate(current_tab, TabContents::INVALIDATE_URL | + TabContents::INVALIDATE_LOAD); } else if (disposition == OFF_THE_RECORD) { OpenURLOffTheRecord(profile_, url); return; diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 19cc4ec..152f83d 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -20,11 +20,18 @@ class TabContentsDelegate : public PageNavigator { // Opens a new URL inside the passed in TabContents (if source is 0 open // in the current front-most tab), unless |disposition| indicates the url // should be opened in a new tab or window. + // + // A NULL source indicates the current tab (callers should probably use + // OpenURL() for these cases which does it for you). virtual void OpenURLFromTab(TabContents* source, const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, PageTransition::Type transition) = 0; + // Wrapper around OpenURLFromTab when there is no source for the given URL + // (it will use the current onep. + // + // This implements the PageNavigator interface. virtual void OpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, PageTransition::Type transition) { |