diff options
Diffstat (limited to 'chrome/browser/dom_ui')
| -rw-r--r-- | chrome/browser/dom_ui/filebrowse_ui.cc | 25 | ||||
| -rw-r--r-- | chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc | 9 | ||||
| -rw-r--r-- | chrome/browser/dom_ui/mediaplayer_ui.cc | 12 |
3 files changed, 18 insertions, 28 deletions
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc index 4d93086..c8fb9ce 100644 --- a/chrome/browser/dom_ui/filebrowse_ui.cc +++ b/chrome/browser/dom_ui/filebrowse_ui.cc @@ -696,15 +696,14 @@ void FilebrowseHandler::OpenNewWindow(const ListValue* args, bool popup) { Browser* browser = popup ? Browser::CreateForType(Browser::TYPE_APP_PANEL, profile_) : BrowserList::GetLastActive(); - browser->AddTabWithURL(GURL(url), GURL(), PageTransition::LINK, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), - &browser); + Browser::AddTabWithURLParams params(GURL(url), PageTransition::LINK); + browser->AddTabWithURL(¶ms); if (popup) { // TODO(dhg): Remove these from being hardcoded. Allow javascript // to specify. - browser->window()->SetBounds(gfx::Rect(0, 0, 400, 300)); + params.target->window()->SetBounds(gfx::Rect(0, 0, 400, 300)); } - browser->window()->Show(); + params.target->window()->Show(); } void FilebrowseHandler::SendPicasawebRequest() { @@ -1062,16 +1061,14 @@ Browser* FileBrowseUI::OpenPopup(Profile* profile, url.append(hashArgument); } - browser->AddTabWithURL( - GURL(url), GURL(), PageTransition::LINK, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), - &browser); - browser->window()->SetBounds(gfx::Rect(kPopupLeft, - kPopupTop, - width, - height)); + Browser::AddTabWithURLParams params(GURL(url), PageTransition::LINK); + browser->AddTabWithURL(¶ms); + params.target->window()->SetBounds(gfx::Rect(kPopupLeft, + kPopupTop, + width, + height)); - browser->window()->Show(); + params.target->window()->Show(); } else { browser->window()->Show(); } diff --git a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc index 0230f88..1c9c5bb 100644 --- a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc +++ b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc @@ -41,13 +41,10 @@ void HtmlDialogTabContentsDelegate::OpenURLFromTab( // open it in the current frame. Code adapted from // Browser::OpenURLFromTab() with disposition == NEW_WINDOW. Browser* browser = CreateBrowser(); - TabContents* new_contents = - browser->AddTabWithURL(url, referrer, transition, -1, - TabStripModel::ADD_SELECTED, NULL, - std::string(), &browser); - DCHECK(new_contents); + Browser::AddTabWithURLParams params(url, transition); + params.referrer = referrer; + browser->AddTabWithURL(¶ms); browser->window()->Show(); - new_contents->Focus(); } } diff --git a/chrome/browser/dom_ui/mediaplayer_ui.cc b/chrome/browser/dom_ui/mediaplayer_ui.cc index e545da0..61631a2 100644 --- a/chrome/browser/dom_ui/mediaplayer_ui.cc +++ b/chrome/browser/dom_ui/mediaplayer_ui.cc @@ -498,10 +498,8 @@ void MediaPlayer::PopupPlaylist(Browser* creator) { Profile* profile = BrowserList::GetLastActive()->profile(); playlist_browser_ = Browser::CreateForType(Browser::TYPE_APP_PANEL, profile); - playlist_browser_->AddTabWithURL( - GURL(kMediaplayerPlaylistURL), GURL(), PageTransition::LINK, - -1, TabStripModel::ADD_SELECTED, NULL, std::string(), - &playlist_browser_); + playlist_browser_->AddSelectedTabWithURL(GURL(kMediaplayerPlaylistURL), + PageTransition::LINK); playlist_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, kPopupTop, kPopupWidth, @@ -532,10 +530,8 @@ void MediaPlayer::PopupMediaPlayer(Browser* creator) { view->SetCreatorView(creatorview); } #endif - mediaplayer_browser_->AddTabWithURL( - GURL(kMediaplayerURL), GURL(), PageTransition::LINK, - -1, TabStripModel::ADD_SELECTED, NULL, std::string(), - &mediaplayer_browser_); + mediaplayer_browser_->AddSelectedTabWithURL(GURL(kMediaplayerURL), + PageTransition::LINK); mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, kPopupTop, kPopupWidth, |
