summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 14:49:09 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 14:49:09 +0000
commit32c2a46c5f820f42cdb37b869e99633d8a2d73ad (patch)
tree9e09f67ffd197c2067a286e4e45927ee5c5aa429 /ash
parent08f8feb39b2c8801dd39a1531fb5958644162e6d (diff)
downloadchromium_src-32c2a46c5f820f42cdb37b869e99633d8a2d73ad.zip
chromium_src-32c2a46c5f820f42cdb37b869e99633d8a2d73ad.tar.gz
chromium_src-32c2a46c5f820f42cdb37b869e99633d8a2d73ad.tar.bz2
Migrate client API setters/getters to take a RootWindow.
http://crbug.com/112131 TEST=none TBR=sky Review URL: https://chromiumcodereview.appspot.com/9455081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/nested_dispatcher_controller.cc3
-rw-r--r--ash/drag_drop/drag_drop_controller.cc2
-rw-r--r--ash/drag_drop/drag_drop_controller_unittest.cc5
-rw-r--r--ash/focus_cycler.cc3
-rw-r--r--ash/shell.cc4
-rw-r--r--ash/tooltips/tooltip_controller.cc1
-rw-r--r--ash/tooltips/tooltip_controller_unittest.cc4
-rw-r--r--ash/wm/activation_controller.cc2
-rw-r--r--ash/wm/visibility_controller.cc2
-rw-r--r--ash/wm/window_util.cc10
10 files changed, 22 insertions, 14 deletions
diff --git a/ash/accelerators/nested_dispatcher_controller.cc b/ash/accelerators/nested_dispatcher_controller.cc
index dda0d2ad..c08d7f4 100644
--- a/ash/accelerators/nested_dispatcher_controller.cc
+++ b/ash/accelerators/nested_dispatcher_controller.cc
@@ -5,11 +5,12 @@
#include "ash/accelerators/nested_dispatcher_controller.h"
#include "ash/accelerators/accelerator_dispatcher.h"
+#include "ash/shell.h"
namespace ash {
NestedDispatcherController::NestedDispatcherController() {
- aura::client::SetDispatcherClient(this);
+ aura::client::SetDispatcherClient(Shell::GetRootWindow(), this);
}
NestedDispatcherController::~NestedDispatcherController() {
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 9ff111c..d491621 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -42,7 +42,7 @@ DragDropController::DragDropController()
drag_drop_in_progress_(false),
should_block_during_drag_drop_(true) {
Shell::GetInstance()->AddRootWindowEventFilter(this);
- aura::client::SetDragDropClient(this);
+ aura::client::SetDragDropClient(Shell::GetRootWindow(), this);
}
DragDropController::~DragDropController() {
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index a2a0d00..a17a485 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -185,12 +185,13 @@ class DragDropControllerTest : public AshTestBase {
AshTestBase::SetUp();
drag_drop_controller_.reset(new TestDragDropController);
drag_drop_controller_->set_should_block_during_drag_drop(false);
- aura::client::SetDragDropClient(drag_drop_controller_.get());
+ aura::client::SetDragDropClient(Shell::GetRootWindow(),
+ drag_drop_controller_.get());
views_delegate_.reset(new views::TestViewsDelegate);
}
void TearDown() OVERRIDE {
- aura::client::SetDragDropClient(NULL);
+ aura::client::SetDragDropClient(Shell::GetRootWindow(), NULL);
drag_drop_controller_.reset();
AshTestBase::TearDown();
}
diff --git a/ash/focus_cycler.cc b/ash/focus_cycler.cc
index f1877d1..6a62757b 100644
--- a/ash/focus_cycler.cc
+++ b/ash/focus_cycler.cc
@@ -66,7 +66,8 @@ void FocusCycler::RotateFocus(Direction direction) {
Shell::GetInstance()->delegate()->GetCycleWindowList(
ShellDelegate::SOURCE_LAUNCHER, ShellDelegate::ORDER_MRU);
if (!windows.empty()) {
- aura::client::GetActivationClient()->ActivateWindow(windows[0]);
+ aura::client::GetActivationClient(Shell::GetRootWindow())->
+ ActivateWindow(windows[0]);
break;
}
} else {
diff --git a/ash/shell.cc b/ash/shell.cc
index 22a2f38..c4fcc52 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -225,7 +225,7 @@ Shell::~Shell() {
// TooltipController is deleted with the Shell so removing its references.
RemoveRootWindowEventFilter(tooltip_controller_.get());
- aura::client::SetTooltipClient(NULL);
+ aura::client::SetTooltipClient(GetRootWindow(), NULL);
// Make sure we delete WorkspaceController before launcher is
// deleted as it has a reference to launcher model.
@@ -344,11 +344,9 @@ void Shell::Init() {
AddRootWindowEventFilter(window_modality_controller_.get());
visibility_controller_.reset(new internal::VisibilityController);
- aura::client::SetVisibilityClient(visibility_controller_.get());
tooltip_controller_.reset(new internal::TooltipController);
AddRootWindowEventFilter(tooltip_controller_.get());
- aura::client::SetTooltipClient(tooltip_controller_.get());
drag_drop_controller_.reset(new internal::DragDropController);
power_button_controller_.reset(new PowerButtonController);
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc
index a999c59..b23d227 100644
--- a/ash/tooltips/tooltip_controller.cc
+++ b/ash/tooltips/tooltip_controller.cc
@@ -219,6 +219,7 @@ TooltipController::TooltipController()
tooltip_timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs),
this, &TooltipController::TooltipTimerFired);
+ aura::client::SetTooltipClient(Shell::GetRootWindow(), this);
}
TooltipController::~TooltipController() {
diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc
index badae3c..f07dfd5 100644
--- a/ash/tooltips/tooltip_controller_unittest.cc
+++ b/ash/tooltips/tooltip_controller_unittest.cc
@@ -68,7 +68,7 @@ void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) {
ash::internal::TooltipController* GetController() {
return static_cast<ash::internal::TooltipController*>(
- aura::client::GetTooltipClient());
+ aura::client::GetTooltipClient(Shell::GetRootWindow()));
}
} // namespace
@@ -99,7 +99,7 @@ class TooltipControllerTest : public AshTestBase {
};
TEST_F(TooltipControllerTest, NonNullTooltipClient) {
- EXPECT_TRUE(aura::client::GetTooltipClient() != NULL);
+ EXPECT_TRUE(aura::client::GetTooltipClient(Shell::GetRootWindow()) != NULL);
EXPECT_EQ(ASCIIToUTF16(""), GetTooltipText());
EXPECT_EQ(NULL, GetTooltipWindow());
EXPECT_FALSE(IsTooltipVisible());
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 93cc530..ffbeb5a 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -71,7 +71,7 @@ void StackTransientParentsBelowModalWindow(aura::Window* window) {
ActivationController::ActivationController()
: updating_activation_(false),
default_container_for_test_(NULL) {
- aura::client::SetActivationClient(this);
+ aura::client::SetActivationClient(Shell::GetRootWindow(), this);
aura::Env::GetInstance()->AddObserver(this);
Shell::GetRootWindow()->AddRootWindowObserver(this);
}
diff --git a/ash/wm/visibility_controller.cc b/ash/wm/visibility_controller.cc
index 94b9397..2c13698 100644
--- a/ash/wm/visibility_controller.cc
+++ b/ash/wm/visibility_controller.cc
@@ -4,6 +4,7 @@
#include "ash/wm/visibility_controller.h"
+#include "ash/shell.h"
#include "ash/wm/window_animations.h"
#include "ui/aura/window.h"
#include "ui/aura/window_property.h"
@@ -31,6 +32,7 @@ bool GetChildWindowVisibilityChangesAnimated(aura::Window* window) {
} // namespace
VisibilityController::VisibilityController() {
+ aura::client::SetVisibilityClient(Shell::GetRootWindow(), this);
}
VisibilityController::~VisibilityController() {
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 5571464..bdc6ccb 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -4,6 +4,7 @@
#include "ash/wm/window_util.h"
+#include "ash/shell.h"
#include "ash/wm/activation_controller.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
@@ -26,11 +27,13 @@ const aura::WindowProperty<bool>* const
} // namespace
void ActivateWindow(aura::Window* window) {
- aura::client::GetActivationClient()->ActivateWindow(window);
+ aura::client::GetActivationClient(Shell::GetRootWindow())->ActivateWindow(
+ window);
}
void DeactivateWindow(aura::Window* window) {
- aura::client::GetActivationClient()->DeactivateWindow(window);
+ aura::client::GetActivationClient(Shell::GetRootWindow())->DeactivateWindow(
+ window);
}
bool IsActiveWindow(aura::Window* window) {
@@ -38,7 +41,8 @@ bool IsActiveWindow(aura::Window* window) {
}
aura::Window* GetActiveWindow() {
- return aura::client::GetActivationClient()->GetActiveWindow();
+ return aura::client::GetActivationClient(Shell::GetRootWindow())->
+ GetActiveWindow();
}
aura::Window* GetActivatableWindow(aura::Window* window) {