summaryrefslogtreecommitdiffstats
path: root/ash/touch
diff options
context:
space:
mode:
authoroshima <oshima@chromium.org>2015-07-27 18:18:52 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-28 01:19:26 +0000
commite28189248660c42b8e0cb9ad973638d7260b47b7 (patch)
tree90109ef81a619744a85b920d246f6d290c5c7a22 /ash/touch
parent4bf2ca554347fc20e1649e5ff4cf700d9fbd713a (diff)
downloadchromium_src-e28189248660c42b8e0cb9ad973638d7260b47b7.zip
chromium_src-e28189248660c42b8e0cb9ad973638d7260b47b7.tar.gz
chromium_src-e28189248660c42b8e0cb9ad973638d7260b47b7.tar.bz2
Rename DisplayController to WindowTreeHostManager
This class manages WTH <-> display mapping, and WTHManager is more appropriate than DisplayController. BUG=None Review URL: https://codereview.chromium.org/1262483003 Cr-Commit-Position: refs/heads/master@{#340624}
Diffstat (limited to 'ash/touch')
-rw-r--r--ash/touch/touch_observer_hud.cc9
-rw-r--r--ash/touch/touch_observer_hud.h6
-rw-r--r--ash/touch/touch_observer_hud_unittest.cc16
-rw-r--r--ash/touch/touch_transformer_controller.cc13
-rw-r--r--ash/touch/touch_transformer_controller.h6
5 files changed, 26 insertions, 24 deletions
diff --git a/ash/touch/touch_observer_hud.cc b/ash/touch/touch_observer_hud.cc
index 02f85ad..1ace7fd 100644
--- a/ash/touch/touch_observer_hud.cc
+++ b/ash/touch/touch_observer_hud.cc
@@ -51,12 +51,12 @@ TouchObserverHUD::TouchObserverHUD(aura::Window* initial_root)
Shell::GetInstance()->display_configurator()->AddObserver(this);
#endif // defined(OS_CHROMEOS)
- Shell::GetInstance()->display_controller()->AddObserver(this);
+ Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
root_window_->AddPreTargetHandler(this);
}
TouchObserverHUD::~TouchObserverHUD() {
- Shell::GetInstance()->display_controller()->RemoveObserver(this);
+ Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
#if defined(OS_CHROMEOS)
Shell::GetInstance()->display_configurator()->RemoveObserver(this);
@@ -136,8 +136,9 @@ void TouchObserverHUD::OnDisplayConfigurationChanged() {
if (root_window_)
return;
- root_window_ = Shell::GetInstance()->display_controller()->
- GetRootWindowForDisplayId(display_id_);
+ root_window_ = Shell::GetInstance()
+ ->window_tree_host_manager()
+ ->GetRootWindowForDisplayId(display_id_);
views::Widget::ReparentNativeView(
widget_->GetNativeView(),
diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h
index e678372..1a558ee 100644
--- a/ash/touch/touch_observer_hud.h
+++ b/ash/touch/touch_observer_hud.h
@@ -6,7 +6,7 @@
#define ASH_TOUCH_TOUCH_OBSERVER_HUD_H_
#include "ash/ash_export.h"
-#include "ash/display/display_controller.h"
+#include "ash/display/window_tree_host_manager.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/display_observer.h"
#include "ui/views/widget/widget_observer.h"
@@ -29,7 +29,7 @@ class ASH_EXPORT TouchObserverHUD : public ui::EventHandler,
#if defined(OS_CHROMEOS)
public ui::DisplayConfigurator::Observer,
#endif // defined(OS_CHROMEOS)
- public DisplayController::Observer {
+ public WindowTreeHostManager::Observer {
public:
// Called to clear touch points and traces from the screen. Default
// implementation does nothing. Sub-classes should implement appropriately.
@@ -70,7 +70,7 @@ class ASH_EXPORT TouchObserverHUD : public ui::EventHandler,
const ui::DisplayConfigurator::DisplayStateList& outputs) override;
#endif // defined(OS_CHROMEOS)
- // Overriden form DisplayController::Observer.
+ // Overriden form WindowTreeHostManager::Observer.
void OnDisplaysInitialized() override;
void OnDisplayConfigurationChanging() override;
void OnDisplayConfigurationChanged() override;
diff --git a/ash/touch/touch_observer_hud_unittest.cc b/ash/touch/touch_observer_hud_unittest.cc
index 7a3cf22..f7293a5 100644
--- a/ash/touch/touch_observer_hud_unittest.cc
+++ b/ash/touch/touch_observer_hud_unittest.cc
@@ -68,13 +68,13 @@ class TouchHudTestBase : public test::AshTestBase {
void SetInternalAsPrimary() {
const gfx::Display& internal_display =
GetDisplayManager()->GetDisplayForId(internal_display_id_);
- GetDisplayController()->SetPrimaryDisplay(internal_display);
+ GetWindowTreeHostManager()->SetPrimaryDisplay(internal_display);
}
void SetExternalAsPrimary() {
const gfx::Display& external_display =
GetDisplayManager()->GetDisplayForId(external_display_id_);
- GetDisplayController()->SetPrimaryDisplay(external_display);
+ GetWindowTreeHostManager()->SetPrimaryDisplay(external_display);
}
void MirrorDisplays() {
@@ -131,8 +131,8 @@ class TouchHudTestBase : public test::AshTestBase {
return Shell::GetInstance()->display_manager();
}
- DisplayController* GetDisplayController() {
- return Shell::GetInstance()->display_controller();
+ WindowTreeHostManager* GetWindowTreeHostManager() {
+ return Shell::GetInstance()->window_tree_host_manager();
}
const gfx::Display& GetInternalDisplay() {
@@ -144,23 +144,23 @@ class TouchHudTestBase : public test::AshTestBase {
}
aura::Window* GetInternalRootWindow() {
- return GetDisplayController()->GetRootWindowForDisplayId(
+ return GetWindowTreeHostManager()->GetRootWindowForDisplayId(
internal_display_id_);
}
aura::Window* GetExternalRootWindow() {
- return GetDisplayController()->GetRootWindowForDisplayId(
+ return GetWindowTreeHostManager()->GetRootWindowForDisplayId(
external_display_id_);
}
aura::Window* GetPrimaryRootWindow() {
const gfx::Display& display = GetPrimaryDisplay();
- return GetDisplayController()->GetRootWindowForDisplayId(display.id());
+ return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id());
}
aura::Window* GetSecondaryRootWindow() {
const gfx::Display& display = GetSecondaryDisplay();
- return GetDisplayController()->GetRootWindowForDisplayId(display.id());
+ return GetWindowTreeHostManager()->GetRootWindowForDisplayId(display.id());
}
RootWindowController* GetInternalRootController() {
diff --git a/ash/touch/touch_transformer_controller.cc b/ash/touch/touch_transformer_controller.cc
index bc4cd64..a419b67 100644
--- a/ash/touch/touch_transformer_controller.cc
+++ b/ash/touch/touch_transformer_controller.cc
@@ -4,8 +4,8 @@
#include "ash/touch/touch_transformer_controller.h"
-#include "ash/display/display_controller.h"
#include "ash/display/display_manager.h"
+#include "ash/display/window_tree_host_manager.h"
#include "ash/host/ash_window_tree_host.h"
#include "ash/root_window_controller.h"
#include "ash/shell.h"
@@ -117,11 +117,11 @@ gfx::Transform TouchTransformerController::GetTouchTransform(
}
TouchTransformerController::TouchTransformerController() {
- Shell::GetInstance()->display_controller()->AddObserver(this);
+ Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
}
TouchTransformerController::~TouchTransformerController() {
- Shell::GetInstance()->display_controller()->RemoveObserver(this);
+ Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
}
void TouchTransformerController::UpdateTouchRadius(
@@ -162,8 +162,8 @@ void TouchTransformerController::UpdateTouchTransformer() const {
int64 single_display_id = gfx::Display::kInvalidDisplayID;
DisplayInfo single_display;
- DisplayController* display_controller =
- Shell::GetInstance()->display_controller();
+ WindowTreeHostManager* window_tree_host_manager =
+ Shell::GetInstance()->window_tree_host_manager();
DisplayManager* display_manager = GetDisplayManager();
if (display_manager->num_connected_displays() == 0) {
return;
@@ -189,7 +189,8 @@ void TouchTransformerController::UpdateTouchTransformer() const {
Shell::GetInstance()->display_configurator()->framebuffer_size();
if (display_manager->IsInMirrorMode()) {
- int64_t primary_display_id = display_controller->GetPrimaryDisplayId();
+ int64_t primary_display_id =
+ window_tree_host_manager->GetPrimaryDisplayId();
if (GetDisplayManager()->SoftwareMirroringEnabled()) {
// In extended but software mirroring mode, there is a WindowTreeHost for
// each display, but all touches are forwarded to the primary root
diff --git a/ash/touch/touch_transformer_controller.h b/ash/touch/touch_transformer_controller.h
index bf06f8c..2464b72 100644
--- a/ash/touch/touch_transformer_controller.h
+++ b/ash/touch/touch_transformer_controller.h
@@ -6,7 +6,7 @@
#define ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_
#include "ash/ash_export.h"
-#include "ash/display/display_controller.h"
+#include "ash/display/window_tree_host_manager.h"
#include "ui/gfx/transform.h"
namespace ui {
@@ -18,7 +18,7 @@ namespace ash {
// TouchTransformerController listens to display configuration change
// and updates the touch transformation for touch displays.
class ASH_EXPORT TouchTransformerController
- : public DisplayController::Observer {
+ : public WindowTreeHostManager::Observer {
public:
TouchTransformerController();
~TouchTransformerController() override;
@@ -27,7 +27,7 @@ class ASH_EXPORT TouchTransformerController
// TouchTransformer into device manager.
void UpdateTouchTransformer() const;
- // DisplayController::Observer:
+ // WindowTreeHostManager::Observer:
void OnDisplaysInitialized() override;
void OnDisplayConfigurationChanged() override;