diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 4e2328ec5..17c64a901 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -191,6 +191,7 @@ 'tests/cefclient/root_window_manager.h', 'tests/cefclient/scheme_test.cc', 'tests/cefclient/scheme_test.h', + 'tests/cefclient/temp_window.h', 'tests/cefclient/test_runner.cc', 'tests/cefclient/test_runner.h', 'tests/cefclient/window_test.cc', diff --git a/tests/cefclient/root_window_gtk.cc b/tests/cefclient/root_window_gtk.cc index 23595fc80..fd6490892 100644 --- a/tests/cefclient/root_window_gtk.cc +++ b/tests/cefclient/root_window_gtk.cc @@ -18,7 +18,7 @@ #include "cefclient/client_switches.h" #include "cefclient/main_message_loop.h" #include "cefclient/resource.h" -#include "cefclient/temp_window_x11.h" +#include "cefclient/temp_window.h" namespace client { @@ -131,7 +131,7 @@ void RootWindowGtk::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindowX11::GetWindowHandle(), + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, client, settings); } diff --git a/tests/cefclient/root_window_mac.mm b/tests/cefclient/root_window_mac.mm index 819ac3553..a0501e267 100644 --- a/tests/cefclient/root_window_mac.mm +++ b/tests/cefclient/root_window_mac.mm @@ -11,7 +11,7 @@ #include "cefclient/browser_window_std_mac.h" #include "cefclient/client_switches.h" #include "cefclient/main_message_loop.h" -#include "cefclient/temp_window_mac.h" +#include "cefclient/temp_window.h" // Receives notifications from controls and the browser window. Will delete // itself when done. @@ -310,7 +310,7 @@ void RootWindowMac::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindowMac::GetWindowHandle(), + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, client, settings); } diff --git a/tests/cefclient/root_window_manager.h b/tests/cefclient/root_window_manager.h index 2ff330b15..d81ec2def 100644 --- a/tests/cefclient/root_window_manager.h +++ b/tests/cefclient/root_window_manager.h @@ -10,14 +10,7 @@ #include "include/base/cef_scoped_ptr.h" #include "include/cef_command_line.h" #include "cefclient/root_window.h" - -#if defined(OS_WIN) -#include "cefclient/temp_window_win.h" -#elif defined(OS_LINUX) -#include "cefclient/temp_window_x11.h" -#elif defined(OS_MACOSX) -#include "cefclient/temp_window_mac.h" -#endif +#include "cefclient/temp_window.h" namespace client { @@ -81,13 +74,7 @@ class RootWindowManager : public RootWindow::Delegate { RootWindowSet root_windows_; // Singleton window used as the temporary parent for popup browsers. -#if defined(OS_WIN) - TempWindowWin temp_window_win_; -#elif defined(OS_LINUX) - TempWindowX11 temp_window_x11_; -#elif defined(OS_MACOSX) - TempWindowMac temp_window_mac_; -#endif + TempWindow temp_window_; DISALLOW_COPY_AND_ASSIGN(RootWindowManager); }; diff --git a/tests/cefclient/root_window_win.cc b/tests/cefclient/root_window_win.cc index 0accdd70a..00779938c 100644 --- a/tests/cefclient/root_window_win.cc +++ b/tests/cefclient/root_window_win.cc @@ -11,7 +11,7 @@ #include "cefclient/client_switches.h" #include "cefclient/main_message_loop.h" #include "cefclient/resource.h" -#include "cefclient/temp_window_win.h" +#include "cefclient/temp_window.h" #include "cefclient/util_win.h" #define MAX_URL_LENGTH 255 @@ -134,7 +134,7 @@ void RootWindowWin::InitAsPopup(RootWindow::Delegate* delegate, // The new popup is initially parented to a temporary window. The native root // window will be created after the browser is created and the popup window // will be re-parented to it at that time. - browser_window_->GetPopupConfig(TempWindowWin::GetWindowHandle(), + browser_window_->GetPopupConfig(TempWindow::GetWindowHandle(), windowInfo, client, settings); } diff --git a/tests/cefclient/temp_window.h b/tests/cefclient/temp_window.h new file mode 100644 index 000000000..5a6d972c2 --- /dev/null +++ b/tests/cefclient/temp_window.h @@ -0,0 +1,30 @@ +// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights +// reserved. Use of this source code is governed by a BSD-style license that +// can be found in the LICENSE file. + +#ifndef CEF_TESTS_CEFCLIENT_TEMP_WINDOW_H_ +#define CEF_TESTS_CEFCLIENT_TEMP_WINDOW_H_ + +#include "cefclient/client_types.h" + +#if defined(OS_WIN) +#include "cefclient/temp_window_win.h" +#elif defined(OS_LINUX) +#include "cefclient/temp_window_x11.h" +#elif defined(OS_MACOSX) +#include "cefclient/temp_window_mac.h" +#endif + +namespace client { + +#if defined(OS_WIN) +typedef TempWindowWin TempWindow; +#elif defined(OS_LINUX) +typedef TempWindowX11 TempWindow; +#elif defined(OS_MACOSX) +typedef TempWindowMac TempWindow; +#endif + +} // namespace client + +#endif // CEF_TESTS_CEFCLIENT_TEMP_WINDOW_H_