summaryrefslogtreecommitdiffstats
path: root/ash/host
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 22:41:47 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 22:41:47 +0000
commit10506308ee11a4130fe535139bb9b08f678969da (patch)
tree0b63d4cc4c2b8c42aee868db4df358404606394b /ash/host
parent5aba5bc9fe839dce4e580e042cd6f53cdc963deb (diff)
downloadchromium_src-10506308ee11a4130fe535139bb9b08f678969da.zip
chromium_src-10506308ee11a4130fe535139bb9b08f678969da.tar.gz
chromium_src-10506308ee11a4130fe535139bb9b08f678969da.tar.bz2
linux_aura: Compile ash into chrome.
[This is a reland now that the static initializers should be fixed.] Running chrome with the "--open-ash" parameter will create an ash desktop window. Ash on Linux has some problems, but at least we're now compiling the code into the binary. TODO: The applist isn't positioned correctly, and some details of the system tray aren't correct. BUG=300084, 303862 TBR=sky@chromium.org First Review URL: https://codereview.chromium.org/25108005 Review URL: https://codereview.chromium.org/270383007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/host')
-rw-r--r--ash/host/ash_window_tree_host_x11.cc8
-rw-r--r--ash/host/ash_window_tree_host_x11.h2
-rw-r--r--ash/host/ash_window_tree_host_x11_unittest.cc51
3 files changed, 37 insertions, 24 deletions
diff --git a/ash/host/ash_window_tree_host_x11.cc b/ash/host/ash_window_tree_host_x11.cc
index 94ca0cc..216dbb1 100644
--- a/ash/host/ash_window_tree_host_x11.cc
+++ b/ash/host/ash_window_tree_host_x11.cc
@@ -286,7 +286,9 @@ void AshWindowTreeHostX11::UpdateRootWindowSize(const gfx::Size& host_size) {
}
void AshWindowTreeHostX11::OnCursorVisibilityChangedNative(bool show) {
+#if defined(OS_CHROMEOS)
SetCrOSTapPaused(!show);
+#endif
}
void AshWindowTreeHostX11::OnWindowInitialized(aura::Window* window) {}
@@ -300,9 +302,11 @@ void AshWindowTreeHostX11::OnHostInitialized(aura::WindowTreeHost* host) {
return;
UpdateIsInternalDisplay();
+#if defined(OS_CHROMEOS)
// We have to enable Tap-to-click by default because the cursor is set to
// visible in Shell::InitRootWindowController.
SetCrOSTapPaused(false);
+#endif
}
void AshWindowTreeHostX11::OnConfigureNotify() {
@@ -323,6 +327,7 @@ void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent(
case ui::ET_TOUCH_PRESSED:
case ui::ET_TOUCH_CANCELLED:
case ui::ET_TOUCH_RELEASED: {
+#if defined(OS_CHROMEOS)
ui::TouchEvent* touchev = static_cast<ui::TouchEvent*>(event);
if (base::SysInfo::IsRunningOnChromeOS()) {
// X maps the touch-surface to the size of the X root-window.
@@ -337,6 +342,7 @@ void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent(
touch_calibrate_->Calibrate(touchev, bounds());
#endif // defined(USE_XI2_MT)
}
+#endif // defined(OS_CHROMEOS)
break;
}
default: {
@@ -372,6 +378,7 @@ void AshWindowTreeHostX11::UpdateIsInternalDisplay() {
is_internal_display_ = display.IsInternal();
}
+#if defined(OS_CHROMEOS)
void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) {
if (!ui::IsXInput2Available())
return;
@@ -414,6 +421,7 @@ void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) {
}
}
}
+#endif
AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) {
return new AshWindowTreeHostX11(initial_bounds);
diff --git a/ash/host/ash_window_tree_host_x11.h b/ash/host/ash_window_tree_host_x11.h
index f7939f2..47e8bc7 100644
--- a/ash/host/ash_window_tree_host_x11.h
+++ b/ash/host/ash_window_tree_host_x11.h
@@ -55,9 +55,11 @@ class ASH_EXPORT AshWindowTreeHostX11 : public AshWindowTreeHost,
// Update is_internal_display_ based on the current state.
void UpdateIsInternalDisplay();
+#if defined(OS_CHROMEOS)
// Set the CrOS touchpad "tap paused" property. It is used to temporarily
// turn off the Tap-to-click feature when the mouse pointer is invisible.
void SetCrOSTapPaused(bool state);
+#endif
// True if the root host resides on the internal display
bool is_internal_display_;
diff --git a/ash/host/ash_window_tree_host_x11_unittest.cc b/ash/host/ash_window_tree_host_x11_unittest.cc
index efd25c0..e43df42 100644
--- a/ash/host/ash_window_tree_host_x11_unittest.cc
+++ b/ash/host/ash_window_tree_host_x11_unittest.cc
@@ -56,16 +56,35 @@ class RootWindowEventHandler : public ui::EventHandler {
namespace ash {
-typedef aura::test::AuraTestBase WindowTreeHostX11Test;
+class AshWindowTreeHostX11Test : public aura::test::AuraTestBase {
+ public:
+ virtual void SetUp() OVERRIDE {
+ aura::test::AuraTestBase::SetUp();
+
+#if defined(OS_CHROMEOS)
+ // Fake a ChromeOS running env.
+ const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
+#endif
+ }
+
+ virtual void TearDown() OVERRIDE {
+ aura::test::AuraTestBase::TearDown();
+
+#if defined(OS_CHROMEOS)
+ // Revert the CrOS testing env otherwise the following non-CrOS aura
+ // tests will fail.
+ // Fake a ChromeOS running env.
+ const char* kLsbRelease = "";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
+#endif
+ }
+};
// Send X touch events to one WindowTreeHost. The WindowTreeHost's
// delegate will get corresponding ui::TouchEvent if the touch events
-// are winthin the bound of the WindowTreeHost.
-TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
- // Fake a ChromeOS running env.
- const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
-
+// are targeting this WindowTreeHost.
+TEST_F(AshWindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
scoped_ptr<AshWindowTreeHostX11> window_tree_host(
new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700)));
window_tree_host->InitHost();
@@ -112,22 +131,12 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
EXPECT_EQ(gfx::Point(1500, 1600), handler->last_touch_location());
handler.reset();
-
- // Revert the CrOS testing env otherwise the following non-CrOS aura
- // tests will fail.
- // Fake a ChromeOS running env.
- kLsbRelease = "";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
}
// Send X touch events to two WindowTreeHost. The WindowTreeHost which is
// the event target of the X touch events should generate the corresponding
// ui::TouchEvent for its delegate.
-TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
- // Fake a ChromeOS running env.
- const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
-
+TEST_F(AshWindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
scoped_ptr<AshWindowTreeHostX11> window_tree_host1(
new AshWindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700)));
window_tree_host1->InitHost();
@@ -226,12 +235,6 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
handler1.reset();
handler2.reset();
-
- // Revert the CrOS testing env otherwise the following non-CrOS aura
- // tests will fail.
- // Fake a ChromeOS running env.
- kLsbRelease = "";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
}
} // namespace aura