| 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/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
| 8 #include "athena/util/container_priorities.h" | 8 #include "athena/util/container_priorities.h" |
| 9 #include "athena/util/fill_layout_manager.h" | 9 #include "athena/util/fill_layout_manager.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 private: | 55 private: |
| 56 content::BrowserContext* browser_context_; | 56 content::BrowserContext* browser_context_; |
| 57 aura::Window* root_window_; | 57 aura::Window* root_window_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(BasicKeyboardControllerProxy); | 59 DISALLOW_COPY_AND_ASSIGN(BasicKeyboardControllerProxy); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 class VirtualKeyboardManagerImpl : public VirtualKeyboardManager { | 62 class VirtualKeyboardManagerImpl : public VirtualKeyboardManager { |
| 63 public: | 63 public: |
| 64 explicit VirtualKeyboardManagerImpl(content::BrowserContext* browser_context) | 64 explicit VirtualKeyboardManagerImpl(content::BrowserContext* browser_context) |
| 65 : browser_context_(browser_context), | 65 : browser_context_(browser_context), container_(nullptr) { |
| 66 container_(NULL) { | |
| 67 CHECK(!instance); | 66 CHECK(!instance); |
| 68 instance = this; | 67 instance = this; |
| 69 Init(); | 68 Init(); |
| 70 } | 69 } |
| 71 | 70 |
| 72 virtual ~VirtualKeyboardManagerImpl() { | 71 virtual ~VirtualKeyboardManagerImpl() { |
| 73 CHECK_EQ(this, instance); | 72 CHECK_EQ(this, instance); |
| 74 instance = NULL; | 73 instance = nullptr; |
| 75 | 74 |
| 76 keyboard::KeyboardController::ResetInstance(NULL); | 75 keyboard::KeyboardController::ResetInstance(nullptr); |
| 77 } | 76 } |
| 78 | 77 |
| 79 private: | 78 private: |
| 80 void Init() { | 79 void Init() { |
| 81 athena::ScreenManager::ContainerParams params("VirtualKeyboardContainer", | 80 athena::ScreenManager::ContainerParams params("VirtualKeyboardContainer", |
| 82 CP_VIRTUAL_KEYBOARD); | 81 CP_VIRTUAL_KEYBOARD); |
| 83 container_ = athena::ScreenManager::Get()->CreateContainer(params); | 82 container_ = athena::ScreenManager::Get()->CreateContainer(params); |
| 84 container_->SetLayoutManager(new FillLayoutManager(container_)); | 83 container_->SetLayoutManager(new FillLayoutManager(container_)); |
| 85 | 84 |
| 86 keyboard::KeyboardController* controller = new keyboard::KeyboardController( | 85 keyboard::KeyboardController* controller = new keyboard::KeyboardController( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return instance; | 117 return instance; |
| 119 } | 118 } |
| 120 | 119 |
| 121 void VirtualKeyboardManager::Shutdown() { | 120 void VirtualKeyboardManager::Shutdown() { |
| 122 CHECK(instance); | 121 CHECK(instance); |
| 123 delete instance; | 122 delete instance; |
| 124 CHECK(!instance); | 123 CHECK(!instance); |
| 125 } | 124 } |
| 126 | 125 |
| 127 } // namespace athena | 126 } // namespace athena |
| OLD | NEW |