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/container_priorities.h" |
7 #include "athena/common/fill_layout_manager.h" | 8 #include "athena/common/fill_layout_manager.h" |
8 #include "athena/screen/public/screen_manager.h" | 9 #include "athena/screen/public/screen_manager.h" |
9 #include "athena/virtual_keyboard/vk_webui_controller.h" | 10 #include "athena/virtual_keyboard/vk_webui_controller.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
14 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
15 #include "ui/aura/layout_manager.h" | 16 #include "ui/aura/layout_manager.h" |
16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 70 |
70 virtual ~VirtualKeyboardManagerImpl() { | 71 virtual ~VirtualKeyboardManagerImpl() { |
71 CHECK_EQ(this, instance); | 72 CHECK_EQ(this, instance); |
72 instance = NULL; | 73 instance = NULL; |
73 | 74 |
74 keyboard::KeyboardController::ResetInstance(NULL); | 75 keyboard::KeyboardController::ResetInstance(NULL); |
75 } | 76 } |
76 | 77 |
77 private: | 78 private: |
78 void Init() { | 79 void Init() { |
79 athena::ScreenManager::ContainerParams params("VirtualKeyboardContainer"); | 80 athena::ScreenManager::ContainerParams params("VirtualKeyboardContainer", |
| 81 CP_VIRTUAL_KEYBOARD); |
80 container_ = athena::ScreenManager::Get()->CreateContainer(params); | 82 container_ = athena::ScreenManager::Get()->CreateContainer(params); |
81 container_->SetLayoutManager(new FillLayoutManager(container_)); | 83 container_->SetLayoutManager(new FillLayoutManager(container_)); |
82 keyboard::SetOverrideContentUrl(GURL(keyboard::kKeyboardURL)); | 84 keyboard::SetOverrideContentUrl(GURL(keyboard::kKeyboardURL)); |
83 | 85 |
84 keyboard_controller_.reset(new keyboard::KeyboardController( | 86 keyboard_controller_.reset(new keyboard::KeyboardController( |
85 new BasicKeyboardControllerProxy(browser_context_, | 87 new BasicKeyboardControllerProxy(browser_context_, |
86 container_->GetRootWindow()))); | 88 container_->GetRootWindow()))); |
87 keyboard::KeyboardController::ResetInstance(keyboard_controller_.get()); | 89 keyboard::KeyboardController::ResetInstance(keyboard_controller_.get()); |
88 aura::Window* kb_container = keyboard_controller_->GetContainerWindow(); | 90 aura::Window* kb_container = keyboard_controller_->GetContainerWindow(); |
89 container_->AddChild(kb_container); | 91 container_->AddChild(kb_container); |
(...skipping 26 matching lines...) Expand all Loading... |
116 return instance; | 118 return instance; |
117 } | 119 } |
118 | 120 |
119 void VirtualKeyboardManager::Shutdown() { | 121 void VirtualKeyboardManager::Shutdown() { |
120 CHECK(instance); | 122 CHECK(instance); |
121 delete instance; | 123 delete instance; |
122 CHECK(!instance); | 124 CHECK(!instance); |
123 } | 125 } |
124 | 126 |
125 } // namespace athena | 127 } // namespace athena |
OLD | NEW |