summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 19:24:21 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-29 19:24:21 +0000
commitf745489d0208c9e4e061d0e7361f951fb5eb825c (patch)
treec85f3ed2ddd6d9ba3a1374c1ccc177ad802ea4cc /chrome/common
parent19b8d82f61d84ec8423e3f1c0223410501d35a93 (diff)
downloadchromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.zip
chromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.tar.gz
chromium_src-f745489d0208c9e4e061d0e7361f951fb5eb825c.tar.bz2
hookup tabs to the model and handle new tab creation
Review URL: http://codereview.chromium.org/19669 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc31
-rw-r--r--chrome/common/temp_scaffolding_stubs.h5
2 files changed, 28 insertions, 8 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index 95dc2d4..1f87188 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -102,12 +102,33 @@ bool BrowserInit::LaunchBrowserImpl(const CommandLine& parsed_command_line,
DCHECK(profile);
// this code is a simplification of BrowserInit::LaunchWithProfile::Launch()
- Browser* browser = Browser::Create(profile);
- browser->window()->Show();
+ std::vector<GURL> urls_to_open;
+ urls_to_open.push_back(GURL("http://dev.chromium.org"));
+ urls_to_open.push_back(GURL("http://crbug.com"));
+ urls_to_open.push_back(GURL("http://icanhavecheezeburger.com"));
+ Browser* browser = NULL;
+ browser = OpenURLsInBrowser(browser, profile, urls_to_open);
return true;
}
+// a simplification of BrowserInit::LaunchWithProfile::OpenURLsInBrowser
+Browser* BrowserInit::OpenURLsInBrowser(
+ Browser* browser,
+ Profile* profile,
+ const std::vector<GURL>& urls) {
+ DCHECK(!urls.empty());
+ if (!browser || browser->type() != Browser::TYPE_NORMAL)
+ browser = Browser::Create(profile);
+
+ for (size_t i = 0; i < urls.size(); ++i) {
+ browser->AddTabWithURL(
+ urls[i], GURL(), PageTransition::START_PAGE, (i == 0), NULL);
+ }
+ browser->window()->Show();
+ return browser;
+}
+
//--------------------------------------------------------------------------
UserDataManager* UserDataManager::instance_ = NULL;
@@ -188,12 +209,6 @@ GURL Browser::GetHomePage() {
return GURL("http://dev.chromium.org");
}
-TabContents* Browser::AddTabWithURL(
- const GURL& url, const GURL& referrer, PageTransition::Type transition,
- bool foreground, SiteInstance* instance) {
- return new TabContents;
-}
-
void Browser::LoadingStateChanged(TabContents* source) {
}
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 03f3c146..79ea9c5 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -81,6 +81,9 @@ class BrowserInit {
static bool LaunchBrowserImpl(const CommandLine& parsed_command_line,
Profile* profile, const std::wstring& cur_dir,
bool process_startup, int* return_code);
+ static Browser* OpenURLsInBrowser(Browser* browser,
+ Profile* profile,
+ const std::vector<GURL>& urls);
};
class FirstRun {
@@ -324,6 +327,8 @@ class TabContents {
bool is_loading() const { return false; }
void CloseContents() { };
void SetupController(Profile* profile) { }
+ bool WasHidden() { return false; }
+ void RestoreFocus() { }
static TabContentsType TypeForURL(GURL* url) { return TAB_CONTENTS_WEB; }
static TabContents* CreateWithType(TabContentsType type,
Profile* profile,