diff options
-rw-r--r-- | ash/ash_switches.cc | 2 | ||||
-rw-r--r-- | ash/ash_switches.h | 2 | ||||
-rw-r--r-- | ash/shell.cc | 2 | ||||
-rw-r--r-- | ash/status_area/status_area_view.cc | 8 | ||||
-rw-r--r-- | ash/status_area/status_area_view.h | 1 | ||||
-rw-r--r-- | ash/system/tray/system_tray.cc | 6 | ||||
-rw-r--r-- | ash/system/tray/system_tray.h | 5 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_extra_parts_ash.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_utils.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/status_area_view.cc | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/status_area_view.h | 1 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 6 |
13 files changed, 37 insertions, 19 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc index 42feeb0..aee314a5 100644 --- a/ash/ash_switches.cc +++ b/ash/ash_switches.cc @@ -8,7 +8,7 @@ namespace ash { namespace switches { // Use the in-progress uber system tray. -const char kAshUberTray[] = "ash-uber-tray"; +const char kDisableAshUberTray[] = "disable-ash-uber-tray"; // Enables the Oak tree viewer. const char kAshEnableOak[] = "ash-enable-oak"; diff --git a/ash/ash_switches.h b/ash/ash_switches.h index 755f8db..490ae98 100644 --- a/ash/ash_switches.h +++ b/ash/ash_switches.h @@ -16,7 +16,7 @@ namespace switches { // see chromeos::LoginUtil::GetOffTheRecordCommandLine().) // Please keep alphabetized. -ASH_EXPORT extern const char kAshUberTray[]; +ASH_EXPORT extern const char kDisableAshUberTray[]; ASH_EXPORT extern const char kAshEnableOak[]; ASH_EXPORT extern const char kAuraGoogleDialogFrames[]; ASH_EXPORT extern const char kAuraLegacyPowerButton[]; diff --git a/ash/shell.cc b/ash/shell.cc index 3f66ee0..f72f66f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -532,7 +532,7 @@ void Shell::Init() { status_widget_ = delegate_->CreateStatusArea(); CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kAshUberTray)) { + if (!command_line->HasSwitch(switches::kDisableAshUberTray)) { // TODO(sad): This is rather ugly at the moment. This is because we are // supporting both the old and the new status bar at the same time. This // will soon get better once the new one is ready and the old one goes out diff --git a/ash/status_area/status_area_view.cc b/ash/status_area/status_area_view.cc index 62b327b..472a6f4 100644 --- a/ash/status_area/status_area_view.cc +++ b/ash/status_area/status_area_view.cc @@ -51,6 +51,14 @@ bool StatusAreaView::CanActivate() const { return focus_cycler->widget_activating() == GetWidget(); } +void StatusAreaView::DeleteDelegate() { + // If this is used as the content-view of the widget, then do nothing, since + // deleting the widget will end up deleting this. But if this is used only as + // the widget-delegate, then delete this now. + if (!GetWidget()) + delete this; +} + void StatusAreaView::OnPaint(gfx::Canvas* canvas) { canvas->DrawBitmapInt(status_mock_, 0, 0); } diff --git a/ash/status_area/status_area_view.h b/ash/status_area/status_area_view.h index a64791e..613b8f1 100644 --- a/ash/status_area/status_area_view.h +++ b/ash/status_area/status_area_view.h @@ -32,6 +32,7 @@ class ASH_EXPORT StatusAreaView : public views::WidgetDelegate, // views::WidgetDelegate overrides: virtual bool CanActivate() const OVERRIDE; + virtual void DeleteDelegate() OVERRIDE; private: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index 12e31ac..2bc4135 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -384,7 +384,7 @@ void SystemTray::ShowDefaultView() { popup_ = NULL; bubble_ = NULL; - ShowItems(items_, false, true); + ShowItems(items_.get(), false, true); } void SystemTray::ShowDetailedView(SystemTrayItem* item, @@ -455,7 +455,7 @@ bool SystemTray::OnKeyPressed(const views::KeyEvent& event) { if (popup_) popup_->Hide(); else - ShowItems(items_, false, true); + ShowItems(items_.get(), false, true); return true; } return false; @@ -465,7 +465,7 @@ bool SystemTray::OnMousePressed(const views::MouseEvent& event) { if (popup_) popup_->Hide(); else - ShowItems(items_, false, true); + ShowItems(items_.get(), false, true); return true; } diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h index b92b7a4..90f0a93 100644 --- a/ash/system/tray/system_tray.h +++ b/ash/system/tray/system_tray.h @@ -9,6 +9,7 @@ #include "ash/ash_export.h" #include "ash/system/user/login_status.h" #include "base/basictypes.h" +#include "base/memory/scoped_vector.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" @@ -53,7 +54,7 @@ class ASH_EXPORT SystemTray : public views::View, // Updates the items when the login status of the system changes. void UpdateAfterLoginStatusChange(user::LoginStatus login_status); - const std::vector<SystemTrayItem*>& items() const { return items_; } + const ScopedVector<SystemTrayItem>& items() const { return items_; } AudioObserver* audio_observer() const { return audio_observer_; @@ -90,7 +91,7 @@ class ASH_EXPORT SystemTray : public views::View, // Overridden from views::Widget::Observer. virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; - std::vector<SystemTrayItem*> items_; + ScopedVector<SystemTrayItem> items_; // The container for all the tray views of the items. views::View* container_; diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 45ba822..753e669 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -586,11 +586,11 @@ const Experiment kExperiments[] = { }, #if defined(USE_ASH) { - "enable-ash-uber-tray", + "disable-ash-uber-tray", IDS_FLAGS_ENABLE_ASH_UBER_TRAY_NAME, IDS_FLAGS_ENABLE_ASH_UBER_TRAY_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(ash::switches::kAshUberTray), + SINGLE_VALUE_TYPE(ash::switches::kDisableAshUberTray), }, { "enable-ash-oak", diff --git a/chrome/browser/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/chrome_browser_main_extra_parts_ash.cc index 563adb1..950bc0a 100644 --- a/chrome/browser/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/chrome_browser_main_extra_parts_ash.cc @@ -69,8 +69,8 @@ void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { // Add the status area buttons after Profile has been initialized. - if (!CommandLine::ForCurrentProcess()->HasSwitch( - ash::switches::kAshUberTray)) { + if (CommandLine::ForCurrentProcess()->HasSwitch( + ash::switches::kDisableAshUberTray)) { ChromeShellDelegate::instance()->status_area_host()->AddButtons(); } } diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 59b959d..9f24c74 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -1049,7 +1049,7 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine( switches::kPpapiFlashVersion, switches::kTouchDevices, #if defined(USE_AURA) - ash::switches::kAshUberTray, + ash::switches::kDisableAshUberTray, ash::switches::kAuraLegacyPowerButton, ash::switches::kAuraNoShadows, ash::switches::kAuraPanelManager, diff --git a/chrome/browser/chromeos/status/status_area_view.cc b/chrome/browser/chromeos/status/status_area_view.cc index f650a55..f7b5f4e 100644 --- a/chrome/browser/chromeos/status/status_area_view.cc +++ b/chrome/browser/chromeos/status/status_area_view.cc @@ -118,6 +118,19 @@ bool StatusAreaView::CanActivate() const { #endif } +void StatusAreaView::DeleteDelegate() { +#if defined(USE_ASH) + // If this is used as the content-view of the widget, then do nothing, since + // deleting the widget will end up deleting this. But if this is used only as + // the widget-delegate, then delete this now. + if (!GetWidget()) { + delete this; + return; + } +#endif + WidgetDelegate::DeleteDelegate(); +} + views::Widget* StatusAreaView::GetWidget() { return View::GetWidget(); } diff --git a/chrome/browser/chromeos/status/status_area_view.h b/chrome/browser/chromeos/status/status_area_view.h index 196800a..6864b0b 100644 --- a/chrome/browser/chromeos/status/status_area_view.h +++ b/chrome/browser/chromeos/status/status_area_view.h @@ -55,6 +55,7 @@ class StatusAreaView : public views::AccessiblePaneView, // views::WidgetDelegate overrides: virtual bool CanActivate() const OVERRIDE; + virtual void DeleteDelegate() OVERRIDE; virtual views::Widget* GetWidget() OVERRIDE; virtual const views::Widget* GetWidget() const OVERRIDE; diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index c0e85a45..f108585 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2609,12 +2609,6 @@ 'browser/chromeos/notifications/system_notification_browsertest.cc', 'browser/chromeos/panels/panel_browsertest.cc', 'browser/chromeos/process_proxy/process_proxy_browsertest.cc', - 'browser/chromeos/status/accessibility_menu_button_browsertest.cc', - 'browser/chromeos/status/caps_lock_menu_button_browsertest.cc', - 'browser/chromeos/status/clock_menu_button_browsertest.cc', - 'browser/chromeos/status/input_method_menu_button_browsertest.cc', - 'browser/chromeos/status/power_menu_button_browsertest.cc', - 'browser/chromeos/status/status_area_view_browsertest.cc', 'browser/chromeos/system_key_event_listener_browsertest.cc', 'browser/chromeos/tab_closeable_state_watcher_browsertest.cc', 'browser/chromeos/ui/brightness_bubble_browsertest.cc', |