diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 02:09:21 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 02:09:21 +0000 |
commit | dfc68f6af4e1ba33eadc8f4884d3dc4098892eb8 (patch) | |
tree | febfc5a317bae0938dbd1e7abde1b0a04d36aee1 /ash | |
parent | b3c4717987eb4a42ed2c24cf38df21ad1afbb7ed (diff) | |
download | chromium_src-dfc68f6af4e1ba33eadc8f4884d3dc4098892eb8.zip chromium_src-dfc68f6af4e1ba33eadc8f4884d3dc4098892eb8.tar.gz chromium_src-dfc68f6af4e1ba33eadc8f4884d3dc4098892eb8.tar.bz2 |
ash: Turn on the uber-tray by default.
You can still disable it from chrome://flags or using --disable-ash-uber-tray,
but there's no reason for anyone to want to!
TBR=davemoore@chromium.org
BUG=110130
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9704102
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-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 |
7 files changed, 18 insertions, 8 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_; |