From 77787cf1a890f6318c0f4dfb1ee5deb4ee068e85 Mon Sep 17 00:00:00 2001 From: "cpu@chromium.org" Date: Wed, 2 Oct 2013 06:53:24 +0000 Subject: [PATCH] Remove unused items in the ash tray for Windows. Like the update nagger Like IME Like the drive item BUG=227247 TEST=see bug Review URL: https://codereview.chromium.org/23560013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226404 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/system/tray/system_tray.cc | 31 +++++++++++++------------- ash/wm/panels/panel_window_resizer_unittest.cc | 31 +++++++++++++------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index c9a07be507dd..903a4ea01373 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -156,47 +156,46 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) { // the additional separator. for (int i = 0; i <= maximum_user_profiles; i++) AddTrayItem(new internal::TrayUser(this, i)); - #endif + + tray_accessibility_ = new internal::TrayAccessibility(this); + #if defined(OS_CHROMEOS) AddTrayItem(new internal::TrayEnterprise(this)); AddTrayItem(new internal::TrayLocallyManagedUser(this)); -#endif AddTrayItem(new internal::TrayIME(this)); - tray_accessibility_ = new internal::TrayAccessibility(this); AddTrayItem(tray_accessibility_); -#if defined(OS_CHROMEOS) AddTrayItem(new internal::TrayTracing(this)); AddTrayItem( new internal::TrayPower(this, message_center::MessageCenter::Get())); -#endif -#if defined(OS_CHROMEOS) AddTrayItem(new internal::TrayNetwork(this)); AddTrayItem(new internal::TrayVPN(this)); AddTrayItem(new internal::TraySms(this)); -#endif -#if !defined(OS_WIN) AddTrayItem(new internal::TrayBluetooth(this)); -#endif AddTrayItem(new internal::TrayDrive(this)); -#if defined(OS_CHROMEOS) AddTrayItem(new internal::TrayDisplay(this)); AddTrayItem(new internal::ScreenCaptureTrayItem(this)); AddTrayItem(new internal::ScreenShareTrayItem(this)); AddTrayItem(new internal::TrayAudio(this)); AddTrayItem(new internal::TrayBrightness(this)); -#endif -#if !defined(OS_WIN) AddTrayItem(new internal::TrayCapsLock(this)); -#endif -#if defined(OS_CHROMEOS) AddTrayItem(new internal::TraySettings(this)); -#endif AddTrayItem(new internal::TrayUpdate(this)); AddTrayItem(new internal::TrayDate(this)); +#elif defined(OS_WIN) + AddTrayItem(tray_accessibility_); + AddTrayItem(new internal::TrayDate(this)); +#elif defined(OS_LINUX) + AddTrayItem(new internal::TrayIME(this)); + AddTrayItem(tray_accessibility_); + AddTrayItem(new internal::TrayBluetooth(this)); + AddTrayItem(new internal::TrayDrive(this)); + AddTrayItem(new internal::TrayCapsLock(this)); + AddTrayItem(new internal::TrayUpdate(this)); + AddTrayItem(new internal::TrayDate(this)); +#endif #if defined(OS_LINUX) - // Add memory monitor if enabled. CommandLine* cmd = CommandLine::ForCurrentProcess(); if (cmd->HasSwitch(ash::switches::kAshEnableMemoryMonitor)) AddTrayItem(new internal::TrayMonitor(this)); diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index 7faba1fd7f4a..2c8cb478e8f2 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc @@ -56,7 +56,8 @@ class PanelWindowResizerTest : public test::AshTestBase { return location; } - aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { + aura::Window* CreatePanelWindow(const gfx::Point& origin) { + gfx::Rect bounds(origin, gfx::Size(101, 101)); aura::Window* window = CreateTestWindowInShellWithDelegateAndType( NULL, aura::client::WINDOW_TYPE_PANEL, @@ -151,9 +152,9 @@ class PanelWindowResizerTest : public test::AshTestBase { // Test dragging panel window along the shelf and verify that panel icons // are reordered appropriately. void DragAlongShelfReorder(int dx, int dy) { - gfx::Rect bounds(0, 0, 201, 201); - scoped_ptr w1(CreatePanelWindow(bounds)); - scoped_ptr w2(CreatePanelWindow(bounds)); + gfx::Point origin(0, 0); + scoped_ptr w1(CreatePanelWindow(origin)); + scoped_ptr w2(CreatePanelWindow(origin)); std::vector window_order_original; std::vector window_order_swapped; window_order_original.push_back(w1.get()); @@ -225,7 +226,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachBottom) { return; scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); DetachReattachTest(window.get(), 0, -1); } @@ -236,7 +237,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) { ash::Shell* shell = ash::Shell::GetInstance(); shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow()); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); DetachReattachTest(window.get(), 1, 0); } @@ -248,7 +249,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) { shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, shell->GetPrimaryRootWindow()); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); DetachReattachTest(window.get(), -1, 0); } @@ -259,7 +260,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) { ash::Shell* shell = ash::Shell::GetInstance(); shell->SetShelfAlignment(SHELF_ALIGNMENT_TOP, shell->GetPrimaryRootWindow()); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); DetachReattachTest(window.get(), 0, 1); } @@ -270,7 +271,7 @@ TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) { UpdateDisplay("600x400,600x400"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); scoped_ptr window( - CreatePanelWindow(gfx::Rect(600, 0, 201, 201))); + CreatePanelWindow(gfx::Point(600, 0))); EXPECT_EQ(root_windows[1], window->GetRootWindow()); DetachReattachTest(window.get(), 0, -1); } @@ -282,7 +283,7 @@ TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) { UpdateDisplay("600x400,600x400"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); EXPECT_EQ(root_windows[0], window->GetRootWindow()); DragStart(window.get()); @@ -313,7 +314,7 @@ TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) { UpdateDisplay("600x400,600x400"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); EXPECT_EQ(root_windows[0], window->GetRootWindow()); DragStart(window.get()); @@ -334,7 +335,7 @@ TEST_F(PanelWindowResizerTest, DetachThenAttachToSecondDisplay) { UpdateDisplay("600x400,600x600"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); EXPECT_EQ(root_windows[0], window->GetRootWindow()); @@ -367,7 +368,7 @@ TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) { UpdateDisplay("600x400,600x600"); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); gfx::Rect initial_bounds = window->GetBoundsInScreen(); EXPECT_EQ(root_windows[0], window->GetRootWindow()); @@ -388,7 +389,7 @@ TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) { TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) { scoped_ptr window( - CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + CreatePanelWindow(gfx::Point(0, 0))); EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached()); EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id()); DragStart(window.get()); @@ -417,7 +418,7 @@ TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) { } TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) { - scoped_ptr window(CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); + scoped_ptr window(CreatePanelWindow(gfx::Point(0, 0))); DragStart(window.get()); DragMove(0, -100); DragEnd(); -- 2.11.4.GIT