OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 input_method_ = ui_->GetInputMethod(); | 178 input_method_ = ui_->GetInputMethod(); |
179 input_method_->AddObserver(this); | 179 input_method_->AddObserver(this); |
180 ui_->SetController(this); | 180 ui_->SetController(this); |
181 } | 181 } |
182 | 182 |
183 KeyboardController::~KeyboardController() { | 183 KeyboardController::~KeyboardController() { |
184 if (container_) { | 184 if (container_) { |
185 if (container_->GetRootWindow()) | 185 if (container_->GetRootWindow()) |
186 container_->GetRootWindow()->RemoveObserver(this); | 186 container_->GetRootWindow()->RemoveObserver(this); |
187 container_->RemoveObserver(this); | 187 container_->RemoveObserver(this); |
188 FOR_EACH_OBSERVER(KeyboardControllerObserver, observer_list_, | |
sky
2016/07/06 16:03:00
How come you're only calling OnKeyboardDestroyed()
Azure Wei
2016/07/08 06:35:24
Want to make sure the container_ has been created
| |
189 OnKeyboardDestroyed()); | |
188 } | 190 } |
189 if (input_method_) | 191 if (input_method_) |
190 input_method_->RemoveObserver(this); | 192 input_method_->RemoveObserver(this); |
191 ui_->SetController(nullptr); | 193 ui_->SetController(nullptr); |
192 } | 194 } |
193 | 195 |
194 // static | 196 // static |
195 void KeyboardController::ResetInstance(KeyboardController* controller) { | 197 void KeyboardController::ResetInstance(KeyboardController* controller) { |
196 if (instance_ && instance_ != controller) | 198 if (instance_ && instance_ != controller) |
197 delete instance_; | 199 delete instance_; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 // background during animation. | 484 // background during animation. |
483 NotifyKeyboardBoundsChanging(container_->bounds()); | 485 NotifyKeyboardBoundsChanging(container_->bounds()); |
484 ui_->EnsureCaretInWorkArea(); | 486 ui_->EnsureCaretInWorkArea(); |
485 } | 487 } |
486 | 488 |
487 void KeyboardController::HideAnimationFinished() { | 489 void KeyboardController::HideAnimationFinished() { |
488 ui_->HideKeyboardContainer(container_.get()); | 490 ui_->HideKeyboardContainer(container_.get()); |
489 } | 491 } |
490 | 492 |
491 } // namespace keyboard | 493 } // namespace keyboard |
OLD | NEW |