| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/display/virtual_keyboard_window_controller.h" | 5 #include "ash/display/virtual_keyboard_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/display/root_window_transformers.h" | 10 #include "ash/display/root_window_transformers.h" |
| 11 #include "ash/host/window_tree_host_factory.h" | 11 #include "ash/host/window_tree_host_factory.h" |
| 12 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
| 13 #include "ash/root_window_settings.h" | 13 #include "ash/root_window_settings.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
| 19 #include "ui/aura/root_window_transformer.h" | 19 #include "ui/aura/root_window_transformer.h" |
| 20 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
| 21 #include "ui/keyboard/keyboard_controller.h" | 21 #include "ui/keyboard/keyboard_controller.h" |
| 22 #include "ui/keyboard/keyboard_util.h" | 22 #include "ui/keyboard/keyboard_util.h" |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 namespace internal { | |
| 26 | 25 |
| 27 VirtualKeyboardWindowController::VirtualKeyboardWindowController() { | 26 VirtualKeyboardWindowController::VirtualKeyboardWindowController() { |
| 28 Shell::GetInstance()->AddShellObserver(this); | 27 Shell::GetInstance()->AddShellObserver(this); |
| 29 } | 28 } |
| 30 | 29 |
| 31 VirtualKeyboardWindowController::~VirtualKeyboardWindowController() { | 30 VirtualKeyboardWindowController::~VirtualKeyboardWindowController() { |
| 32 Shell::GetInstance()->RemoveShellObserver(this); | 31 Shell::GetInstance()->RemoveShellObserver(this); |
| 33 // Make sure the root window gets deleted before cursor_window_delegate. | 32 // Make sure the root window gets deleted before cursor_window_delegate. |
| 34 Close(); | 33 Close(); |
| 35 } | 34 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 if (!display_manager->virtual_keyboard_root_window_enabled()) { | 82 if (!display_manager->virtual_keyboard_root_window_enabled()) { |
| 84 NOTREACHED() << "Attempting to flip virtual keyboard root window when it " | 83 NOTREACHED() << "Attempting to flip virtual keyboard root window when it " |
| 85 << "is not enabled."; | 84 << "is not enabled."; |
| 86 return; | 85 return; |
| 87 } | 86 } |
| 88 display_manager->SetDisplayRotation( | 87 display_manager->SetDisplayRotation( |
| 89 display_manager->non_desktop_display().id(), gfx::Display::ROTATE_180); | 88 display_manager->non_desktop_display().id(), gfx::Display::ROTATE_180); |
| 90 | 89 |
| 91 aura::WindowTreeHost* host = root_window_controller_->host(); | 90 aura::WindowTreeHost* host = root_window_controller_->host(); |
| 92 scoped_ptr<aura::RootWindowTransformer> transformer( | 91 scoped_ptr<aura::RootWindowTransformer> transformer( |
| 93 internal::CreateRootWindowTransformerForDisplay(host->window(), | 92 CreateRootWindowTransformerForDisplay( |
| 94 display_manager->non_desktop_display())); | 93 host->window(), display_manager->non_desktop_display())); |
| 95 host->SetRootWindowTransformer(transformer.Pass()); | 94 host->SetRootWindowTransformer(transformer.Pass()); |
| 96 } | 95 } |
| 97 | 96 |
| 98 void VirtualKeyboardWindowController::OnMaximizeModeStarted() { | 97 void VirtualKeyboardWindowController::OnMaximizeModeStarted() { |
| 99 keyboard::SetTouchKeyboardEnabled(true); | 98 keyboard::SetTouchKeyboardEnabled(true); |
| 100 Shell::GetInstance()->CreateKeyboard(); | 99 Shell::GetInstance()->CreateKeyboard(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 void VirtualKeyboardWindowController::OnMaximizeModeEnded() { | 102 void VirtualKeyboardWindowController::OnMaximizeModeEnded() { |
| 104 keyboard::SetTouchKeyboardEnabled(false); | 103 keyboard::SetTouchKeyboardEnabled(false); |
| 105 if (!keyboard::IsKeyboardEnabled()) | 104 if (!keyboard::IsKeyboardEnabled()) |
| 106 Shell::GetInstance()->DeactivateKeyboard(); | 105 Shell::GetInstance()->DeactivateKeyboard(); |
| 107 } | 106 } |
| 108 | 107 |
| 109 } // namespace internal | |
| 110 } // namespace ash | 108 } // namespace ash |
| OLD | NEW |