diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 20:55:04 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 20:55:04 +0000 |
commit | 1f7d7e949149b4e58a34e7250f607eed4c3d07fd (patch) | |
tree | 5e9ea5e0f79e6ac1a0c0dc8b50b2c7d9601d7026 /chrome/browser/browser.h | |
parent | 7895ea23e75075fd6f9fe5a6c3dfb17d3456b208 (diff) | |
download | chromium_src-1f7d7e949149b4e58a34e7250f607eed4c3d07fd.zip chromium_src-1f7d7e949149b4e58a34e7250f607eed4c3d07fd.tar.gz chromium_src-1f7d7e949149b4e58a34e7250f607eed4c3d07fd.tar.bz2 |
Pasted links opened with alt-enter were opened next to the current tab instead of at the end of the strip. This was because the LINK transition type triggered the TabStripModel to apply heuristics about where to open the URL, even though all URLs opened from the address bar should bypass these heuristics. There were already hooks on the low-level functions to bypass the heuristics, I just had to expose them one level higher. This meant an expansion to one of the TabContentsDelegate function's argument list, hence the number of files touched. (This seems like a good capability to expose anyway, though.)BUG=6797TEST=Have multiple tabs in your tab strip. Select the first tab, paste in a URL, and hit alt-enter. The newly opened tab should appear at the far end of the strip.
Review URL: http://codereview.chromium.org/118038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.h')
-rw-r--r-- | chrome/browser/browser.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index fb7ea3b..13fea9c 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -220,12 +220,15 @@ class Browser : public TabStripModelDelegate, // Add a new tab with the specified URL. If instance is not null, its process // will be used to render the tab. |force_index| is passed through to - // TabStripModel::AddTabContents and it's meaning is documented with it's + // TabStripModel::AddTabContents and its meaning is documented with its // declaration. - TabContents* AddTabWithURL( - const GURL& url, const GURL& referrer, - PageTransition::Type transition, bool foreground, int index, - bool force_index, SiteInstance* instance); + TabContents* AddTabWithURL(const GURL& url, + const GURL& referrer, + PageTransition::Type transition, + bool foreground, + int index, + bool force_index, + SiteInstance* instance); // Add a new tab, given a NavigationController. A TabContents appropriate to // display the last committed entry is created and returned. @@ -425,13 +428,12 @@ class Browser : public TabStripModelDelegate, virtual int GetDragActions() const; // Construct a TabContents for a given URL, profile and transition type. // If instance is not null, its process will be used to render the tab. - virtual TabContents* CreateTabContentsForURL( - const GURL& url, - const GURL& referrer, - Profile* profile, - PageTransition::Type transition, - bool defer_load, - SiteInstance* instance) const; + virtual TabContents* CreateTabContentsForURL(const GURL& url, + const GURL& referrer, + Profile* profile, + PageTransition::Type transition, + bool defer_load, + SiteInstance* instance) const; virtual bool CanDuplicateContentsAt(int index); virtual void DuplicateContentsAt(int index); virtual void CloseFrameAfterDragSession(); @@ -457,9 +459,10 @@ class Browser : public TabStripModelDelegate, // Overridden from TabContentsDelegate: virtual void OpenURLFromTab(TabContents* source, - const GURL& url, const GURL& referrer, - WindowOpenDisposition disposition, - PageTransition::Type transition); + const GURL& url, + const GURL& referrer, + WindowOpenDisposition disposition, + PageTransition::Type transition); virtual void NavigationStateChanged(const TabContents* source, unsigned changed_flags); virtual void AddNewContents(TabContents* source, @@ -611,6 +614,17 @@ class Browser : public TabStripModelDelegate, // receiving Browser. Creates a new Browser if none are available. Browser* GetOrCreateTabbedBrowser(); + // The low-level function that other OpenURL...() functions call. This + // determines the appropriate SiteInstance to pass to AddTabWithURL(), focuses + // the newly created tab as needed, and does other miscellaneous housekeeping. + void OpenURLAtIndex(TabContents* source, + const GURL& url, + const GURL& referrer, + WindowOpenDisposition disposition, + PageTransition::Type transition, + int index, + bool force_index); + // Creates a new popup window with its own Browser object with the // incoming sizing information. |initial_pos|'s origin() is the // window origin, and its size() is the size of the content area. |