diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 18:32:23 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 18:32:23 +0000 |
commit | 1b4c747749bc8cc46ed2b9006d2f82b6c511e7c4 (patch) | |
tree | dadc320dc0f37c5dd756aaee193a72b8697c09b8 /ash/test | |
parent | 9eab79b4434f1f4346767257af80f066116706f5 (diff) | |
download | chromium_src-1b4c747749bc8cc46ed2b9006d2f82b6c511e7c4.zip chromium_src-1b4c747749bc8cc46ed2b9006d2f82b6c511e7c4.tar.gz chromium_src-1b4c747749bc8cc46ed2b9006d2f82b6c511e7c4.tar.bz2 |
Makes construction of (ash)RemoteWindowTreeHostWin explicit
I need to do this as I need to pass in state to the constructor and I
can't do that with lazy construction. This makes creation a little
saner anyway.
I'm not happy about the static setting the HWND. I'll see if I can
clean that up later.
BUG=none
TEST=none
R=ananta@chromium.org
Review URL: https://codereview.chromium.org/277753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/ash_test_helper.cc | 5 | ||||
-rw-r--r-- | ash/test/test_metro_viewer_process_host.cc | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index a59019b..3dd9455 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -7,6 +7,7 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/ash_switches.h" #include "ash/shell.h" +#include "ash/shell_init_params.h" #include "ash/test/ash_test_views_delegate.h" #include "ash/test/display_manager_test_api.h" #include "ash/test/shell_test_api.h" @@ -84,7 +85,9 @@ void AshTestHelper::SetUp(bool start_session) { // created in AshTestBase tests. chromeos::CrasAudioHandler::InitializeForTesting(); #endif - ash::Shell::CreateInstance(test_shell_delegate_); + ShellInitParams init_params; + init_params.delegate = test_shell_delegate_; + ash::Shell::CreateInstance(init_params); aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup( scoped_ptr<aura::InputStateLookup>()); diff --git a/ash/test/test_metro_viewer_process_host.cc b/ash/test/test_metro_viewer_process_host.cc index 5dd448c..85df3e2 100644 --- a/ash/test/test_metro_viewer_process_host.cc +++ b/ash/test/test_metro_viewer_process_host.cc @@ -8,13 +8,15 @@ #include "base/logging.h" #include "ui/aura/remote_window_tree_host_win.h" +#include "ui/gfx/win/dpi.h" namespace ash { namespace test { TestMetroViewerProcessHost::TestMetroViewerProcessHost( base::SingleThreadTaskRunner* ipc_task_runner) - : MetroViewerProcessHost(ipc_task_runner), closed_unexpectedly_(false) { + : MetroViewerProcessHost(ipc_task_runner), + closed_unexpectedly_(false) { } TestMetroViewerProcessHost::~TestMetroViewerProcessHost() { @@ -30,8 +32,8 @@ void TestMetroViewerProcessHost::OnSetTargetSurface( float device_scale) { DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; HWND hwnd = reinterpret_cast<HWND>(target_surface); - aura::RemoteWindowTreeHostWin::Instance()-> - InitializeRemoteWindowAndScaleFactor(hwnd, device_scale); + gfx::InitDeviceScaleFactor(device_scale); + aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd); aura::RemoteWindowTreeHostWin::Instance()->Connected(this); } |