OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/virtual_keyboard/public/virtual_keyboard_manager.h" | 5 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
6 | 6 |
7 #include "athena/common/fill_layout_manager.h" | 7 #include "athena/common/fill_layout_manager.h" |
8 #include "athena/screen/public/screen_manager.h" | 8 #include "athena/screen/public/screen_manager.h" |
9 #include "athena/virtual_keyboard/vk_webui_controller.h" | 9 #include "athena/virtual_keyboard/vk_webui_controller.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 virtual ~VirtualKeyboardManagerImpl() { | 70 virtual ~VirtualKeyboardManagerImpl() { |
71 CHECK_EQ(this, instance); | 71 CHECK_EQ(this, instance); |
72 instance = NULL; | 72 instance = NULL; |
73 | 73 |
74 keyboard::KeyboardController::ResetInstance(NULL); | 74 keyboard::KeyboardController::ResetInstance(NULL); |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 void Init() { | 78 void Init() { |
79 container_ = athena::ScreenManager::Get()->CreateContainer( | 79 athena::ScreenManager::ContainerParams params("VirtualKeyboardContainer"); |
80 "VirtualKeyboardContainer"); | 80 container_ = athena::ScreenManager::Get()->CreateContainer(params); |
81 container_->SetLayoutManager(new FillLayoutManager(container_)); | 81 container_->SetLayoutManager(new FillLayoutManager(container_)); |
82 keyboard::SetOverrideContentUrl(GURL(keyboard::kKeyboardURL)); | 82 keyboard::SetOverrideContentUrl(GURL(keyboard::kKeyboardURL)); |
83 | 83 |
84 keyboard_controller_.reset(new keyboard::KeyboardController( | 84 keyboard_controller_.reset(new keyboard::KeyboardController( |
85 new BasicKeyboardControllerProxy(browser_context_, | 85 new BasicKeyboardControllerProxy(browser_context_, |
86 container_->GetRootWindow()))); | 86 container_->GetRootWindow()))); |
87 keyboard::KeyboardController::ResetInstance(keyboard_controller_.get()); | 87 keyboard::KeyboardController::ResetInstance(keyboard_controller_.get()); |
88 aura::Window* kb_container = keyboard_controller_->GetContainerWindow(); | 88 aura::Window* kb_container = keyboard_controller_->GetContainerWindow(); |
89 container_->AddChild(kb_container); | 89 container_->AddChild(kb_container); |
90 kb_container->Show(); | 90 kb_container->Show(); |
(...skipping 25 matching lines...) Expand all Loading... |
116 return instance; | 116 return instance; |
117 } | 117 } |
118 | 118 |
119 void VirtualKeyboardManager::Shutdown() { | 119 void VirtualKeyboardManager::Shutdown() { |
120 CHECK(instance); | 120 CHECK(instance); |
121 delete instance; | 121 delete instance; |
122 CHECK(!instance); | 122 CHECK(!instance); |
123 } | 123 } |
124 | 124 |
125 } // namespace athena | 125 } // namespace athena |
OLD | NEW |