| Index: ash/status_area/status_area_view.cc
|
| diff --git a/ash/status_area/status_area_view.cc b/ash/status_area/status_area_view.cc
|
| index 53ae934f50fd981c2f65239ec682734b4f081032..1502a945e5a332e90cf10add20e31efafb63fee1 100644
|
| --- a/ash/status_area/status_area_view.cc
|
| +++ b/ash/status_area/status_area_view.cc
|
| @@ -15,16 +15,16 @@
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/image/image.h"
|
| #include "ui/views/accessible_pane_view.h"
|
| +#include "ui/views/layout/fill_layout.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| namespace ash {
|
| namespace internal {
|
|
|
| StatusAreaView::StatusAreaView()
|
| - : status_mock_(*ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| - IDR_AURA_STATUS_MOCK).ToSkBitmap()),
|
| - focus_cycler_for_testing_(NULL) {
|
| + : focus_cycler_for_testing_(NULL) {
|
| }
|
| +
|
| StatusAreaView::~StatusAreaView() {
|
| }
|
|
|
| @@ -32,8 +32,13 @@ void StatusAreaView::SetFocusCyclerForTesting(const FocusCycler* focus_cycler) {
|
| focus_cycler_for_testing_ = focus_cycler;
|
| }
|
|
|
| -gfx::Size StatusAreaView::GetPreferredSize() {
|
| - return gfx::Size(status_mock_.width(), status_mock_.height());
|
| +bool StatusAreaView::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
| + if (accelerator.key_code() == ui::VKEY_ESCAPE) {
|
| + RemovePaneFocus();
|
| + GetFocusManager()->ClearFocus();
|
| + return true;
|
| + }
|
| + return false;
|
| }
|
|
|
| views::Widget* StatusAreaView::GetWidget() {
|
| @@ -53,15 +58,6 @@ bool StatusAreaView::CanActivate() const {
|
| }
|
|
|
| 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);
|
| }
|
|
|
| ASH_EXPORT views::Widget* CreateStatusArea(views::View* contents) {
|
| @@ -71,7 +67,7 @@ ASH_EXPORT views::Widget* CreateStatusArea(views::View* contents) {
|
| views::Widget* widget = new views::Widget;
|
| views::Widget::InitParams params(
|
| views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
|
| - gfx::Size ps = contents->GetPreferredSize();
|
| + gfx::Size ps = contents ? contents->GetPreferredSize() : gfx::Size(200, 29);
|
| params.bounds = gfx::Rect(0, 0, ps.width(), ps.height());
|
| params.delegate = status_area_view;
|
| params.parent = Shell::GetInstance()->GetContainer(
|
| @@ -85,6 +81,7 @@ ASH_EXPORT views::Widget* CreateStatusArea(views::View* contents) {
|
| // longer be needed and we can nuke this.
|
| views::AccessiblePaneView* accessible_pane =
|
| new views::AccessiblePaneView;
|
| + accessible_pane->SetLayoutManager(new views::FillLayout);
|
| accessible_pane->AddChildView(contents);
|
| widget->set_focus_on_creation(false);
|
| widget->SetContentsView(accessible_pane);
|
|
|