Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: ui/keyboard/keyboard_controller.cc

Issue 25105002: Deletes keyboard container before recreating the controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/aura/layout_manager.h" 8 #include "ui/aura/layout_manager.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_delegate.h" 10 #include "ui/aura/window_delegate.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 container_(NULL), 125 container_(NULL),
126 input_method_(NULL), 126 input_method_(NULL),
127 keyboard_visible_(false), 127 keyboard_visible_(false),
128 weak_factory_(this) { 128 weak_factory_(this) {
129 CHECK(proxy); 129 CHECK(proxy);
130 input_method_ = proxy_->GetInputMethod(); 130 input_method_ = proxy_->GetInputMethod();
131 input_method_->AddObserver(this); 131 input_method_->AddObserver(this);
132 } 132 }
133 133
134 KeyboardController::~KeyboardController() { 134 KeyboardController::~KeyboardController() {
135 if (container_) 135 if (container_) {
136 container_->RemoveObserver(this); 136 container_->RemoveObserver(this);
137 container_->SetLayoutManager(NULL);
sadrul 2013/09/27 20:25:16 The container window takes ownership of the layout
138 }
137 if (input_method_) 139 if (input_method_)
138 input_method_->RemoveObserver(this); 140 input_method_->RemoveObserver(this);
139 } 141 }
140 142
141 aura::Window* KeyboardController::GetContainerWindow() { 143 aura::Window* KeyboardController::GetContainerWindow() {
142 if (!container_) { 144 if (!container_) {
143 container_ = new aura::Window(new KeyboardWindowDelegate()); 145 container_ = new aura::Window(new KeyboardWindowDelegate());
144 container_->SetName("KeyboardContainer"); 146 container_->SetName("KeyboardContainer");
145 container_->Init(ui::LAYER_NOT_DRAWN); 147 container_->Init(ui::LAYER_NOT_DRAWN);
146 container_->AddObserver(this); 148 container_->AddObserver(this);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 const ui::InputMethod* input_method) { 235 const ui::InputMethod* input_method) {
234 DCHECK_EQ(input_method_, input_method); 236 DCHECK_EQ(input_method_, input_method);
235 input_method_ = NULL; 237 input_method_ = NULL;
236 } 238 }
237 239
238 bool KeyboardController::WillHideKeyboard() const { 240 bool KeyboardController::WillHideKeyboard() const {
239 return weak_factory_.HasWeakPtrs(); 241 return weak_factory_.HasWeakPtrs();
240 } 242 }
241 243
242 } // namespace keyboard 244 } // namespace keyboard
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698