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

Unified Diff: ash/root_window_controller.cc

Issue 17063013: Separate projection mode from rest of touch HUD (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed TouchHudDebug and applied some more reviews Created 7 years, 6 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
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index af6e946c19ac68e1b358e9c6784e767b3267fa7f..ce85bcb387861eb765a2804d7c7434aacd619f86 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -22,7 +22,8 @@
#include "ash/shell_window_ids.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray_delegate.h"
-#include "ash/touch/touch_observer_hud.h"
+#include "ash/touch/touch_hud_debug.h"
+#include "ash/touch/touch_hud_projection.h"
#include "ash/wm/base_layout_manager.h"
#include "ash/wm/boot_splash_screen.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
@@ -170,7 +171,8 @@ RootWindowController::RootWindowController(aura::RootWindow* root_window)
root_window_layout_(NULL),
docked_layout_manager_(NULL),
panel_layout_manager_(NULL),
- touch_observer_hud_(NULL) {
+ touch_hud_debug_(NULL),
+ touch_hud_projection_(NULL) {
SetRootWindowController(root_window, this);
screen_dimmer_.reset(new ScreenDimmer(root_window));
@@ -304,12 +306,6 @@ void RootWindowController::InitForPrimaryDisplay() {
void RootWindowController::CreateContainers() {
CreateContainersInRootWindow(root_window_.get());
-
- // Create touch observer HUD if needed. HUD should be created after the
- // containers have been created, so that its widget can be added to them.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kAshTouchHud))
- touch_observer_hud_ = new TouchObserverHUD(root_window_.get());
}
void RootWindowController::CreateSystemBackground(
@@ -415,6 +411,18 @@ void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) {
ReparentAllWindows(root_window_.get(), dst);
}
+void RootWindowController::EnableTouchHudProjection() {
+ if (touch_hud_projection_)
+ return;
+ set_touch_hud_projection(new TouchHudProjection(root_window_.get()));
+}
+
+void RootWindowController::DisableTouchHudProjection() {
+ if (!touch_hud_projection_)
+ return;
+ touch_hud_projection_->Remove();
+}
+
ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() {
return shelf_.get() ? shelf_->shelf_layout_manager() : NULL;
}
@@ -457,6 +465,14 @@ void RootWindowController::UpdateShelfVisibility() {
shelf_->shelf_layout_manager()->UpdateVisibilityState();
}
+void RootWindowController::InitTouchHuds() {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kAshTouchHud))
+ set_touch_hud_debug(new TouchHudDebug(root_window_.get()));
+ if (Shell::GetInstance()->is_touch_hud_projection_enabled())
+ EnableTouchHudProjection();
+}
+
aura::Window* RootWindowController::GetFullscreenWindow() const {
aura::Window* container = workspace_controller_->GetActiveWorkspaceWindow();
for (size_t i = 0; i < container->children().size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698