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

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

Issue 2864413003: Fix 'VirtualKeyboard.InitLatency.FirstLoad' metrics to be recorded for any keyboards. (Closed)
Patch Set: rebase Created 3 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 container_->SetTransform(gfx::Transform()); 503 container_->SetTransform(gfx::Transform());
504 container_->layer()->SetOpacity(1.0); 504 container_->layer()->SetOpacity(1.0);
505 } 505 }
506 } 506 }
507 507
508 bool KeyboardController::WillHideKeyboard() const { 508 bool KeyboardController::WillHideKeyboard() const {
509 return weak_factory_.HasWeakPtrs(); 509 return weak_factory_.HasWeakPtrs();
510 } 510 }
511 511
512 void KeyboardController::ShowAnimationFinished() { 512 void KeyboardController::ShowAnimationFinished() {
513 MarkKeyboardLoadFinished();
514
513 // Notify observers after animation finished to prevent reveal desktop 515 // Notify observers after animation finished to prevent reveal desktop
514 // background during animation. 516 // background during animation.
515 NotifyKeyboardBoundsChanging(container_->bounds()); 517 NotifyKeyboardBoundsChanging(container_->bounds());
516 ui_->EnsureCaretInWorkArea(); 518 ui_->EnsureCaretInWorkArea();
517 } 519 }
518 520
519 void KeyboardController::HideAnimationFinished() { 521 void KeyboardController::HideAnimationFinished() {
520 ui_->HideKeyboardContainer(container_.get()); 522 ui_->HideKeyboardContainer(container_.get());
521 for (KeyboardControllerObserver& observer : observer_list_) 523 for (KeyboardControllerObserver& observer : observer_list_)
522 observer.OnKeyboardHidden(); 524 observer.OnKeyboardHidden();
(...skipping 11 matching lines...) Expand all
534 int keyboard_height = GetContainerWindow()->bounds().height(); 536 int keyboard_height = GetContainerWindow()->bounds().height();
535 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds(); 537 const gfx::Rect& root_bounds = container_->GetRootWindow()->bounds();
536 gfx::Rect new_bounds = root_bounds; 538 gfx::Rect new_bounds = root_bounds;
537 new_bounds.set_y(root_bounds.height() - keyboard_height); 539 new_bounds.set_y(root_bounds.height() - keyboard_height);
538 new_bounds.set_height(keyboard_height); 540 new_bounds.set_height(keyboard_height);
539 GetContainerWindow()->SetBounds(new_bounds); 541 GetContainerWindow()->SetBounds(new_bounds);
540 } 542 }
541 } 543 }
542 544
543 } // namespace keyboard 545 } // namespace keyboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698