| 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" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void OnWindowTargetVisibilityChanged(bool visible) override {} | 89 void OnWindowTargetVisibilityChanged(bool visible) override {} |
| 90 bool HasHitTestMask() const override { return false; } | 90 bool HasHitTestMask() const override { return false; } |
| 91 void GetHitTestMask(gfx::Path* mask) const override {} | 91 void GetHitTestMask(gfx::Path* mask) const override {} |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(KeyboardWindowDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(KeyboardWindowDelegate); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 void ToggleTouchEventLogging(bool enable) { | 96 void ToggleTouchEventLogging(bool enable) { |
| 97 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
| 98 #if defined(USE_OZONE) | 98 #if defined(USE_OZONE) |
| 99 ui::OzonePlatform::GetInstance() | 99 ui::InputController* controller = |
| 100 ->GetInputController() | 100 ui::OzonePlatform::GetInstance()->GetInputController(); |
| 101 ->SetTouchEventLoggingEnabled(enable); | 101 if (controller) |
| 102 controller->SetTouchEventLoggingEnabled(enable); |
| 102 #elif defined(USE_X11) | 103 #elif defined(USE_X11) |
| 103 if (!base::SysInfo::IsRunningOnChromeOS()) | 104 if (!base::SysInfo::IsRunningOnChromeOS()) |
| 104 return; | 105 return; |
| 105 base::CommandLine command( | 106 base::CommandLine command( |
| 106 base::FilePath("/opt/google/touchscreen/toggle_touch_event_logging")); | 107 base::FilePath("/opt/google/touchscreen/toggle_touch_event_logging")); |
| 107 if (enable) | 108 if (enable) |
| 108 command.AppendArg("1"); | 109 command.AppendArg("1"); |
| 109 else | 110 else |
| 110 command.AppendArg("0"); | 111 command.AppendArg("0"); |
| 111 VLOG(1) << "Running " << command.GetCommandLineString(); | 112 VLOG(1) << "Running " << command.GetCommandLineString(); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 int keyboard_height = GetContainerWindow()->bounds().height(); | 523 int keyboard_height = GetContainerWindow()->bounds().height(); |
| 523 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); | 524 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); |
| 524 gfx::Rect new_bounds = root_bounds; | 525 gfx::Rect new_bounds = root_bounds; |
| 525 new_bounds.set_y(root_bounds.height() - keyboard_height); | 526 new_bounds.set_y(root_bounds.height() - keyboard_height); |
| 526 new_bounds.set_height(keyboard_height); | 527 new_bounds.set_height(keyboard_height); |
| 527 GetContainerWindow()->SetBounds(new_bounds); | 528 GetContainerWindow()->SetBounds(new_bounds); |
| 528 } | 529 } |
| 529 } | 530 } |
| 530 | 531 |
| 531 } // namespace keyboard | 532 } // namespace keyboard |
| OLD | NEW |