diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 22:33:58 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 22:33:58 +0000 |
commit | f5cde2b583d923436f728660e18e181f83cfa602 (patch) | |
tree | c419f1b05a7525bdd7b24d86641974e45a8f1237 /chrome/browser/external_tab_container.cc | |
parent | 279cd421c952d1581b4ac9bbc977e5f08b45d3b3 (diff) | |
download | chromium_src-f5cde2b583d923436f728660e18e181f83cfa602.zip chromium_src-f5cde2b583d923436f728660e18e181f83cfa602.tar.gz chromium_src-f5cde2b583d923436f728660e18e181f83cfa602.tar.bz2 |
ExternalTabcontainer browser to initial URL
Browse the newly created external tab to the specified initial URL
if present, to about:blank otherwise. Also send information about
SSL status when sending navigation updates to the automation client.
BUG=none
TEST=CreateExternalTabWithUrl UI test
Review URL: http://codereview.chromium.org/193054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index a3d76c4..94cfc27 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -51,7 +51,8 @@ bool ExternalTabContainer::Init(Profile* profile, DWORD style, bool load_requests_via_automation, bool handle_top_level_requests, - TabContents* existing_contents) { + TabContents* existing_contents, + const GURL& initial_url) { if (IsWindow()) { NOTREACHED(); return false; @@ -66,6 +67,7 @@ bool ExternalTabContainer::Init(Profile* profile, NOTREACHED(); return false; } + // TODO(jcampan): limit focus traversal to contents. // We don't ever remove the prop because the lifetime of this object @@ -125,6 +127,13 @@ bool ExternalTabContainer::Init(Profile* profile, Source<NavigationController>(controller), NotificationService::NoDetails()); + // Start loading initial URL + if (!initial_url.is_empty()) { + // Navigate out of context since we don't have a 'tab_handle_' yet. + MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( + this, &ExternalTabContainer::Navigate, initial_url, GURL())); + } + // We need WS_POPUP to be on the window during initialization, but // once initialized we apply the requested style which may or may not // include the popup bit. @@ -287,7 +296,8 @@ void ExternalTabContainer::AddNewContents(TabContents* source, WS_CHILD, load_requests_via_automation_, handle_top_level_requests_, - new_contents); + new_contents, + GURL()); if (result) { pending_tabs_[reinterpret_cast<intptr_t>(new_container.get())] = @@ -585,6 +595,8 @@ bool ExternalTabContainer::InitNavigationInfo(IPC::NavigationInfo* nav_info, tab_contents_->controller().GetCurrentEntryIndex(); nav_info->title = UTF16ToWideHack(entry->title()); nav_info->url = entry->url(); + nav_info->security_style = entry->ssl().security_style(); + nav_info->has_mixed_content = entry->ssl().has_mixed_content(); return true; } @@ -601,3 +613,12 @@ ExternalTabContainer* ExternalTabContainer::RemovePendingTab(intptr_t cookie) { return NULL; } +void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { + if (!tab_contents_) { + NOTREACHED(); + return; + } + + tab_contents_->controller().LoadURL(url, referrer, + PageTransition::START_PAGE); +} |