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

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

Issue 574033003: Remove keyboard usability mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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"
11 #include "content/public/browser/render_widget_host.h" 11 #include "content/public/browser/render_widget_host.h"
12 #include "content/public/browser/render_widget_host_iterator.h" 12 #include "content/public/browser/render_widget_host_iterator.h"
13 #include "content/public/browser/render_widget_host_view.h" 13 #include "content/public/browser/render_widget_host_view.h"
14 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
15 #include "ui/aura/window_delegate.h" 15 #include "ui/aura/window_delegate.h"
16 #include "ui/aura/window_observer.h" 16 #include "ui/aura/window_observer.h"
17 #include "ui/base/cursor/cursor.h" 17 #include "ui/base/cursor/cursor.h"
18 #include "ui/base/hit_test.h" 18 #include "ui/base/hit_test.h"
19 #include "ui/base/ime/input_method.h" 19 #include "ui/base/ime/input_method.h"
20 #include "ui/base/ime/text_input_client.h" 20 #include "ui/base/ime/text_input_client.h"
21 #include "ui/compositor/layer_animation_observer.h" 21 #include "ui/compositor/layer_animation_observer.h"
22 #include "ui/compositor/scoped_layer_animation_settings.h" 22 #include "ui/compositor/scoped_layer_animation_settings.h"
23 #include "ui/gfx/path.h" 23 #include "ui/gfx/path.h"
24 #include "ui/gfx/rect.h" 24 #include "ui/gfx/rect.h"
25 #include "ui/gfx/skia_util.h" 25 #include "ui/gfx/skia_util.h"
26 #include "ui/keyboard/keyboard_controller_observer.h" 26 #include "ui/keyboard/keyboard_controller_observer.h"
27 #include "ui/keyboard/keyboard_controller_proxy.h" 27 #include "ui/keyboard/keyboard_controller_proxy.h"
28 #include "ui/keyboard/keyboard_layout_manager.h" 28 #include "ui/keyboard/keyboard_layout_manager.h"
29 #include "ui/keyboard/keyboard_switches.h" 29 #include "ui/keyboard/keyboard_switches.h"
oshima 2014/09/16 16:59:26 do you need this?
bshe 2014/09/16 18:10:31 removed
30 #include "ui/keyboard/keyboard_util.h" 30 #include "ui/keyboard/keyboard_util.h"
31 #include "ui/wm/core/masked_window_targeter.h" 31 #include "ui/wm/core/masked_window_targeter.h"
32 32
33 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
34 #include "base/process/launch.h" 34 #include "base/process/launch.h"
35 #include "base/sys_info.h" 35 #include "base/sys_info.h"
36 #endif 36 #endif
37 37
38 namespace { 38 namespace {
39 39
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 show_on_resize_ = false; 401 show_on_resize_ = false;
402 proxy_->ReloadKeyboardIfNeeded(); 402 proxy_->ReloadKeyboardIfNeeded();
403 } 403 }
404 } 404 }
405 405
406 void KeyboardController::OnTextInputStateChanged( 406 void KeyboardController::OnTextInputStateChanged(
407 const ui::TextInputClient* client) { 407 const ui::TextInputClient* client) {
408 if (!container_.get()) 408 if (!container_.get())
409 return; 409 return;
410 410
411 if (IsKeyboardUsabilityExperimentEnabled()) {
412 ShowKeyboardInternal();
413 return;
414 }
415
416 type_ = client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; 411 type_ = client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
417 412
418 if (type_ == ui::TEXT_INPUT_TYPE_NONE && !lock_keyboard_) { 413 if (type_ == ui::TEXT_INPUT_TYPE_NONE && !lock_keyboard_) {
419 if (keyboard_visible_) { 414 if (keyboard_visible_) {
420 // Set the visibility state here so that any queries for visibility 415 // Set the visibility state here so that any queries for visibility
421 // before the timer fires returns the correct future value. 416 // before the timer fires returns the correct future value.
422 keyboard_visible_ = false; 417 keyboard_visible_ = false;
423 base::MessageLoop::current()->PostDelayedTask( 418 base::MessageLoop::current()->PostDelayedTask(
424 FROM_HERE, 419 FROM_HERE,
425 base::Bind(&KeyboardController::HideKeyboard, 420 base::Bind(&KeyboardController::HideKeyboard,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 proxy_->HideKeyboardContainer(container_.get()); 574 proxy_->HideKeyboardContainer(container_.get());
580 } 575 }
581 576
582 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { 577 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) {
583 aura::Window* target_window = GetFrameWindow(window); 578 aura::Window* target_window = GetFrameWindow(window);
584 if (target_window) 579 if (target_window)
585 window_bounds_observer_->AddObservedWindow(target_window); 580 window_bounds_observer_->AddObservedWindow(target_window);
586 } 581 }
587 582
588 } // namespace keyboard 583 } // namespace keyboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698