diff options
author | samli <samli@chromium.org> | 2016-01-19 19:44:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-20 03:46:11 +0000 |
commit | 0e3a9fd80a26f1fce889200d330d79e64d7a2586 (patch) | |
tree | b81e8346effefb053d8ad102efd2a31c0507bd13 /ash | |
parent | 15d94b7c0e0b17e973d144c03c7f69f9e0f62309 (diff) | |
download | chromium_src-0e3a9fd80a26f1fce889200d330d79e64d7a2586.zip chromium_src-0e3a9fd80a26f1fce889200d330d79e64d7a2586.tar.gz chromium_src-0e3a9fd80a26f1fce889200d330d79e64d7a2586.tar.bz2 |
Revert of Remove remote tree host and some related input and metro_driver code (patchset #5 id:80001 of https://codereview.chromium.org/1586843002/ )
Reason for revert:
Suspecting that this is breaking the Webkit Win (dbg) builder.
First failed build:
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Builder%20%28dbg%29/builds/88362
Original issue's description:
> Remove remote tree host and some related input and metro_driver code
>
> Part of continued stripping out of Metro/Win8/Immersive mode.
>
> BUG=558054
>
> Committed: https://crrev.com/5cc04f70e424020d8afe49bdc4c1c76683f0ea7b
> Cr-Commit-Position: refs/heads/master@{#370068}
TBR=sky@chromium.org,thestig@chromium.org,shuchen@chromium.org,ananta@chromium.org,dpranke@chromium.org,scottmg@chromium.org
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
BUG=558054
Review URL: https://codereview.chromium.org/1602403002
Cr-Commit-Position: refs/heads/master@{#370290}
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash.gyp | 2 | ||||
-rw-r--r-- | ash/ash_unittests.isolate | 16 | ||||
-rw-r--r-- | ash/host/ash_remote_window_tree_host_win.cc | 71 | ||||
-rw-r--r-- | ash/host/ash_remote_window_tree_host_win.h | 53 | ||||
-rw-r--r-- | ash/host/ash_window_tree_host_win.cc | 6 | ||||
-rw-r--r-- | ash/test/ash_test_base.cc | 1 |
6 files changed, 148 insertions, 1 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index 1df3b4d..f87be98 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -147,6 +147,8 @@ 'gpu_support_stub.h', 'high_contrast/high_contrast_controller.cc', 'high_contrast/high_contrast_controller.h', + 'host/ash_remote_window_tree_host_win.cc', + 'host/ash_remote_window_tree_host_win.h', 'host/ash_window_tree_host.cc', 'host/ash_window_tree_host.h', 'host/ash_window_tree_host_init_params.cc', diff --git a/ash/ash_unittests.isolate b/ash/ash_unittests.isolate index 89ab132..a210ff8 100644 --- a/ash/ash_unittests.isolate +++ b/ash/ash_unittests.isolate @@ -26,7 +26,7 @@ ], }, }], - ['chromeos==1', { + ['OS=="win" or chromeos==1', { 'variables': { 'files': [ '../testing/test_env.py', @@ -52,6 +52,20 @@ ], }, }], + ['OS=="win"', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/osmesa.dll', + ], + }, + }], + ['OS=="win" and (fastbuild==0 or fastbuild==1)', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/ash_unittests.exe.pdb', + ], + }, + }], ], 'includes': [ '../base/base.isolate', diff --git a/ash/host/ash_remote_window_tree_host_win.cc b/ash/host/ash_remote_window_tree_host_win.cc new file mode 100644 index 0000000..f3191b5 --- /dev/null +++ b/ash/host/ash_remote_window_tree_host_win.cc @@ -0,0 +1,71 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/host/ash_remote_window_tree_host_win.h" + +#include "ash/host/root_window_transformer.h" +#include "ash/ime/input_method_event_handler.h" +#include "ui/events/event_processor.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/transform.h" + +namespace ash { + +AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin(HWND remote_hwnd) + : aura::RemoteWindowTreeHostWin(), + transformer_helper_(this) { + SetRemoteWindowHandle(remote_hwnd); + transformer_helper_.Init(); +} + +AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() {} + +void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} + +bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } + +void AshRemoteWindowTreeHostWin::UnConfineCursor() {} + +void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( + scoped_ptr<RootWindowTransformer> transformer) { + transformer_helper_.SetRootWindowTransformer(transformer.Pass()); +} + +gfx::Insets AshRemoteWindowTreeHostWin::GetHostInsets() const { + return gfx::Insets(); +} + +aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() { + return this; +} + +gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const { + return transformer_helper_.GetTransform(); +} + +void AshRemoteWindowTreeHostWin::SetRootTransform( + const gfx::Transform& transform) { + transformer_helper_.SetTransform(transform); +} + +gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { + return transformer_helper_.GetInverseTransform(); +} + +void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( + const gfx::Size& host_size) { + transformer_helper_.UpdateWindowSize(host_size); +} + +ui::EventDispatchDetails AshRemoteWindowTreeHostWin::DispatchKeyEventPostIME( + ui::KeyEvent* event) { + input_method_handler()->SetPostIME(true); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(event); + if (!details.dispatcher_destroyed) + input_method_handler()->SetPostIME(false); + return details; +} + +} // namespace ash diff --git a/ash/host/ash_remote_window_tree_host_win.h b/ash/host/ash_remote_window_tree_host_win.h new file mode 100644 index 0000000..f60e582 --- /dev/null +++ b/ash/host/ash_remote_window_tree_host_win.h @@ -0,0 +1,53 @@ +// Copyright 2014 The Chromium 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 ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ +#define ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ + +#include <windows.h> + +#include "ash/ash_export.h" +#include "ash/host/ash_window_tree_host.h" +#include "ash/host/transformer_helper.h" +#include "base/macros.h" +#include "ui/aura/remote_window_tree_host_win.h" + +namespace ash { + +class ASH_EXPORT AshRemoteWindowTreeHostWin + : public AshWindowTreeHost, + public aura::RemoteWindowTreeHostWin { + public: + explicit AshRemoteWindowTreeHostWin(HWND remote_hwnd); + + private: + ~AshRemoteWindowTreeHostWin() override; + + // AshWindowTreeHost: + void ToggleFullScreen() override; + bool ConfineCursorToRootWindow() override; + void UnConfineCursor() override; + void SetRootWindowTransformer( + scoped_ptr<RootWindowTransformer> transformer) override; + gfx::Insets GetHostInsets() const override; + aura::WindowTreeHost* AsWindowTreeHost() override; + + // WindowTreeHostWin: + gfx::Transform GetRootTransform() const override; + void SetRootTransform(const gfx::Transform& transform) override; + gfx::Transform GetInverseRootTransform() const override; + void UpdateRootWindowSize(const gfx::Size& host_size) override; + + // ui::internal::InputMethodDelegate: + ui::EventDispatchDetails DispatchKeyEventPostIME( + ui::KeyEvent* event) override; + + TransformerHelper transformer_helper_; + + DISALLOW_COPY_AND_ASSIGN(AshRemoteWindowTreeHostWin); +}; + +} // namespace ash + +#endif // ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ diff --git a/ash/host/ash_window_tree_host_win.cc b/ash/host/ash_window_tree_host_win.cc index 98d6b10..287fc56 100644 --- a/ash/host/ash_window_tree_host_win.cc +++ b/ash/host/ash_window_tree_host_win.cc @@ -6,6 +6,7 @@ #include "ash/ash_export.h" #include "ash/ash_switches.h" +#include "ash/host/ash_remote_window_tree_host_win.h" #include "ash/host/ash_window_tree_host_init_params.h" #include "ash/host/root_window_transformer.h" #include "ash/host/transformer_helper.h" @@ -122,6 +123,11 @@ class AshWindowTreeHostWin : public AshWindowTreeHost, AshWindowTreeHost* AshWindowTreeHost::Create( const AshWindowTreeHostInitParams& init_params) { + if (base::win::GetVersion() >= base::win::VERSION_WIN7 && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ash::switches::kForceAshToDesktop)) + return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); + return new AshWindowTreeHostWin(init_params.initial_bounds); } diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 93d770f..4232333 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -40,6 +40,7 @@ #if defined(OS_WIN) #include "base/win/windows_version.h" +#include "ui/aura/remote_window_tree_host_win.h" #include "ui/platform_window/win/win_window.h" #include "win8/test/test_registrar_constants.h" #endif |