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

Unified Diff: ash/ash_touch_exploration_manager_chromeos.cc

Issue 2880043002: Implement touch exploration touch typing (Closed)
Patch Set: Add comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.h ('k') | ui/chromeos/touch_exploration_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ash_touch_exploration_manager_chromeos.cc
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
index 6120ffbf4de19d4c49fe0ea4118585cf05818dad..58cda1d7dd1c59cbee1b67e97ac96c35cc40750a 100644
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -5,6 +5,7 @@
#include "ash/ash_touch_exploration_manager_chromeos.h"
#include "ash/accessibility_delegate.h"
+#include "ash/keyboard/keyboard_observer_register.h"
#include "ash/root_window_controller.h"
#include "ash/shared/app_types.h"
#include "ash/shell.h"
@@ -18,6 +19,7 @@
#include "chromeos/chromeos_switches.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/chromeos/touch_exploration_controller.h"
+#include "ui/keyboard/keyboard_controller.h"
#include "ui/wm/public/activation_client.h"
namespace ash {
@@ -28,7 +30,9 @@ AshTouchExplorationManager::AshTouchExplorationManager(
audio_handler_(chromeos::CrasAudioHandler::Get()),
enable_chromevox_arc_support_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kEnableChromeVoxArcSupport)) {
+ chromeos::switches::kEnableChromeVoxArcSupport)),
+ keyboard_observer_(this) {
+ Shell::Get()->AddShellObserver(this);
Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
Shell::Get()->activation_client()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this);
@@ -42,6 +46,7 @@ AshTouchExplorationManager::~AshTouchExplorationManager() {
system_tray_notifier->RemoveAccessibilityObserver(this);
Shell::Get()->activation_client()->RemoveObserver(this);
display::Screen::GetScreen()->RemoveObserver(this);
+ Shell::Get()->RemoveShellObserver(this);
}
void AshTouchExplorationManager::OnAccessibilityModeChanged(
@@ -142,6 +147,24 @@ void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint(
}
}
+void AshTouchExplorationManager::OnKeyboardBoundsChanging(
+ const gfx::Rect& new_bounds) {
+ UpdateTouchExplorationState();
+}
+
+void AshTouchExplorationManager::OnKeyboardClosed() {
+ keyboard_observer_.RemoveAll();
+ UpdateTouchExplorationState();
+}
+
+void AshTouchExplorationManager::OnVirtualKeyboardStateChanged(
+ bool activated,
+ aura::Window* root_window) {
+ UpdateKeyboardObserverFromStateChanged(
+ activated, root_window, root_window_controller_->GetRootWindow(),
+ &keyboard_observer_);
+}
+
void AshTouchExplorationManager::UpdateTouchExplorationState() {
// See crbug.com/603745 for more details.
const bool pass_through_surface =
@@ -176,6 +199,14 @@ void AshTouchExplorationManager::UpdateTouchExplorationState() {
} else {
touch_exploration_controller_->SetExcludeBounds(gfx::Rect());
}
+
+ // Virtual keyboard.
+ keyboard::KeyboardController* keyboard_controller =
+ keyboard::KeyboardController::GetInstance();
+ if (keyboard_controller) {
+ touch_exploration_controller_->SetLiftActivationBounds(
+ keyboard_controller->current_keyboard_bounds());
+ }
} else {
touch_exploration_controller_.reset();
}
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.h ('k') | ui/chromeos/touch_exploration_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698