The |isMainContent| parameter to HandleLoadEnd should be true for reloads (issue #183).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@181 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-02-01 16:52:32 +00:00
parent 7cd53aea4d
commit 5911e7027c
4 changed files with 47 additions and 8 deletions

View File

@@ -105,7 +105,8 @@ void BrowserNavigationController::LoadEntry(BrowserNavigationEntry* entry) {
} }
BrowserNavigationEntry* BrowserNavigationController::GetLastCommittedEntry() const { BrowserNavigationEntry* BrowserNavigationController::GetLastCommittedEntry()
const {
if (last_committed_entry_index_ == -1) if (last_committed_entry_index_ == -1)
return NULL; return NULL;
return entries_[last_committed_entry_index_].get(); return entries_[last_committed_entry_index_].get();
@@ -139,7 +140,8 @@ BrowserNavigationEntry* BrowserNavigationController::GetEntryWithPageID(
return (index != -1) ? entries_[index].get() : NULL; return (index != -1) ? entries_[index].get() : NULL;
} }
void BrowserNavigationController::DidNavigateToEntry(BrowserNavigationEntry* entry) { void BrowserNavigationController::DidNavigateToEntry(
BrowserNavigationEntry* entry) {
// If the entry is that of a page with PageID larger than any this Tab has // If the entry is that of a page with PageID larger than any this Tab has
// seen before, then consider it a new navigation. // seen before, then consider it a new navigation.
if (entry->GetPageID() > GetMaxPageID()) { if (entry->GetPageID() > GetMaxPageID()) {
@@ -218,7 +220,8 @@ int BrowserNavigationController::GetEntryIndexWithPageID(int32 page_id) const {
return -1; return -1;
} }
void BrowserNavigationController::NavigateToPendingEntry(bool reload, bool ignoreCache) { void BrowserNavigationController::NavigateToPendingEntry(bool reload,
bool ignoreCache) {
// For session history navigations only the pending_entry_index_ is set. // For session history navigations only the pending_entry_index_ is set.
if (!pending_entry_) { if (!pending_entry_) {
DCHECK(pending_entry_index_ != -1); DCHECK(pending_entry_index_ != -1);

View File

@@ -97,6 +97,30 @@ v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame)
return WebCore::V8Proxy::context(core_frame); return WebCore::V8Proxy::context(core_frame);
} }
FrameLoadType GetFrameLoadType(WebKit::WebFrame* frame)
{
WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(frame);
WebCore::FrameLoader* loader = webFrameImpl->frame()->loader();
switch(loader->loadType()) {
case WebCore::FrameLoadTypeStandard:
return FLT_STANDARD;
case WebCore::FrameLoadTypeForward:
case WebCore::FrameLoadTypeBack:
case WebCore::FrameLoadTypeBackWMLDeckNotAccessible:
case WebCore::FrameLoadTypeIndexedBackForward:
return FLT_HISTORY;
case WebCore::FrameLoadTypeRedirectWithLockedBackForwardList:
return FLT_REDIRECT;
case WebCore::FrameLoadTypeReload:
case WebCore::FrameLoadTypeReloadFromOrigin:
case WebCore::FrameLoadTypeSame:
case WebCore::FrameLoadTypeReplace:
return FLT_RELOAD;
}
return FLT_UNKNOWN;
}
void CloseIdleConnections() { void CloseIdleConnections() {
// Used in benchmarking, Ignored for CEF. // Used in benchmarking, Ignored for CEF.
} }

View File

@@ -39,6 +39,17 @@ base::StringPiece NetResourceProvider(int key);
// Retrieve the V8 context associated with the frame. // Retrieve the V8 context associated with the frame.
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame); v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame);
enum FrameLoadType {
FLT_UNKNOWN = 0,
FLT_STANDARD,
FLT_HISTORY,
FLT_REDIRECT,
FLT_RELOAD,
};
// Returns the frame load type.
FrameLoadType GetFrameLoadType(WebKit::WebFrame* frame);
// Clear all cached data. // Clear all cached data.
void ClearCache(); void ClearCache();

View File

@@ -718,13 +718,14 @@ void BrowserWebViewDelegate::didCommitProvisionalLoad(
// New navigations will be the main content. // New navigations will be the main content.
is_main_content_ = true; is_main_content_ = true;
} else { } else {
// Session history navigations will be the main content. // Session history navigations and reloads will be the main content.
BrowserExtraData* extra_data = static_cast<BrowserExtraData*>( webkit_glue::FrameLoadType load_type =
frame->dataSource()->extraData()); webkit_glue::GetFrameLoadType(frame);
if (extra_data && extra_data->pending_page_id != -1 && if (load_type == webkit_glue::FLT_HISTORY ||
!extra_data->request_committed) load_type == webkit_glue::FLT_RELOAD) {
is_main_content_ = true; is_main_content_ = true;
} }
}
if (is_main_content_) { if (is_main_content_) {
// Clear the title so we can tell if it wasn't provided by the page. // Clear the title so we can tell if it wasn't provided by the page.