OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 observer.OnCastingSessionStartedOrStopped(started); | 306 observer.OnCastingSessionStartedOrStopped(started); |
307 #endif | 307 #endif |
308 } | 308 } |
309 | 309 |
310 void Shell::OnRootWindowAdded(WmWindow* root_window) { | 310 void Shell::OnRootWindowAdded(WmWindow* root_window) { |
311 for (auto& observer : *wm_shell_->shell_observers()) | 311 for (auto& observer : *wm_shell_->shell_observers()) |
312 observer.OnRootWindowAdded(root_window); | 312 observer.OnRootWindowAdded(root_window); |
313 } | 313 } |
314 | 314 |
315 void Shell::CreateKeyboard() { | 315 void Shell::CreateKeyboard() { |
316 // TODO(bshe): Primary root window controller may not be the controller to | |
317 // attach virtual keyboard. See http://crbug.com/303429 | |
318 InitKeyboard(); | 316 InitKeyboard(); |
319 GetPrimaryRootWindowController()->ActivateKeyboard( | 317 GetPrimaryRootWindowController()->ActivateKeyboard( |
320 keyboard::KeyboardController::GetInstance()); | 318 keyboard::KeyboardController::GetInstance()); |
321 } | 319 } |
322 | 320 |
323 void Shell::DeactivateKeyboard() { | 321 void Shell::DeactivateKeyboard() { |
324 // TODO(jamescook): Move keyboard create and hide into WmShell. | 322 // TODO(jamescook): Move keyboard create and hide into WmShell. |
325 wm_shell_->keyboard_ui()->Hide(); | 323 wm_shell_->keyboard_ui()->Hide(); |
326 if (keyboard::KeyboardController::GetInstance()) { | 324 if (keyboard::KeyboardController::GetInstance()) { |
327 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 325 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 void Shell::InitKeyboard() { | 835 void Shell::InitKeyboard() { |
838 if (keyboard::IsKeyboardEnabled()) { | 836 if (keyboard::IsKeyboardEnabled()) { |
839 if (keyboard::KeyboardController::GetInstance()) { | 837 if (keyboard::KeyboardController::GetInstance()) { |
840 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 838 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
841 for (RootWindowControllerList::iterator iter = controllers.begin(); | 839 for (RootWindowControllerList::iterator iter = controllers.begin(); |
842 iter != controllers.end(); ++iter) { | 840 iter != controllers.end(); ++iter) { |
843 (*iter)->DeactivateKeyboard( | 841 (*iter)->DeactivateKeyboard( |
844 keyboard::KeyboardController::GetInstance()); | 842 keyboard::KeyboardController::GetInstance()); |
845 } | 843 } |
846 } | 844 } |
845 #if defined(OS_CHROMEOS) | |
oshima
2016/11/08 17:26:05
do you need this? (ash is technically chromeos)
yhanada
2016/11/14 22:48:47
Yes, because the definition of |virtual_keyboard_c
| |
847 keyboard::KeyboardController::ResetInstance( | 846 keyboard::KeyboardController::ResetInstance( |
848 new keyboard::KeyboardController( | 847 new keyboard::KeyboardController( |
849 wm_shell_->delegate()->CreateKeyboardUI())); | 848 wm_shell_->delegate()->CreateKeyboardUI(), |
849 virtual_keyboard_controller_.get())); | |
850 #else | |
851 keyboard::KeyboardController::ResetInstance( | |
852 new keyboard::KeyboardController( | |
853 wm_shell_->delegate()->CreateKeyboardUI(), nullptr)); | |
854 | |
855 #endif | |
850 } | 856 } |
851 } | 857 } |
852 | 858 |
853 void Shell::InitRootWindow(aura::Window* root_window) { | 859 void Shell::InitRootWindow(aura::Window* root_window) { |
854 DCHECK(activation_client_); | 860 DCHECK(activation_client_); |
855 DCHECK(visibility_controller_.get()); | 861 DCHECK(visibility_controller_.get()); |
856 DCHECK(drag_drop_controller_.get()); | 862 DCHECK(drag_drop_controller_.get()); |
857 | 863 |
858 aura::client::SetFocusClient(root_window, focus_client_.get()); | 864 aura::client::SetFocusClient(root_window, focus_client_.get()); |
859 aura::client::SetActivationClient(root_window, activation_client_); | 865 aura::client::SetActivationClient(root_window, activation_client_); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 903 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
898 return std::unique_ptr<ui::EventTargetIterator>(); | 904 return std::unique_ptr<ui::EventTargetIterator>(); |
899 } | 905 } |
900 | 906 |
901 ui::EventTargeter* Shell::GetEventTargeter() { | 907 ui::EventTargeter* Shell::GetEventTargeter() { |
902 NOTREACHED(); | 908 NOTREACHED(); |
903 return nullptr; | 909 return nullptr; |
904 } | 910 } |
905 | 911 |
906 } // namespace ash | 912 } // namespace ash |
OLD | NEW |