Commit 7ae52500 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash: Remove wm::GetRootWindowController.

There is already an ash::GetRootWindowController, and it does the same thing.

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10828037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148662 0039d316-1c4b-4281-b951-d872f2087c98
parent 3aec17e2
......@@ -9,6 +9,7 @@
#include "ash/root_window_controller.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/wm/property_util.h"
#include "ash/wm/window_util.h"
#include "base/command_line.h"
#include "ui/aura/env.h"
......@@ -32,7 +33,7 @@ DisplayController::~DisplayController() {
for (std::map<int, aura::RootWindow*>::const_reverse_iterator it =
root_windows_.rbegin(); it != root_windows_.rend(); ++it) {
internal::RootWindowController* controller =
wm::GetRootWindowController(it->second);
GetRootWindowController(it->second);
// RootWindow may not have RootWindowController in non
// extended desktop mode.
if (controller)
......@@ -76,7 +77,7 @@ void DisplayController::CloseChildWindows() {
root_windows_.begin(); it != root_windows_.end(); ++it) {
aura::RootWindow* root_window = it->second;
internal::RootWindowController* controller =
wm::GetRootWindowController(root_window);
GetRootWindowController(root_window);
if (controller) {
controller->CloseChildWindows();
} else {
......@@ -93,7 +94,7 @@ std::vector<aura::RootWindow*> DisplayController::GetAllRootWindows() {
for (std::map<int, aura::RootWindow*>::const_iterator it =
root_windows_.begin(); it != root_windows_.end(); ++it) {
DCHECK(it->second);
if (wm::GetRootWindowController(it->second))
if (GetRootWindowController(it->second))
windows.push_back(it->second);
}
return windows;
......@@ -105,7 +106,7 @@ DisplayController::GetAllRootWindowControllers() {
for (std::map<int, aura::RootWindow*>::const_iterator it =
root_windows_.begin(); it != root_windows_.end(); ++it) {
internal::RootWindowController* controller =
wm::GetRootWindowController(it->second);
GetRootWindowController(it->second);
if (controller)
controllers.push_back(controller);
}
......@@ -217,7 +218,7 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) {
if (root != Shell::GetPrimaryRootWindow()) {
root_windows_.erase(display.id());
internal::RootWindowController* controller =
wm::GetRootWindowController(root);
GetRootWindowController(root);
if (controller) {
controller->MoveWindowsTo(Shell::GetPrimaryRootWindow());
delete controller;
......
......@@ -6,6 +6,7 @@
#include "ash/display/multi_display_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/property_util.h"
#include "ash/wm/window_cycle_controller.h"
#include "ash/wm/window_util.h"
#include "ui/aura/client/activation_client.h"
......@@ -78,7 +79,7 @@ TEST_F(ExtendedDesktopTest, Basic) {
ASSERT_EQ(2U, root_windows.size());
for (Shell::RootWindowList::const_iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
EXPECT_TRUE(wm::GetRootWindowController(*iter) != NULL);
EXPECT_TRUE(GetRootWindowController(*iter) != NULL);
}
// Make sure root windows share the same controllers.
EXPECT_EQ(root_windows[0]->GetFocusManager(),
......
......@@ -45,6 +45,7 @@
#include "ash/wm/panel_layout_manager.h"
#include "ash/wm/panel_window_event_filter.h"
#include "ash/wm/power_button_controller.h"
#include "ash/wm/property_util.h"
#include "ash/wm/resize_shadow_controller.h"
#include "ash/wm/root_window_layout_manager.h"
#include "ash/wm/screen_dimmer.h"
......@@ -306,7 +307,7 @@ void Shell::DeleteInstance() {
// static
internal::RootWindowController* Shell::GetPrimaryRootWindowController() {
return wm::GetRootWindowController(GetPrimaryRootWindow());
return GetRootWindowController(GetPrimaryRootWindow());
}
// static
......
......@@ -605,7 +605,7 @@ ui::GestureStatus SystemGestureEventFilter::PreHandleGestureEvent(
return ui::GESTURE_STATUS_UNKNOWN;
RootWindowController* root_controller =
wm::GetRootWindowController(system_target->GetRootWindow());
GetRootWindowController(system_target->GetRootWindow());
CHECK(root_controller);
aura::Window* desktop_container = root_controller->GetContainer(
ash::internal::kShellWindowId_DesktopBackgroundContainer);
......
......@@ -4,6 +4,7 @@
#include "ash/wm/user_activity_detector.h"
#include "ash/wm/property_util.h"
#include "ash/wm/user_activity_observer.h"
#include "ash/wm/window_util.h"
#include "ui/aura/event.h"
......@@ -31,7 +32,7 @@ bool UserActivityDetector::PreHandleKeyEvent(aura::Window* target,
aura::KeyEvent* event) {
// Ignore input events on secondary displays in non extended desktop
// mode. Remove this once this mode is gone. crbug.com/135245.
if (!wm::GetRootWindowController(target->GetRootWindow()))
if (!GetRootWindowController(target->GetRootWindow()))
return true;
MaybeNotify();
return false;
......@@ -39,7 +40,7 @@ bool UserActivityDetector::PreHandleKeyEvent(aura::Window* target,
bool UserActivityDetector::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
if (!wm::GetRootWindowController(target->GetRootWindow()))
if (!GetRootWindowController(target->GetRootWindow()))
return true;
if (!(event->flags() & ui::EF_IS_SYNTHESIZED))
MaybeNotify();
......@@ -49,7 +50,7 @@ bool UserActivityDetector::PreHandleMouseEvent(aura::Window* target,
ui::TouchStatus UserActivityDetector::PreHandleTouchEvent(
aura::Window* target,
aura::TouchEvent* event) {
if (!wm::GetRootWindowController(target->GetRootWindow()))
if (!GetRootWindowController(target->GetRootWindow()))
return ui::TOUCH_STATUS_END;
MaybeNotify();
return ui::TOUCH_STATUS_UNKNOWN;
......@@ -58,7 +59,7 @@ ui::TouchStatus UserActivityDetector::PreHandleTouchEvent(
ui::GestureStatus UserActivityDetector::PreHandleGestureEvent(
aura::Window* target,
aura::GestureEvent* event) {
if (!wm::GetRootWindowController(target->GetRootWindow()))
if (!GetRootWindowController(target->GetRootWindow()))
return ui::GESTURE_STATUS_CONSUMED;
MaybeNotify();
return ui::GESTURE_STATUS_UNKNOWN;
......
......@@ -59,11 +59,6 @@ bool CanActivateWindow(aura::Window* window) {
return client && client->CanActivateWindow(window);
}
internal::RootWindowController* GetRootWindowController(
aura::RootWindow* root_window) {
return root_window->GetProperty(internal::kRootWindowControllerKey);
}
bool IsWindowNormal(aura::Window* window) {
return window->GetProperty(aura::client::kShowStateKey) ==
ui::SHOW_STATE_NORMAL ||
......
......@@ -24,8 +24,6 @@ ASH_EXPORT void DeactivateWindow(aura::Window* window);
ASH_EXPORT bool IsActiveWindow(aura::Window* window);
ASH_EXPORT aura::Window* GetActiveWindow();
ASH_EXPORT bool CanActivateWindow(aura::Window* window);
ASH_EXPORT internal::RootWindowController* GetRootWindowController(
aura::RootWindow* root_window);
// Retrieves the activatable window for |window|. If |window| is activatable,
// this will just return it, otherwise it will climb the parent/transient parent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment