| 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/ash_window_tree_host.h" | 11 #include "ash/host/ash_window_tree_host.h" |
| 12 #include "ash/host/root_window_transformer.h" | 12 #include "ash/host/root_window_transformer.h" |
| 13 #include "ash/root_window_controller.h" | 13 #include "ash/root_window_controller.h" |
| 14 #include "ash/root_window_settings.h" | 14 #include "ash/root_window_settings.h" |
| 15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 16 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "ui/aura/env.h" | 19 #include "ui/aura/env.h" |
| 20 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
| 21 #include "ui/display/types/display_constants.h" |
| 21 #include "ui/keyboard/keyboard_controller.h" | 22 #include "ui/keyboard/keyboard_controller.h" |
| 22 #include "ui/keyboard/keyboard_util.h" | 23 #include "ui/keyboard/keyboard_util.h" |
| 23 | 24 |
| 24 namespace ash { | 25 namespace ash { |
| 25 | 26 |
| 26 VirtualKeyboardWindowController::VirtualKeyboardWindowController() { | 27 VirtualKeyboardWindowController::VirtualKeyboardWindowController() { |
| 27 Shell::GetInstance()->AddShellObserver(this); | 28 Shell::GetInstance()->AddShellObserver(this); |
| 28 } | 29 } |
| 29 | 30 |
| 30 VirtualKeyboardWindowController::~VirtualKeyboardWindowController() { | 31 VirtualKeyboardWindowController::~VirtualKeyboardWindowController() { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 78 } |
| 78 | 79 |
| 79 void VirtualKeyboardWindowController::FlipDisplay() { | 80 void VirtualKeyboardWindowController::FlipDisplay() { |
| 80 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 81 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 81 if (!display_manager->virtual_keyboard_root_window_enabled()) { | 82 if (!display_manager->virtual_keyboard_root_window_enabled()) { |
| 82 NOTREACHED() << "Attempting to flip virtual keyboard root window when it " | 83 NOTREACHED() << "Attempting to flip virtual keyboard root window when it " |
| 83 << "is not enabled."; | 84 << "is not enabled."; |
| 84 return; | 85 return; |
| 85 } | 86 } |
| 86 display_manager->SetDisplayRotation( | 87 display_manager->SetDisplayRotation( |
| 87 display_manager->non_desktop_display().id(), gfx::Display::ROTATE_180); | 88 display_manager->non_desktop_display().id(), gfx::Display::ROTATE_180, |
| 89 ui::USER); |
| 88 | 90 |
| 89 aura::WindowTreeHost* host = root_window_controller_->GetHost(); | 91 aura::WindowTreeHost* host = root_window_controller_->GetHost(); |
| 90 scoped_ptr<RootWindowTransformer> transformer( | 92 scoped_ptr<RootWindowTransformer> transformer( |
| 91 CreateRootWindowTransformerForDisplay( | 93 CreateRootWindowTransformerForDisplay( |
| 92 host->window(), display_manager->non_desktop_display())); | 94 host->window(), display_manager->non_desktop_display())); |
| 93 root_window_controller_->ash_host()->SetRootWindowTransformer( | 95 root_window_controller_->ash_host()->SetRootWindowTransformer( |
| 94 transformer.Pass()); | 96 transformer.Pass()); |
| 95 } | 97 } |
| 96 | 98 |
| 97 void VirtualKeyboardWindowController::OnMaximizeModeStarted() { | 99 void VirtualKeyboardWindowController::OnMaximizeModeStarted() { |
| 98 keyboard::SetTouchKeyboardEnabled(true); | 100 keyboard::SetTouchKeyboardEnabled(true); |
| 99 Shell::GetInstance()->CreateKeyboard(); | 101 Shell::GetInstance()->CreateKeyboard(); |
| 100 } | 102 } |
| 101 | 103 |
| 102 void VirtualKeyboardWindowController::OnMaximizeModeEnded() { | 104 void VirtualKeyboardWindowController::OnMaximizeModeEnded() { |
| 103 keyboard::SetTouchKeyboardEnabled(false); | 105 keyboard::SetTouchKeyboardEnabled(false); |
| 104 if (!keyboard::IsKeyboardEnabled()) | 106 if (!keyboard::IsKeyboardEnabled()) |
| 105 Shell::GetInstance()->DeactivateKeyboard(); | 107 Shell::GetInstance()->DeactivateKeyboard(); |
| 106 } | 108 } |
| 107 | 109 |
| 108 } // namespace ash | 110 } // namespace ash |
| OLD | NEW |