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

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

Issue 1128173003: Implements onBoundsChanged event in virtualKeyboardPrivate namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 7 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
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 <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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 keyboard_visible_(false), 204 keyboard_visible_(false),
205 show_on_resize_(false), 205 show_on_resize_(false),
206 lock_keyboard_(false), 206 lock_keyboard_(false),
207 keyboard_mode_(FULL_WIDTH), 207 keyboard_mode_(FULL_WIDTH),
208 type_(ui::TEXT_INPUT_TYPE_NONE), 208 type_(ui::TEXT_INPUT_TYPE_NONE),
209 weak_factory_(this) { 209 weak_factory_(this) {
210 CHECK(proxy); 210 CHECK(proxy);
211 input_method_ = proxy_->GetInputMethod(); 211 input_method_ = proxy_->GetInputMethod();
212 input_method_->AddObserver(this); 212 input_method_->AddObserver(this);
213 window_bounds_observer_.reset(new WindowBoundsChangeObserver()); 213 window_bounds_observer_.reset(new WindowBoundsChangeObserver());
214 proxy_->SetController(this);
214 } 215 }
215 216
216 KeyboardController::~KeyboardController() { 217 KeyboardController::~KeyboardController() {
217 if (container_) { 218 if (container_) {
218 if (container_->GetRootWindow()) 219 if (container_->GetRootWindow())
219 container_->GetRootWindow()->RemoveObserver(this); 220 container_->GetRootWindow()->RemoveObserver(this);
220 container_->RemoveObserver(this); 221 container_->RemoveObserver(this);
221 } 222 }
222 if (input_method_) 223 if (input_method_)
223 input_method_->RemoveObserver(this); 224 input_method_->RemoveObserver(this);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 proxy_->HideKeyboardContainer(container_.get()); 586 proxy_->HideKeyboardContainer(container_.get());
586 } 587 }
587 588
588 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { 589 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) {
589 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; 590 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr;
590 if (target_window) 591 if (target_window)
591 window_bounds_observer_->AddObservedWindow(target_window); 592 window_bounds_observer_->AddObservedWindow(target_window);
592 } 593 }
593 594
594 } // namespace keyboard 595 } // namespace keyboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698