summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 18:58:11 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 18:58:11 +0000
commitd99cdfdc14e07927af392c95d7245abc091c5b53 (patch)
tree234d7bd8226abc41e338c6a5bf9e75121f673ceb
parenta3926aaa49313ceaa6c6996f344eb2f100561fd0 (diff)
downloadchromium_src-d99cdfdc14e07927af392c95d7245abc091c5b53.zip
chromium_src-d99cdfdc14e07927af392c95d7245abc091c5b53.tar.gz
chromium_src-d99cdfdc14e07927af392c95d7245abc091c5b53.tar.bz2
cleanup: Change AddTabWithNavigationController to simply AddTab.
Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/243013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28420 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc15
-rw-r--r--chrome/browser/browser.h5
2 files changed, 8 insertions, 12 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 6da9183..0aa1e2b 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -77,7 +77,6 @@
#include "app/win_util.h"
#include "chrome/browser/automation/ui_controls.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/cert_store.h"
#include "chrome/browser/download/save_package.h"
@@ -540,12 +539,10 @@ TabContents* Browser::AddTabWithURL(
return contents;
}
-// TODO(brettw) this should be just AddTab and it should take a TabContents.
-TabContents* Browser::AddTabWithNavigationController(
- NavigationController* ctrl, PageTransition::Type type) {
- TabContents* tc = ctrl->tab_contents();
- tabstrip_model_.AddTabContents(tc, -1, false, type, true);
- return tc;
+TabContents* Browser::AddTab(TabContents* tab_contents,
+ PageTransition::Type type) {
+ tabstrip_model_.AddTabContents(tab_contents, -1, false, type, true);
+ return tab_contents;
}
void Browser::AddTabContents(TabContents* new_contents,
@@ -1619,8 +1616,8 @@ void Browser::DuplicateContentsAt(int index) {
browser->window()->Show();
// The page transition below is only for the purpose of inserting the tab.
- new_contents = browser->AddTabWithNavigationController(
- &contents->Clone()->controller(),
+ new_contents = browser->AddTab(
+ contents->Clone()->controller().tab_contents(),
PageTransition::LINK);
}
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index b83eeea..646f559 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -234,10 +234,9 @@ class Browser : public TabStripModelDelegate,
bool force_index,
SiteInstance* instance);
- // Add a new tab, given a NavigationController. A TabContents appropriate to
+ // Add a new tab, given a TabContents. A TabContents appropriate to
// display the last committed entry is created and returned.
- TabContents* AddTabWithNavigationController(NavigationController* ctrl,
- PageTransition::Type type);
+ TabContents* AddTab(TabContents* tab_contents, PageTransition::Type type);
// Add a tab with its session history restored from the SessionRestore
// system. If select is true, the tab is selected. |tab_index| gives the index