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

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

Issue 2814863002: cros: Allow JS to control virtual keyboard on sign-in screen. (Closed)
Patch Set: Remove login_display_host_impl.cc keyboard logic Created 3 years, 8 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 | « ui/keyboard/keyboard_controller.h ('k') | ui/login/display_manager.js » ('j') | 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 <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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 gfx::Transform transform; 267 gfx::Transform transform;
268 transform.Translate(0, kAnimationDistance); 268 transform.Translate(0, kAnimationDistance);
269 container_->SetTransform(transform); 269 container_->SetTransform(transform);
270 container_->layer()->SetOpacity(kAnimationStartOrAfterHideOpacity); 270 container_->layer()->SetOpacity(kAnimationStartOrAfterHideOpacity);
271 } 271 }
272 272
273 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) { 273 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) {
274 observer_list_.AddObserver(observer); 274 observer_list_.AddObserver(observer);
275 } 275 }
276 276
277 bool KeyboardController::HasObserver(KeyboardControllerObserver* observer) {
278 return observer_list_.HasObserver(observer);
279 }
280
277 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) { 281 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) {
278 observer_list_.RemoveObserver(observer); 282 observer_list_.RemoveObserver(observer);
279 } 283 }
280 284
281 void KeyboardController::SetKeyboardMode(KeyboardMode mode) { 285 void KeyboardController::SetKeyboardMode(KeyboardMode mode) {
282 if (keyboard_mode_ == mode) 286 if (keyboard_mode_ == mode)
283 return; 287 return;
284 288
285 keyboard_mode_ = mode; 289 keyboard_mode_ = mode;
286 // When keyboard is floating, no overscroll or resize is necessary. Sets 290 // When keyboard is floating, no overscroll or resize is necessary. Sets
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 int keyboard_height = GetContainerWindow()->bounds().height(); 526 int keyboard_height = GetContainerWindow()->bounds().height();
523 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); 527 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds();
524 gfx::Rect new_bounds = root_bounds; 528 gfx::Rect new_bounds = root_bounds;
525 new_bounds.set_y(root_bounds.height() - keyboard_height); 529 new_bounds.set_y(root_bounds.height() - keyboard_height);
526 new_bounds.set_height(keyboard_height); 530 new_bounds.set_height(keyboard_height);
527 GetContainerWindow()->SetBounds(new_bounds); 531 GetContainerWindow()->SetBounds(new_bounds);
528 } 532 }
529 } 533 }
530 534
531 } // namespace keyboard 535 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/login/display_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698