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..565b42993f8c07db222296d0b084f5ab8df61b11 100644 |
--- a/ash/ash_touch_exploration_manager_chromeos.cc |
+++ b/ash/ash_touch_exploration_manager_chromeos.cc |
@@ -18,6 +18,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 { |
@@ -36,6 +37,10 @@ AshTouchExplorationManager::AshTouchExplorationManager( |
} |
AshTouchExplorationManager::~AshTouchExplorationManager() { |
+ keyboard::KeyboardController* keyboard_controller = |
+ keyboard::KeyboardController::GetInstance(); |
+ if (keyboard_controller) |
+ keyboard_controller->RemoveObserver(this); |
Daniel Erat
2017/05/26 16:33:38
yes, please use ScopedObserver. this is still wron
David Tseng
2017/05/26 21:13:47
Sorry, I must be mistaken, but removing if not pre
Daniel Erat
2017/05/26 21:37:23
it's standard practice in chrome to keep track of
David Tseng
2017/05/30 16:45:29
Sort of (indirectly through ShellObserver). There
|
SystemTrayNotifier* system_tray_notifier = |
Shell::Get()->system_tray_notifier(); |
if (system_tray_notifier) |
@@ -142,6 +147,15 @@ void AshTouchExplorationManager::SetTouchAccessibilityAnchorPoint( |
} |
} |
+void AshTouchExplorationManager::OnKeyboardBoundsChanging( |
+ const gfx::Rect& new_bounds) { |
+ UpdateTouchExplorationState(); |
+} |
+ |
+void AshTouchExplorationManager::OnKeyboardClosed() { |
+ UpdateTouchExplorationState(); |
+} |
+ |
void AshTouchExplorationManager::UpdateTouchExplorationState() { |
// See crbug.com/603745 for more details. |
const bool pass_through_surface = |
@@ -176,6 +190,17 @@ void AshTouchExplorationManager::UpdateTouchExplorationState() { |
} else { |
touch_exploration_controller_->SetExcludeBounds(gfx::Rect()); |
} |
+ |
+ // Virtual keyboard. |
+ keyboard::KeyboardController* keyboard_controller = |
+ keyboard::KeyboardController::GetInstance(); |
+ if (keyboard_controller) { |
+ if (!keyboard_controller->HasObserver(this)) |
+ keyboard_controller->AddObserver(this); |
+ |
+ touch_exploration_controller_->SetLiftActivationBounds( |
+ keyboard_controller->current_keyboard_bounds()); |
+ } |
} else { |
touch_exploration_controller_.reset(); |
} |