diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-02 15:15:33 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-02 15:15:33 +0000 |
commit | 616381f0a55322de447465573e39612e5af18b31 (patch) | |
tree | 4cbf687bb163f3dcd95e55e7be7fc9197e0dd8fd /chrome/browser/dom_ui/filebrowse_ui.cc | |
parent | e5925962c61dbb9c8f5a5425ca2dc2953fb6a3e1 (diff) | |
download | chromium_src-616381f0a55322de447465573e39612e5af18b31.zip chromium_src-616381f0a55322de447465573e39612e5af18b31.tar.gz chromium_src-616381f0a55322de447465573e39612e5af18b31.tar.bz2 |
Make all browser code use browser::Navigate to open tabs.
BUG=none
TEST=existing unittests. Also, test all places where new tabs and windows are opened from UI, e.g. links in options, new tab button, Ctrl+T, popup windows, etc.
Review URL: http://codereview.chromium.org/3834002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/filebrowse_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/filebrowse_ui.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc index 90b8dbf..7c34413 100644 --- a/chrome/browser/dom_ui/filebrowse_ui.cc +++ b/chrome/browser/dom_ui/filebrowse_ui.cc @@ -21,6 +21,7 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/browser_navigator.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" @@ -696,14 +697,16 @@ void FilebrowseHandler::OpenNewWindow(const ListValue* args, bool popup) { Browser* browser = popup ? Browser::CreateForType(Browser::TYPE_APP_PANEL, profile_) : BrowserList::GetLastActive(); - Browser::AddTabWithURLParams params(GURL(url), PageTransition::LINK); - browser->AddTabWithURL(¶ms); + browser::NavigateParams params(browser, GURL(url), PageTransition::LINK); + params.disposition = NEW_FOREGROUND_TAB; + browser::Navigate(¶ms); + // TODO(beng): The following two calls should be automatic by Navigate(). if (popup) { // TODO(dhg): Remove these from being hardcoded. Allow javascript // to specify. - params.target->window()->SetBounds(gfx::Rect(0, 0, 400, 300)); + params.browser->window()->SetBounds(gfx::Rect(0, 0, 400, 300)); } - params.target->window()->Show(); + params.browser->window()->Show(); } void FilebrowseHandler::SendPicasawebRequest() { @@ -1061,14 +1064,16 @@ Browser* FileBrowseUI::OpenPopup(Profile* profile, url.append(hashArgument); } - Browser::AddTabWithURLParams params(GURL(url), PageTransition::LINK); - browser->AddTabWithURL(¶ms); - params.target->window()->SetBounds(gfx::Rect(kPopupLeft, - kPopupTop, - width, - height)); + browser::NavigateParams params(browser, GURL(url), PageTransition::LINK); + params.disposition = NEW_FOREGROUND_TAB; + browser::Navigate(¶ms); + // TODO(beng): The following two calls should be automatic by Navigate(). + params.browser->window()->SetBounds(gfx::Rect(kPopupLeft, + kPopupTop, + width, + height)); - params.target->window()->Show(); + params.browser->window()->Show(); } else { browser->window()->Show(); } |