- Fix compile errors.
- Add support for creating hidden windows and TEST_REDIRECT_POPUP_URLS.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@201 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-03-08 03:54:50 +00:00
parent 7b1166b18a
commit 11b831119a
11 changed files with 107 additions and 64 deletions

View File

@@ -775,7 +775,7 @@ bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry,
view->setFocusedFrame(frame);
// Give focus to the window if it is currently visible.
if(IsWindowVisible(UIT_GetMainWndHandle()))
if(UIT_IsViewVisible(UIT_GetMainWndHandle()))
UIT_SetFocus(UIT_GetWebViewHost(), true);
}

View File

@@ -280,6 +280,7 @@ public:
protected:
static void UIT_CloseView(gfx::NativeView view);
static bool UIT_IsViewVisible(gfx::NativeView view);
void UIT_CreateDevToolsClient(BrowserDevToolsAgent* agent);
void UIT_DestroyDevToolsClient();

View File

@@ -91,7 +91,7 @@ void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
Unlock();
if (newWnd != nil) {
if (newWnd != nil && !window_info_.m_bHidden) {
// Show the window.
[newWnd makeKeyAndOrderFront: nil];
}
@@ -156,5 +156,13 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame)
// static
void CefBrowserImpl::UIT_CloseView(gfx::NativeView view)
{
[view performSelector:@selector(performClose:) withObject:nil afterDelay:0];
[[view window] performSelector:@selector(performClose:)
withObject:nil
afterDelay:0];
}
// static
bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view)
{
return [[view window] isVisible];
}

View File

@@ -488,3 +488,9 @@ void CefBrowserImpl::UIT_CloseView(gfx::NativeView view)
{
PostMessage(view, WM_CLOSE, 0, 0);
}
// static
bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view)
{
return IsWindowVisible(view) ? true : false;
}

View File

@@ -409,10 +409,12 @@ bool CefRegisterScheme(const CefString& scheme_name,
// RunnableMethodTraits::RetainCallee() (originating from NewRunnableMethod)
// will call AddRef() and Release() on the object in debug mode, resulting in
// the object being deleted if it doesn't already have a reference.
std::string hostNameStr;
if (is_standard)
hostNameStr = host_name;
CefRefPtr<SchemeRequestJobWrapper> wrapper(
new SchemeRequestJobWrapper(scheme_name,
(is_standard?host_name:std::string()),
is_standard, factory));
new SchemeRequestJobWrapper(scheme_name, hostNameStr, is_standard,
factory));
CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(wrapper.get(),
&SchemeRequestJobWrapper::RegisterScheme));