Skip to content

Commit

Permalink
Revert r 144499 "Rename the remaining usage of Monitor to Display"
Browse files Browse the repository at this point in the history
Temporarily reverting rename change to investigate 133784

TBR=oshima@chromium.org
BUG=123160
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144573 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
oshima@chromium.org committed Jun 27, 2012
1 parent f33386d commit e72fa4d
Show file tree
Hide file tree
Showing 64 changed files with 552 additions and 550 deletions.
18 changes: 9 additions & 9 deletions ash/accelerators/accelerator_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "ash/launcher/launcher_delegate.h"
#include "ash/launcher/launcher_model.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/display/display_controller.h"
#include "ash/display/multi_display_manager.h"
#include "ash/monitor/monitor_controller.h"
#include "ash/monitor/multi_monitor_manager.h"
#include "ash/root_window_controller.h"
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
Expand All @@ -44,7 +44,7 @@
#include "ui/oak/oak.h"

#if defined(OS_CHROMEOS)
#include "chromeos/display/output_configurator.h"
#include "chromeos/monitor/output_configurator.h"
#endif // defined(OS_CHROMEOS)

namespace ash {
Expand Down Expand Up @@ -585,17 +585,17 @@ bool AcceleratorController::PerformAction(int action,
return HandleToggleDesktopBackgroundMode();
case TOGGLE_ROOT_WINDOW_FULL_SCREEN:
return HandleToggleRootWindowFullScreen();
case DISPLAY_ADD_REMOVE:
case MONITOR_ADD_REMOVE:
if (DebugShortcutsEnabled())
internal::MultiDisplayManager::AddRemoveDisplay();
internal::MultiMonitorManager::AddRemoveMonitor();
return true;
case DISPLAY_CYCLE:
case MONITOR_CYCLE:
if (DebugShortcutsEnabled())
internal::MultiDisplayManager::CycleDisplay();
internal::MultiMonitorManager::CycleMonitor();
return true;
case DISPLAY_TOGGLE_SCALE:
case MONITOR_TOGGLE_SCALE:
if (DebugShortcutsEnabled())
internal::MultiDisplayManager::ToggleDisplayScale();
internal::MultiMonitorManager::ToggleMonitorScale();
return true;
case MAGNIFY_SCREEN_ZOOM_IN:
return HandleMagnifyScreen(1);
Expand Down
6 changes: 3 additions & 3 deletions ash/accelerators/accelerator_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ const AcceleratorData kAcceleratorData[] = {
// For testing on systems where Alt-Tab is already mapped.
{ true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
{ true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, CYCLE_BACKWARD_MRU },
{ true, ui::VKEY_F4, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, DISPLAY_CYCLE },
{ true, ui::VKEY_F4, ui::EF_SHIFT_DOWN, DISPLAY_ADD_REMOVE },
{ true, ui::VKEY_F4, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, MONITOR_CYCLE },
{ true, ui::VKEY_F4, ui::EF_SHIFT_DOWN, MONITOR_ADD_REMOVE },
{ true, ui::VKEY_HOME, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
DISPLAY_TOGGLE_SCALE },
MONITOR_TOGGLE_SCALE },
#if !defined(NDEBUG)
{ true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
PRINT_LAYER_HIERARCHY },
Expand Down
6 changes: 3 additions & 3 deletions ash/accelerators/accelerator_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ enum AcceleratorAction {
OPEN_FILE_MANAGER_DIALOG,
OPEN_FILE_MANAGER_TAB,
#endif
DISPLAY_ADD_REMOVE,
DISPLAY_CYCLE,
DISPLAY_TOGGLE_SCALE,
MONITOR_ADD_REMOVE,
MONITOR_CYCLE,
MONITOR_TOGGLE_SCALE,
ROTATE_SCREEN,
TOGGLE_DESKTOP_BACKGROUND_MODE,
TOGGLE_ROOT_WINDOW_FULL_SCREEN,
Expand Down
18 changes: 9 additions & 9 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
'launcher/tabbed_launcher_button.h',
'magnifier/magnification_controller.cc',
'magnifier/magnification_controller.h',
'display/display_controller.cc',
'display/display_controller.h',
'display/mouse_cursor_event_filter.cc',
'display/mouse_cursor_event_filter.h',
'display/multi_display_manager.cc',
'display/multi_display_manager.h',
'display/secondary_display_view.cc',
'display/secondary_display_view.h',
'monitor/monitor_controller.cc',
'monitor/monitor_controller.h',
'monitor/mouse_cursor_event_filter.cc',
'monitor/mouse_cursor_event_filter.h',
'monitor/multi_monitor_manager.cc',
'monitor/multi_monitor_manager.h',
'monitor/secondary_monitor_view.cc',
'monitor/secondary_monitor_view.h',
'root_window_controller.cc',
'root_window_controller.h',
'screen_ash.cc',
Expand Down Expand Up @@ -379,7 +379,6 @@
'accelerators/accelerator_table_unittest.cc',
'accelerators/nested_dispatcher_controller_unittest.cc',
'dip_unittest.cc',
'display/multi_display_manager_unittest.cc',
'drag_drop/drag_drop_controller_unittest.cc',
'extended_desktop_unittest.cc',
'focus_cycler_unittest.cc',
Expand All @@ -388,6 +387,7 @@
'launcher/launcher_navigator_unittest.cc',
'launcher/launcher_unittest.cc',
'launcher/launcher_view_unittest.cc',
'monitor/multi_monitor_manager_unittest.cc',
'root_window_controller_unittest.cc',
'screensaver/screensaver_view_unittest.cc',
'shell_unittest.cc',
Expand Down
6 changes: 3 additions & 3 deletions ash/dip_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ namespace ash {
typedef ash::test::AshTestBase DIPTest;

#if defined(OS_WIN)
// Windows/Aura doesn't have DIP support in display yet.
// Windows/Aura doesn't have DIP support in monitor yet.
#define MAYBE_WorkArea DISABLED_WorkArea
#else
#define MAYBE_WorkArea WorkArea
#endif

// Test if the WM sets correct work area under different density.
TEST_F(DIPTest, MAYBE_WorkArea) {
ChangeDisplayConfig(1.0f, gfx::Rect(0, 0, 1000, 900));
ChangeMonitorConfig(1.0f, gfx::Rect(0, 0, 1000, 900));

aura::RootWindow* root = Shell::GetPrimaryRootWindow();
const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(root);
Expand All @@ -46,7 +46,7 @@ TEST_F(DIPTest, MAYBE_WorkArea) {
EXPECT_EQ("0,0 1000x852", work_area.ToString());
EXPECT_EQ("0,0,48,0", display.bounds().InsetsFrom(work_area).ToString());

ChangeDisplayConfig(2.0f, gfx::Rect(0, 0, 2000, 1800));
ChangeMonitorConfig(2.0f, gfx::Rect(0, 0, 2000, 1800));

const gfx::Display display_2x = gfx::Screen::GetDisplayNearestWindow(root);

Expand Down
50 changes: 25 additions & 25 deletions ash/extended_desktop_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/display/display_controller.h"
#include "ash/display/multi_display_manager.h"
#include "ash/monitor/monitor_controller.h"
#include "ash/monitor/multi_monitor_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_cycle_controller.h"
Expand Down Expand Up @@ -58,19 +58,19 @@ class ExtendedDesktopTest : public test::AshTestBase {
virtual ~ExtendedDesktopTest() {}

virtual void SetUp() OVERRIDE {
internal::DisplayController::SetExtendedDesktopEnabled(true);
internal::MonitorController::SetExtendedDesktopEnabled(true);
AshTestBase::SetUp();
}

virtual void TearDown() OVERRIDE {
AshTestBase::TearDown();
internal::DisplayController::SetExtendedDesktopEnabled(false);
internal::MonitorController::SetExtendedDesktopEnabled(false);
}

protected:
internal::MultiDisplayManager* display_manager() {
return static_cast<internal::MultiDisplayManager*>(
aura::Env::GetInstance()->display_manager());
internal::MultiMonitorManager* monitor_manager() {
return static_cast<internal::MultiMonitorManager*>(
aura::Env::GetInstance()->monitor_manager());
}

private:
Expand All @@ -80,7 +80,7 @@ class ExtendedDesktopTest : public test::AshTestBase {
// Test conditions that root windows in extended desktop mode
// must satisfy.
TEST_F(ExtendedDesktopTest, Basic) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();

// All root windows must have the root window controller.
Expand All @@ -99,7 +99,7 @@ TEST_F(ExtendedDesktopTest, Basic) {
}

TEST_F(ExtendedDesktopTest, Activation) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();

// Move the active root window to the secondary.
Expand Down Expand Up @@ -134,7 +134,7 @@ TEST_F(ExtendedDesktopTest, Activation) {
}

TEST_F(ExtendedDesktopTest, SystemModal) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
Shell::GetInstance()->set_active_root_window(root_windows[0]);

Expand All @@ -153,7 +153,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) {
EXPECT_EQ(root_windows[1], modal_widget->GetNativeView()->GetRootWindow());
EXPECT_EQ(root_windows[1], Shell::GetActiveRootWindow());

// Clicking a widget on widget_on_1st display should not change activation.
// Clicking a widget on widget_on_1st monitor should not change activation.
aura::test::EventGenerator generator_1st(root_windows[0]);
generator_1st.MoveMouseToCenterOf(widget_on_1st->GetNativeView());
generator_1st.ClickLeftButton();
Expand All @@ -169,7 +169,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) {
}

TEST_F(ExtendedDesktopTest, TestCursor) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::GetInstance()->ShowCursor(false);
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
EXPECT_FALSE(root_windows[0]->cursor_shown());
Expand All @@ -186,8 +186,8 @@ TEST_F(ExtendedDesktopTest, TestCursor) {
}

TEST_F(ExtendedDesktopTest, CycleWindows) {
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(true);
UpdateDisplay("0+0-700x500,0+0-500x500");
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(true);
UpdateMonitor("0+0-700x500,0+0-500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
// Emulate virtual screen coordinate system.
root_windows[0]->SetBounds(gfx::Rect(0, 0, 700, 500));
Expand Down Expand Up @@ -235,12 +235,12 @@ TEST_F(ExtendedDesktopTest, CycleWindows) {
EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView()));
controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
EXPECT_TRUE(wm::IsActiveWindow(d2_w2->GetNativeView()));
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(false);
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(false);
}

TEST_F(ExtendedDesktopTest, GetRootWindowAt) {
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(true);
UpdateDisplay("0+0-700x500,0+0-500x500");
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(true);
UpdateMonitor("0+0-700x500,0+0-500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
// Emulate virtual screen coordinate system.
root_windows[0]->SetBounds(gfx::Rect(500, 0, 700, 500));
Expand All @@ -257,12 +257,12 @@ TEST_F(ExtendedDesktopTest, GetRootWindowAt) {
// Out of range point should return the primary root window
EXPECT_EQ(root_windows[0], Shell::GetRootWindowAt(gfx::Point(-100, 0)));
EXPECT_EQ(root_windows[0], Shell::GetRootWindowAt(gfx::Point(1201, 100)));
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(false);
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(false);
}

TEST_F(ExtendedDesktopTest, GetRootWindowMatching) {
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(true);
UpdateDisplay("0+0-700x500,0+0-500x500");
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(true);
UpdateMonitor("0+0-700x500,0+0-500x500");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
// Emulate virtual screen coordinate system.
root_windows[0]->SetBounds(gfx::Rect(500, 0, 700, 500));
Expand Down Expand Up @@ -297,11 +297,11 @@ TEST_F(ExtendedDesktopTest, GetRootWindowMatching) {
Shell::GetRootWindowMatching(gfx::Rect(-100, -300, 50, 50)));
EXPECT_EQ(root_windows[0],
Shell::GetRootWindowMatching(gfx::Rect(0, 2000, 50, 50)));
internal::DisplayController::SetVirtualScreenCoordinatesEnabled(false);
internal::MonitorController::SetVirtualScreenCoordinatesEnabled(false);
}

TEST_F(ExtendedDesktopTest, Capture) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();

aura::test::EventCountDelegate r1_d1;
Expand Down Expand Up @@ -353,13 +353,13 @@ namespace internal {
// Test if the Window::ConvertPointToWindow works across root windows.
// TODO(oshima): Move multiple display suport and this test to aura.
TEST_F(ExtendedDesktopTest, ConvertPoint) {
UpdateDisplay("0+0-1000x600,1001+0-600x400");
UpdateMonitor("0+0-1000x600,1001+0-600x400");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
gfx::Display& display_1 =
display_manager()->FindDisplayForRootWindow(root_windows[0]);
monitor_manager()->FindDisplayForRootWindow(root_windows[0]);
EXPECT_EQ("0,0", display_1.bounds().origin().ToString());
gfx::Display& display_2 =
display_manager()->FindDisplayForRootWindow(root_windows[1]);
monitor_manager()->FindDisplayForRootWindow(root_windows[1]);
Shell::GetInstance()->set_active_root_window(root_windows[0]);
aura::Window* d1 =
CreateTestWidget(gfx::Rect(10, 10, 100, 100))->GetNativeView();
Expand Down
Loading

0 comments on commit e72fa4d

Please sign in to comment.