| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "ui/aura/env.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_delegate.h" | 18 #include "ui/aura/window_delegate.h" |
| 18 #include "ui/aura/window_observer.h" | 19 #include "ui/aura/window_observer.h" |
| 19 #include "ui/base/cursor/cursor.h" | 20 #include "ui/base/cursor/cursor.h" |
| 20 #include "ui/base/hit_test.h" | 21 #include "ui/base/hit_test.h" |
| 21 #include "ui/base/ime/input_method.h" | 22 #include "ui/base/ime/input_method.h" |
| 22 #include "ui/base/ime/text_input_client.h" | 23 #include "ui/base/ime/text_input_client.h" |
| 23 #include "ui/compositor/layer_animation_observer.h" | 24 #include "ui/compositor/layer_animation_observer.h" |
| 24 #include "ui/compositor/scoped_layer_animation_settings.h" | 25 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 25 #include "ui/display/types/display_constants.h" | 26 #include "ui/display/types/display_constants.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void OnWindowTargetVisibilityChanged(bool visible) override {} | 90 void OnWindowTargetVisibilityChanged(bool visible) override {} |
| 90 bool HasHitTestMask() const override { return false; } | 91 bool HasHitTestMask() const override { return false; } |
| 91 void GetHitTestMask(gfx::Path* mask) const override {} | 92 void GetHitTestMask(gfx::Path* mask) const override {} |
| 92 | 93 |
| 93 DISALLOW_COPY_AND_ASSIGN(KeyboardWindowDelegate); | 94 DISALLOW_COPY_AND_ASSIGN(KeyboardWindowDelegate); |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 void ToggleTouchEventLogging(bool enable) { | 97 void ToggleTouchEventLogging(bool enable) { |
| 97 #if defined(OS_CHROMEOS) | 98 #if defined(OS_CHROMEOS) |
| 98 #if defined(USE_OZONE) | 99 #if defined(USE_OZONE) |
| 100 // TODO(moshayedi): crbug.com/642863. Revisit when we have mojo interface for |
| 101 // InputController for processes that aren't mus-ws. |
| 102 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS) |
| 103 return; |
| 99 ui::InputController* controller = | 104 ui::InputController* controller = |
| 100 ui::OzonePlatform::GetInstance()->GetInputController(); | 105 ui::OzonePlatform::GetInstance()->GetInputController(); |
| 101 if (controller) | 106 if (controller) |
| 102 controller->SetTouchEventLoggingEnabled(enable); | 107 controller->SetTouchEventLoggingEnabled(enable); |
| 103 #elif defined(USE_X11) | 108 #elif defined(USE_X11) |
| 104 if (!base::SysInfo::IsRunningOnChromeOS()) | 109 if (!base::SysInfo::IsRunningOnChromeOS()) |
| 105 return; | 110 return; |
| 106 base::CommandLine command( | 111 base::CommandLine command( |
| 107 base::FilePath("/opt/google/touchscreen/toggle_touch_event_logging")); | 112 base::FilePath("/opt/google/touchscreen/toggle_touch_event_logging")); |
| 108 if (enable) | 113 if (enable) |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 int keyboard_height = GetContainerWindow()->bounds().height(); | 533 int keyboard_height = GetContainerWindow()->bounds().height(); |
| 529 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 534 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
| 530 gfx::Rect new_bounds = root_bounds; | 535 gfx::Rect new_bounds = root_bounds; |
| 531 new_bounds.set_y(root_bounds.height() - keyboard_height); | 536 new_bounds.set_y(root_bounds.height() - keyboard_height); |
| 532 new_bounds.set_height(keyboard_height); | 537 new_bounds.set_height(keyboard_height); |
| 533 GetContainerWindow()->SetBounds(new_bounds); | 538 GetContainerWindow()->SetBounds(new_bounds); |
| 534 } | 539 } |
| 535 } | 540 } |
| 536 | 541 |
| 537 } // namespace keyboard | 542 } // namespace keyboard |
| OLD | NEW |