Commit 480bcfb7 authored by oshima@chromium.org's avatar oshima@chromium.org

Fix fullscreen mode on aura

* Switching to fullscreen on aura is synchronous. Use the same path as windows.
* Use dispatcher to run all pending in in_process_browser_tests.
* Check if the window is already destroyed in NatveWidgetAura::Hide

BUG=103485
TEST=following tests should pass with this patch on aura: BrowserTest.TestFullscreenBubbleMouseLockState
BrowserTest.TestNewTabExitsFullscreen
BrowserTest.TestTabExitsItselfFromFullscreen


Review URL: http://codereview.chromium.org/8571026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110337 0039d316-1c4b-4281-b951-d872f2087c98
parent 79acf811
......@@ -772,10 +772,10 @@ void BrowserView::EnterFullscreen(
if (IsFullscreen())
return; // Nothing to do.
#if defined(OS_WIN)
#if defined(OS_WIN) || defined(USE_AURA)
ProcessFullscreen(true, url, bubble_type);
#else
// On Linux changing fullscreen is async. Ask the window to change it's
// On Linux/gtk changing fullscreen is async. Ask the window to change it's
// fullscreen state, and when done invoke ProcessFullscreen.
fullscreen_request_.pending = true;
fullscreen_request_.url = url;
......@@ -788,7 +788,7 @@ void BrowserView::ExitFullscreen() {
if (!IsFullscreen())
return; // Nothing to do.
#if defined(OS_WIN)
#if defined(OS_WIN) || defined(USE_AURA)
ProcessFullscreen(false, GURL(), FEB_TYPE_NONE);
#else
fullscreen_request_.pending = false;
......@@ -2245,10 +2245,10 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
#endif
// Toggle fullscreen mode.
#if defined(OS_WIN) && !defined(USE_AURA)
#if defined(OS_WIN) || defined(USE_AURA)
frame_->SetFullscreen(fullscreen);
#endif // No need to invoke SetFullscreen for linux as this code is executed
// once we're already fullscreen on linux.
#endif // No need to invoke SetFullscreen for linux/gtk as this code
// is executed once we're already fullscreen on linux.
browser_->WindowFullscreenStateChanged();
......
......@@ -48,8 +48,12 @@
#include "ui/aura/desktop.h"
#endif
namespace {
// Passed as value of kTestType.
static const char kBrowserTestType[] = "browser";
const char kBrowserTestType[] = "browser";
} // namespace
InProcessBrowserTest::InProcessBrowserTest()
: browser_(NULL),
......@@ -273,12 +277,8 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
#endif
// Pump startup related events.
#if defined(USE_AURA)
MessageLoopForUI::current()->RunAllPendingWithDispatcher(
aura::Desktop::GetInstance()->GetDispatcher());
#else
MessageLoopForUI::current()->RunAllPending();
#endif
ui_test_utils::RunAllPendingInMessageLoop();
#if defined(OS_MACOSX)
pool.Recycle();
#endif
......@@ -290,7 +290,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
// Pump any pending events that were created as a result of creating a
// browser.
MessageLoopForUI::current()->RunAllPending();
ui_test_utils::RunAllPendingInMessageLoop();
SetUpOnMainThread();
#if defined(OS_MACOSX)
......
......@@ -349,7 +349,13 @@ void NativeWidgetAura::SetShape(gfx::NativeRegion region) {
}
void NativeWidgetAura::Close() {
Hide();
// |window_| may already be deleted by parent window. This can happen
// when this widget is child widget or has transient parent
// and ownership is WIDGET_OWNS_NATIVE_WIDGET.
DCHECK(window_ ||
ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET);
if (window_)
Hide();
window_->SetIntProperty(aura::kModalKey, 0);
......
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