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

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

Issue 2201323002: Simplify VirtualKeyboardTray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) { 264 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) {
265 observer_list_.AddObserver(observer); 265 observer_list_.AddObserver(observer);
266 } 266 }
267 267
268 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) { 268 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) {
269 observer_list_.RemoveObserver(observer); 269 observer_list_.RemoveObserver(observer);
270 } 270 }
271 271
272 bool KeyboardController::HasObserver(
273 KeyboardControllerObserver* observer) const {
274 return observer_list_.HasObserver(observer);
275 }
276
272 void KeyboardController::SetKeyboardMode(KeyboardMode mode) { 277 void KeyboardController::SetKeyboardMode(KeyboardMode mode) {
273 if (keyboard_mode_ == mode) 278 if (keyboard_mode_ == mode)
274 return; 279 return;
275 280
276 keyboard_mode_ = mode; 281 keyboard_mode_ = mode;
277 // When keyboard is floating, no overscroll or resize is necessary. Sets 282 // When keyboard is floating, no overscroll or resize is necessary. Sets
278 // keyboard bounds to zero so overscroll or resize is disabled. 283 // keyboard bounds to zero so overscroll or resize is disabled.
279 if (keyboard_mode_ == FLOATING) { 284 if (keyboard_mode_ == FLOATING) {
280 NotifyKeyboardBoundsChanging(gfx::Rect()); 285 NotifyKeyboardBoundsChanging(gfx::Rect());
281 } else if (keyboard_mode_ == FULL_WIDTH) { 286 } else if (keyboard_mode_ == FULL_WIDTH) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // background during animation. 487 // background during animation.
483 NotifyKeyboardBoundsChanging(container_->bounds()); 488 NotifyKeyboardBoundsChanging(container_->bounds());
484 ui_->EnsureCaretInWorkArea(); 489 ui_->EnsureCaretInWorkArea();
485 } 490 }
486 491
487 void KeyboardController::HideAnimationFinished() { 492 void KeyboardController::HideAnimationFinished() {
488 ui_->HideKeyboardContainer(container_.get()); 493 ui_->HideKeyboardContainer(container_.get());
489 } 494 }
490 495
491 } // namespace keyboard 496 } // namespace keyboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698