Commit 53a663c3 authored by ananta@chromium.org's avatar ananta@chromium.org

Register the RenderViewHost instance created when a desktop notification bubble is displayed in CF

with the AutomationResourceMessagefilter. This ensures that any HTTP requests issued by this bubble go through
the host network stack implemenation.

Fixes bug http://code.google.com/p/chromium/issues/detail?id=64251

BUG=64251
Review URL: http://codereview.chromium.org/8414005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107669 0039d316-1c4b-4281-b951-d872f2087c98
parent 83c339a5
......@@ -219,6 +219,8 @@ bool ExternalTabContainer::Init(Profile* profile,
content::Source<TabContents>(tab_contents_->tab_contents()));
registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED,
content::NotificationService::AllSources());
registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED,
content::NotificationService::AllSources());
TabContentsObserver::Observe(tab_contents_->tab_contents());
......@@ -838,33 +840,33 @@ void ExternalTabContainer::Observe(int type,
break;
}
case content::NOTIFICATION_NAV_ENTRY_COMMITTED: {
if (ignore_next_load_notification_) {
ignore_next_load_notification_ = false;
return;
}
if (ignore_next_load_notification_) {
ignore_next_load_notification_ = false;
return;
}
const content::LoadCommittedDetails* commit =
content::Details<content::LoadCommittedDetails>(details).ptr();
if (commit->http_status_code >= kHttpClientErrorStart &&
commit->http_status_code <= kHttpServerErrorEnd) {
automation_->Send(new AutomationMsg_NavigationFailed(
tab_handle_, commit->http_status_code, commit->entry->url()));
ignore_next_load_notification_ = true;
} else {
NavigationInfo navigation_info;
// When the previous entry index is invalid, it will be -1, which
// will still make the computation come out right (navigating to the
// 0th entry will be +1).
if (InitNavigationInfo(&navigation_info, commit->type,
commit->previous_entry_index -
tab_contents_->controller().last_committed_entry_index()))
automation_->Send(new AutomationMsg_DidNavigate(tab_handle_,
navigation_info));
}
break;
const content::LoadCommittedDetails* commit =
content::Details<content::LoadCommittedDetails>(details).ptr();
if (commit->http_status_code >= kHttpClientErrorStart &&
commit->http_status_code <= kHttpServerErrorEnd) {
automation_->Send(new AutomationMsg_NavigationFailed(
tab_handle_, commit->http_status_code, commit->entry->url()));
ignore_next_load_notification_ = true;
} else {
NavigationInfo navigation_info;
// When the previous entry index is invalid, it will be -1, which
// will still make the computation come out right (navigating to the
// 0th entry will be +1).
if (InitNavigationInfo(&navigation_info, commit->type,
commit->previous_entry_index -
tab_contents_->controller().last_committed_entry_index()))
automation_->Send(new AutomationMsg_DidNavigate(tab_handle_,
navigation_info));
}
break;
}
case content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR: {
const ProvisionalLoadDetails* load_details =
content::Details<ProvisionalLoadDetails>(details).ptr();
......@@ -888,6 +890,13 @@ void ExternalTabContainer::Observe(int type,
}
break;
}
case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED: {
if (load_requests_via_automation_) {
RenderViewHost* rvh = content::Source<RenderViewHost>(source).ptr();
RegisterRenderViewHostForAutomation(rvh, false);
}
break;
}
default:
NOTREACHED();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment