summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 20:03:46 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 20:03:46 +0000
commite871f1a0bdf9c09b2c72e521b179ebb2fd6dc4e9 (patch)
treec97ba41c7fe07b9cffcdc71083bb2f5d58205e85
parent000d9df01681c4d0fb722c797ba0a398c3756504 (diff)
downloadchromium_src-e871f1a0bdf9c09b2c72e521b179ebb2fd6dc4e9.zip
chromium_src-e871f1a0bdf9c09b2c72e521b179ebb2fd6dc4e9.tar.gz
chromium_src-e871f1a0bdf9c09b2c72e521b179ebb2fd6dc4e9.tar.bz2
Rename system modal types and classes appropriately.
Renames the following as per the bug description by ben@: kShellWindowId_ModalContainer -> kShellWindowId_SystemModalContainer kShellWindowId_LockModalContainer -> kShellWindowId_LockSystemModalContainer ModalContainerLayoutManager->SystemModalContainerLayoutManager ModalityEventFilter->SystemModalContainerEventFilter BUG=109460 TEST=All tests and compilation still succeed. Review URL: https://chromiumcodereview.appspot.com/9249022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118127 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash.gyp12
-rw-r--r--ash/shell.cc17
-rw-r--r--ash/shell_unittest.cc6
-rw-r--r--ash/shell_window_ids.h4
-rw-r--r--ash/wm/activation_controller.cc4
-rw-r--r--ash/wm/power_button_controller.cc2
-rw-r--r--ash/wm/stacking_controller.cc10
-rw-r--r--ash/wm/stacking_controller.h8
-rw-r--r--ash/wm/system_modal_container_event_filter.cc (renamed from ash/wm/modality_event_filter.cc)19
-rw-r--r--ash/wm/system_modal_container_event_filter.h (renamed from ash/wm/modality_event_filter.h)21
-rw-r--r--ash/wm/system_modal_container_event_filter_delegate.h (renamed from ash/wm/modality_event_filter_delegate.h)4
-rw-r--r--ash/wm/system_modal_container_layout_manager.cc (renamed from ash/wm/modal_container_layout_manager.cc)63
-rw-r--r--ash/wm/system_modal_container_layout_manager.h (renamed from ash/wm/modal_container_layout_manager.h)22
-rw-r--r--ash/wm/system_modal_container_layout_manager_unittest.cc (renamed from ash/wm/modal_container_layout_manager_unittest.cc)12
-rw-r--r--ash/wm/window_cycle_controller_unittest.cc2
15 files changed, 106 insertions, 100 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 36b9e205..380b9db 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -114,11 +114,11 @@
'wm/dialog_frame_view.h',
'wm/image_grid.cc',
'wm/image_grid.h',
- 'wm/modal_container_layout_manager.cc',
- 'wm/modal_container_layout_manager.h',
- 'wm/modality_event_filter.cc',
- 'wm/modality_event_filter.h',
- 'wm/modality_event_filter_delegate.h',
+ 'wm/system_modal_container_layout_manager.cc',
+ 'wm/system_modal_container_layout_manager.h',
+ 'wm/system_modal_container_event_filter.cc',
+ 'wm/system_modal_container_event_filter.h',
+ 'wm/system_modal_container_event_filter_delegate.h',
'wm/power_button_controller.cc',
'wm/power_button_controller.h',
'wm/property_util.cc',
@@ -214,7 +214,7 @@
'wm/activation_controller_unittest.cc',
'wm/default_container_layout_manager_unittest.cc',
'wm/image_grid_unittest.cc',
- 'wm/modal_container_layout_manager_unittest.cc',
+ 'wm/system_modal_container_layout_manager_unittest.cc',
'wm/power_button_controller_unittest.cc',
'wm/root_window_event_filter_unittest.cc',
'wm/shadow_controller_unittest.cc',
diff --git a/ash/shell.cc b/ash/shell.cc
index f43a2c9..ecb1783 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -22,7 +22,7 @@
#include "ash/wm/default_container_event_filter.h"
#include "ash/wm/default_container_layout_manager.h"
#include "ash/wm/dialog_frame_view.h"
-#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/wm/system_modal_container_layout_manager.h"
#include "ash/wm/power_button_controller.h"
#include "ash/wm/root_window_event_filter.h"
#include "ash/wm/root_window_layout_manager.h"
@@ -98,12 +98,12 @@ void CreateSpecialContainers(aura::Window::Windows* containers,
modal_container->SetEventFilter(
new ToplevelWindowEventFilter(modal_container));
modal_container->SetLayoutManager(
- new internal::ModalContainerLayoutManager(modal_container));
- modal_container->set_id(internal::kShellWindowId_ModalContainer);
+ new internal::SystemModalContainerLayoutManager(modal_container));
+ modal_container->set_id(internal::kShellWindowId_SystemModalContainer);
containers->push_back(modal_container);
- // TODO(beng): Figure out if we can make this use ModalityEventFilter instead
- // of stops_event_propagation.
+ // TODO(beng): Figure out if we can make this use
+ // SystemModalContainerEventFilter instead of stops_event_propagation.
aura::Window* lock_container = new aura::Window(NULL);
lock_container->set_stops_event_propagation(true);
lock_container->set_id(internal::kShellWindowId_LockScreenContainer);
@@ -113,8 +113,9 @@ void CreateSpecialContainers(aura::Window::Windows* containers,
lock_modal_container->SetEventFilter(
new ToplevelWindowEventFilter(lock_modal_container));
lock_modal_container->SetLayoutManager(
- new internal::ModalContainerLayoutManager(lock_modal_container));
- lock_modal_container->set_id(internal::kShellWindowId_LockModalContainer);
+ new internal::SystemModalContainerLayoutManager(lock_modal_container));
+ lock_modal_container->set_id(
+ internal::kShellWindowId_LockSystemModalContainer);
containers->push_back(lock_modal_container);
aura::Window* status_container = new aura::Window(NULL);
@@ -395,7 +396,7 @@ bool Shell::IsScreenLocked() const {
bool Shell::IsModalWindowOpen() const {
aura::Window* modal_container =
ash::Shell::GetInstance()->GetContainer(
- internal::kShellWindowId_ModalContainer);
+ internal::kShellWindowId_SystemModalContainer);
return !modal_container->children().empty();
}
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 6604799..42de843 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -163,7 +163,7 @@ TEST_F(ShellTest, CreateModalWindow) {
// It should be in modal container.
aura::Window* modal_container = Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_ModalContainer);
+ ash::internal::kShellWindowId_SystemModalContainer);
EXPECT_EQ(modal_container, modal_widget->GetNativeWindow()->parent());
modal_widget->Close();
@@ -200,7 +200,7 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
// It should be in LockScreen modal container.
aura::Window* lock_modal_container = Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_LockModalContainer);
+ ash::internal::kShellWindowId_LockSystemModalContainer);
EXPECT_EQ(lock_modal_container,
lock_modal_widget->GetNativeWindow()->parent());
@@ -211,7 +211,7 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
// It should be in non-LockScreen modal container.
aura::Window* modal_container = Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_ModalContainer);
+ ash::internal::kShellWindowId_SystemModalContainer);
EXPECT_EQ(modal_container, modal_widget->GetNativeWindow()->parent());
modal_widget->Close();
diff --git a/ash/shell_window_ids.h b/ash/shell_window_ids.h
index 42849c4..6376ef7 100644
--- a/ash/shell_window_ids.h
+++ b/ash/shell_window_ids.h
@@ -28,13 +28,13 @@ const int kShellWindowId_PanelContainer = 3;
const int kShellWindowId_LauncherContainer = 4;
// The container for user-specific modal windows.
-const int kShellWindowId_ModalContainer = 5;
+const int kShellWindowId_SystemModalContainer = 5;
// The container for the lock screen.
const int kShellWindowId_LockScreenContainer = 6;
// The container for the lock screen modal windows.
-const int kShellWindowId_LockModalContainer = 7;
+const int kShellWindowId_LockSystemModalContainer = 7;
// The container for the status area.
const int kShellWindowId_StatusContainer = 8;
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 7c56faf..85d1c4f 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -30,9 +30,9 @@ bool SupportsChildActivation(aura::Window* window) {
return window->id() == kShellWindowId_DefaultContainer ||
window->id() == kShellWindowId_AlwaysOnTopContainer ||
window->id() == kShellWindowId_PanelContainer ||
- window->id() == kShellWindowId_ModalContainer ||
+ window->id() == kShellWindowId_SystemModalContainer ||
window->id() == kShellWindowId_LockScreenContainer ||
- window->id() == kShellWindowId_LockModalContainer;
+ window->id() == kShellWindowId_LockSystemModalContainer;
}
// Returns true if |window| can be activated or deactivated.
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc
index f18c1e0..d8ce2be1 100644
--- a/ash/wm/power_button_controller.cc
+++ b/ash/wm/power_button_controller.cc
@@ -64,7 +64,7 @@ const float kSlowCloseSizeRatio = 0.95f;
// Containers holding screen locker windows.
const int kScreenLockerContainerIds[] = {
internal::kShellWindowId_LockScreenContainer,
- internal::kShellWindowId_LockModalContainer,
+ internal::kShellWindowId_LockSystemModalContainer,
};
// Containers holding additional windows that should be shown while the screen
diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc
index 08a990b..1bc3c6f 100644
--- a/ash/wm/stacking_controller.cc
+++ b/ash/wm/stacking_controller.cc
@@ -49,7 +49,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* window) {
case aura::client::WINDOW_TYPE_NORMAL:
case aura::client::WINDOW_TYPE_POPUP:
if (IsSystemModal(window))
- return GetModalContainer(window);
+ return GetSystemModalContainer(window);
return always_on_top_controller_->GetContainer(window);
case aura::client::WINDOW_TYPE_PANEL:
return GetContainer(internal::kShellWindowId_PanelContainer);
@@ -67,7 +67,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* window) {
////////////////////////////////////////////////////////////////////////////////
// StackingController, private:
-aura::Window* StackingController::GetModalContainer(
+aura::Window* StackingController::GetSystemModalContainer(
aura::Window* window) const {
if (!IsSystemModal(window))
return NULL;
@@ -77,7 +77,7 @@ aura::Window* StackingController::GetModalContainer(
aura::Window* lock_container =
GetContainer(internal::kShellWindowId_LockScreenContainer);
if (!lock_container->children().size())
- return GetContainer(internal::kShellWindowId_ModalContainer);
+ return GetContainer(internal::kShellWindowId_SystemModalContainer);
// Otherwise those that originate from LockScreen container and above are
// placed in the screen lock modal container.
@@ -86,9 +86,9 @@ aura::Window* StackingController::GetModalContainer(
aura::Window* container = NULL;
if (window_container_id < lock_container_id)
- container = GetContainer(internal::kShellWindowId_ModalContainer);
+ container = GetContainer(internal::kShellWindowId_SystemModalContainer);
else
- container = GetContainer(internal::kShellWindowId_LockModalContainer);
+ container = GetContainer(internal::kShellWindowId_LockSystemModalContainer);
return container;
}
diff --git a/ash/wm/stacking_controller.h b/ash/wm/stacking_controller.h
index 47813821..9e38216 100644
--- a/ash/wm/stacking_controller.h
+++ b/ash/wm/stacking_controller.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,12 +25,12 @@ class StackingController : public aura::client::StackingClient {
virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE;
private:
- // Returns corresponding modal container for a modal window.
- // If screen lock is not active, all modal windows are placed into the
+ // Returns corresponding system modal container for a modal window.
+ // If screen lock is not active, all system modal windows are placed into the
// normal modal container.
// Otherwise those that originate from LockScreen container and above are
// placed in the screen lock modal container.
- aura::Window* GetModalContainer(aura::Window* window) const;
+ aura::Window* GetSystemModalContainer(aura::Window* window) const;
scoped_ptr<internal::AlwaysOnTopController> always_on_top_controller_;
diff --git a/ash/wm/modality_event_filter.cc b/ash/wm/system_modal_container_event_filter.cc
index 16fba18..58155f7 100644
--- a/ash/wm/modality_event_filter.cc
+++ b/ash/wm/system_modal_container_event_filter.cc
@@ -2,41 +2,42 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/wm/modality_event_filter.h"
+#include "ash/wm/system_modal_container_event_filter.h"
-#include "ash/wm/modality_event_filter_delegate.h"
+#include "ash/wm/system_modal_container_event_filter_delegate.h"
#include "ui/aura/event.h"
namespace ash {
namespace internal {
-ModalityEventFilter::ModalityEventFilter(aura::Window* container,
- ModalityEventFilterDelegate* delegate)
+SystemModalContainerEventFilter::SystemModalContainerEventFilter(
+ aura::Window* container,
+ SystemModalContainerEventFilterDelegate* delegate)
: EventFilter(container),
delegate_(delegate) {
}
-ModalityEventFilter::~ModalityEventFilter() {
+SystemModalContainerEventFilter::~SystemModalContainerEventFilter() {
}
-bool ModalityEventFilter::PreHandleKeyEvent(aura::Window* target,
+bool SystemModalContainerEventFilter::PreHandleKeyEvent(aura::Window* target,
aura::KeyEvent* event) {
return !delegate_->CanWindowReceiveEvents(target);
}
-bool ModalityEventFilter::PreHandleMouseEvent(aura::Window* target,
+bool SystemModalContainerEventFilter::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
return !delegate_->CanWindowReceiveEvents(target);
}
-ui::TouchStatus ModalityEventFilter::PreHandleTouchEvent(
+ui::TouchStatus SystemModalContainerEventFilter::PreHandleTouchEvent(
aura::Window* target,
aura::TouchEvent* event) {
// TODO(sadrul): !
return ui::TOUCH_STATUS_UNKNOWN;
}
-ui::GestureStatus ModalityEventFilter::PreHandleGestureEvent(
+ui::GestureStatus SystemModalContainerEventFilter::PreHandleGestureEvent(
aura::Window* target,
aura::GestureEvent* event) {
// TODO(sad):
diff --git a/ash/wm/modality_event_filter.h b/ash/wm/system_modal_container_event_filter.h
index 5063525..0095b37 100644
--- a/ash/wm/modality_event_filter.h
+++ b/ash/wm/system_modal_container_event_filter.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_WM_MODALITY_EVENT_FILTER_H_
-#define ASH_WM_MODALITY_EVENT_FILTER_H_
+#ifndef ASH_WM_SYSTEM_MODAL_CONTAINER_EVENT_FILTER_H_
+#define ASH_WM_SYSTEM_MODAL_CONTAINER_EVENT_FILTER_H_
#pragma once
#include "base/compiler_specific.h"
@@ -13,13 +13,14 @@
namespace ash {
namespace internal {
-class ModalityEventFilterDelegate;
+class SystemModalContainerEventFilterDelegate;
-class ASH_EXPORT ModalityEventFilter : public aura::EventFilter {
+class ASH_EXPORT SystemModalContainerEventFilter : public aura::EventFilter {
public:
- ModalityEventFilter(aura::Window* container,
- ModalityEventFilterDelegate* delegate);
- virtual ~ModalityEventFilter();
+ SystemModalContainerEventFilter(
+ aura::Window* container,
+ SystemModalContainerEventFilterDelegate* delegate);
+ virtual ~SystemModalContainerEventFilter();
// Overridden from aura::EventFilter:
virtual bool PreHandleKeyEvent(aura::Window* target,
@@ -34,12 +35,12 @@ class ASH_EXPORT ModalityEventFilter : public aura::EventFilter {
aura::GestureEvent* event) OVERRIDE;
private:
- ModalityEventFilterDelegate* delegate_;
+ SystemModalContainerEventFilterDelegate* delegate_;
- DISALLOW_COPY_AND_ASSIGN(ModalityEventFilter);
+ DISALLOW_COPY_AND_ASSIGN(SystemModalContainerEventFilter);
};
} // namespace internal
} // namespace ash
-#endif // ASH_WM_MODALITY_EVENT_FILTER_H_
+#endif // ASH_WM_SYSTEM_MODAL_CONTAINER_EVENT_FILTER_H_
diff --git a/ash/wm/modality_event_filter_delegate.h b/ash/wm/system_modal_container_event_filter_delegate.h
index 15c9fc9..c2a7696 100644
--- a/ash/wm/modality_event_filter_delegate.h
+++ b/ash/wm/system_modal_container_event_filter_delegate.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,7 +15,7 @@ class Window;
namespace ash {
namespace internal {
-class ASH_EXPORT ModalityEventFilterDelegate {
+class ASH_EXPORT SystemModalContainerEventFilterDelegate {
public:
// Returns true if |window| can receive the specified event.
virtual bool CanWindowReceiveEvents(aura::Window* window) = 0;
diff --git a/ash/wm/modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc
index 5ab20a3..dddaf0f 100644
--- a/ash/wm/modal_container_layout_manager.cc
+++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/wm/system_modal_container_layout_manager.h"
#include "ash/ash_switches.h"
#include "ash/shell.h"
-#include "ash/wm/modality_event_filter.h"
+#include "ash/wm/system_modal_container_event_filter.h"
#include "ash/wm/window_util.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -51,60 +51,61 @@ class ScreenView : public views::View {
} // namespace
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, public:
+// SystemModalContainerLayoutManager, public:
-ModalContainerLayoutManager::ModalContainerLayoutManager(
+SystemModalContainerLayoutManager::SystemModalContainerLayoutManager(
aura::Window* container)
: container_(container),
modal_screen_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- modality_filter_(new ModalityEventFilter(container, this))) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(modality_filter_(
+ new SystemModalContainerEventFilter(container, this))) {
}
-ModalContainerLayoutManager::~ModalContainerLayoutManager() {
+SystemModalContainerLayoutManager::~SystemModalContainerLayoutManager() {
}
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, aura::LayoutManager implementation:
+// SystemModalContainerLayoutManager, aura::LayoutManager implementation:
-void ModalContainerLayoutManager::OnWindowResized() {
+void SystemModalContainerLayoutManager::OnWindowResized() {
if (modal_screen_) {
modal_screen_->SetBounds(gfx::Rect(0, 0, container_->bounds().width(),
container_->bounds().height()));
}
}
-void ModalContainerLayoutManager::OnWindowAddedToLayout(
+void SystemModalContainerLayoutManager::OnWindowAddedToLayout(
aura::Window* child) {
child->AddObserver(this);
if (child->GetIntProperty(aura::client::kModalKey))
AddModalWindow(child);
}
-void ModalContainerLayoutManager::OnWillRemoveWindowFromLayout(
+void SystemModalContainerLayoutManager::OnWillRemoveWindowFromLayout(
aura::Window* child) {
child->RemoveObserver(this);
if (child->GetIntProperty(aura::client::kModalKey))
RemoveModalWindow(child);
}
-void ModalContainerLayoutManager::OnChildWindowVisibilityChanged(
+void SystemModalContainerLayoutManager::OnChildWindowVisibilityChanged(
aura::Window* child,
bool visible) {
}
-void ModalContainerLayoutManager::SetChildBounds(
+void SystemModalContainerLayoutManager::SetChildBounds(
aura::Window* child,
const gfx::Rect& requested_bounds) {
SetChildBoundsDirect(child, requested_bounds);
}
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, aura::WindowObserver implementation:
+// SystemModalContainerLayoutManager, aura::WindowObserver implementation:
-void ModalContainerLayoutManager::OnWindowPropertyChanged(aura::Window* window,
- const char* key,
- void* old) {
+void SystemModalContainerLayoutManager::OnWindowPropertyChanged(
+ aura::Window* window,
+ const char* key,
+ void* old) {
if (key != aura::client::kModalKey)
return;
@@ -116,39 +117,41 @@ void ModalContainerLayoutManager::OnWindowPropertyChanged(aura::Window* window,
}
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, ui::LayerAnimationObserver implementation:
+// SystemModalContainerLayoutManager, ui::LayerAnimationObserver implementation:
-void ModalContainerLayoutManager::OnLayerAnimationEnded(
+void SystemModalContainerLayoutManager::OnLayerAnimationEnded(
const ui::LayerAnimationSequence* sequence) {
if (modal_screen_ && !modal_screen_->GetNativeView()->layer()->ShouldDraw())
DestroyModalScreen();
}
-void ModalContainerLayoutManager::OnLayerAnimationAborted(
+void SystemModalContainerLayoutManager::OnLayerAnimationAborted(
const ui::LayerAnimationSequence* sequence) {
}
-void ModalContainerLayoutManager::OnLayerAnimationScheduled(
+void SystemModalContainerLayoutManager::OnLayerAnimationScheduled(
const ui::LayerAnimationSequence* sequence) {
}
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, ModalityEventFilter::Delegate implementation:
+// SystemModalContainerLayoutManager,
+// SystemModalContainerEventFilter::Delegate implementation:
-bool ModalContainerLayoutManager::CanWindowReceiveEvents(
+bool SystemModalContainerLayoutManager::CanWindowReceiveEvents(
aura::Window* window) {
return GetActivatableWindow(window) == modal_window();
}
////////////////////////////////////////////////////////////////////////////////
-// ModalContainerLayoutManager, private:
+// SystemModalContainerLayoutManager, private:
-void ModalContainerLayoutManager::AddModalWindow(aura::Window* window) {
+void SystemModalContainerLayoutManager::AddModalWindow(aura::Window* window) {
modal_windows_.push_back(window);
CreateModalScreen();
}
-void ModalContainerLayoutManager::RemoveModalWindow(aura::Window* window) {
+void SystemModalContainerLayoutManager::RemoveModalWindow(
+ aura::Window* window) {
aura::Window::Windows::iterator it =
std::find(modal_windows_.begin(), modal_windows_.end(), window);
if (it != modal_windows_.end())
@@ -160,7 +163,7 @@ void ModalContainerLayoutManager::RemoveModalWindow(aura::Window* window) {
ash::ActivateWindow(modal_window());
}
-void ModalContainerLayoutManager::CreateModalScreen() {
+void SystemModalContainerLayoutManager::CreateModalScreen() {
if (modal_screen_)
return;
modal_screen_ = new views::Widget;
@@ -170,7 +173,7 @@ void ModalContainerLayoutManager::CreateModalScreen() {
container_->bounds().height());
modal_screen_->Init(params);
modal_screen_->GetNativeView()->SetName(
- "ModalContainerLayoutManager.ModalScreen");
+ "SystemModalContainerLayoutManager.ModalScreen");
modal_screen_->SetContentsView(new ScreenView);
modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this);
@@ -184,13 +187,13 @@ void ModalContainerLayoutManager::CreateModalScreen() {
container_->StackChildAtTop(modal_screen_->GetNativeView());
}
-void ModalContainerLayoutManager::DestroyModalScreen() {
+void SystemModalContainerLayoutManager::DestroyModalScreen() {
modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this);
modal_screen_->Close();
modal_screen_ = NULL;
}
-void ModalContainerLayoutManager::HideModalScreen() {
+void SystemModalContainerLayoutManager::HideModalScreen() {
Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get());
ui::ScopedLayerAnimationSettings settings(
modal_screen_->GetNativeView()->layer()->GetAnimator());
diff --git a/ash/wm/modal_container_layout_manager.h b/ash/wm/system_modal_container_layout_manager.h
index 2ee1e85..c713500 100644
--- a/ash/wm/modal_container_layout_manager.h
+++ b/ash/wm/system_modal_container_layout_manager.h
@@ -1,14 +1,14 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_WM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
-#define ASH_WM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
+#ifndef ASH_WM_SYSTEM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
+#define ASH_WM_SYSTEM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
#pragma once
#include <vector>
-#include "ash/wm/modality_event_filter_delegate.h"
+#include "ash/wm/system_modal_container_event_filter_delegate.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
@@ -32,14 +32,14 @@ namespace ash {
namespace internal {
// LayoutManager for the modal window container.
-class ASH_EXPORT ModalContainerLayoutManager
+class ASH_EXPORT SystemModalContainerLayoutManager
: public aura::LayoutManager,
public aura::WindowObserver,
public ui::LayerAnimationObserver,
- public ModalityEventFilterDelegate {
+ public SystemModalContainerEventFilterDelegate {
public:
- explicit ModalContainerLayoutManager(aura::Window* container);
- virtual ~ModalContainerLayoutManager();
+ explicit SystemModalContainerLayoutManager(aura::Window* container);
+ virtual ~SystemModalContainerLayoutManager();
// Overridden from aura::LayoutManager:
virtual void OnWindowResized() OVERRIDE;
@@ -63,7 +63,7 @@ class ASH_EXPORT ModalContainerLayoutManager
virtual void OnLayerAnimationScheduled(
const ui::LayerAnimationSequence* sequence) OVERRIDE;
- // Overridden from ModalityEventFilterDelegate:
+ // Overridden from SystemModalContainerEventFilterDelegate:
virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
private:
@@ -93,10 +93,10 @@ class ASH_EXPORT ModalContainerLayoutManager
// added, and removed when the last is closed.
scoped_ptr<aura::EventFilter> modality_filter_;
- DISALLOW_COPY_AND_ASSIGN(ModalContainerLayoutManager);
+ DISALLOW_COPY_AND_ASSIGN(SystemModalContainerLayoutManager);
};
} // namespace internal
} // namespace ash
-#endif // ASH_WM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
+#endif // ASH_WM_SYSTEM_MODAL_CONTAINER_LAYOUT_MANAGER_H_
diff --git a/ash/wm/modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 0ee0750..633fe0f 100644
--- a/ash/wm/modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/wm/modal_container_layout_manager.h"
+#include "ash/wm/system_modal_container_layout_manager.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
@@ -22,7 +22,7 @@ namespace {
aura::Window* GetModalContainer() {
return Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_ModalContainer);
+ ash::internal::kShellWindowId_SystemModalContainer);
}
aura::Window* GetDefaultContainer() {
@@ -82,9 +82,9 @@ class TransientWindowObserver : public aura::WindowObserver {
} // namespace
-typedef AuraShellTestBase ModalContainerLayoutManagerTest;
+typedef AuraShellTestBase SystemModalContainerLayoutManagerTest;
-TEST_F(ModalContainerLayoutManagerTest, NonModalTransient) {
+TEST_F(SystemModalContainerLayoutManagerTest, NonModalTransient) {
scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false));
aura::Window* transient = TestWindow::OpenTestWindow(parent.get(), false);
TransientWindowObserver destruction_observer;
@@ -98,7 +98,7 @@ TEST_F(ModalContainerLayoutManagerTest, NonModalTransient) {
EXPECT_TRUE(destruction_observer.destroyed());
}
-TEST_F(ModalContainerLayoutManagerTest, ModalTransient) {
+TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) {
scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false));
// parent should be active.
EXPECT_TRUE(IsActiveWindow(parent.get()));
@@ -141,7 +141,7 @@ TEST_F(ModalContainerLayoutManagerTest, ModalTransient) {
// Tests that we can activate an unrelated window after a modal window is closed
// for a window.
-TEST_F(ModalContainerLayoutManagerTest, CanActivateAfterEndModalSession) {
+TEST_F(SystemModalContainerLayoutManagerTest, CanActivateAfterEndModalSession) {
scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false));
unrelated->SetBounds(gfx::Rect(100, 100, 50, 50));
scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false));
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index 4664fdd..22c91b0 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -156,7 +156,7 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
// When a modal window is active, cycling window does not take effect.
aura::Window* modal_container =
ash::Shell::GetInstance()->GetContainer(
- internal::kShellWindowId_ModalContainer);
+ internal::kShellWindowId_SystemModalContainer);
scoped_ptr<Window> modal_window(
CreateTestWindowWithId(-2, modal_container));
ActivateWindow(modal_window.get());