| 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 fc4a8e0856484f0505178f4d58e3e16b04eb4c18..62b327b79a8e7e914e92c4a1e2d4ee01b15fd663 100644
|
| --- a/ash/status_area/status_area_view.cc
|
| +++ b/ash/status_area/status_area_view.cc
|
| @@ -5,6 +5,7 @@
|
| #include "ash/status_area/status_area_view.h"
|
|
|
| #include "ash/ash_export.h"
|
| +#include "ash/focus_cycler.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_window_ids.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -20,11 +21,16 @@ namespace internal {
|
|
|
| StatusAreaView::StatusAreaView()
|
| : status_mock_(*ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| - IDR_AURA_STATUS_MOCK).ToSkBitmap()) {
|
| + IDR_AURA_STATUS_MOCK).ToSkBitmap()),
|
| + focus_cycler_for_testing_(NULL) {
|
| }
|
| StatusAreaView::~StatusAreaView() {
|
| }
|
|
|
| +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());
|
| }
|
| @@ -37,6 +43,14 @@ const views::Widget* StatusAreaView::GetWidget() const {
|
| return View::GetWidget();
|
| }
|
|
|
| +bool StatusAreaView::CanActivate() const {
|
| + // We don't want mouse clicks to activate us, but we need to allow
|
| + // activation when the user is using the keyboard (FocusCycler).
|
| + const FocusCycler* focus_cycler = focus_cycler_for_testing_ ?
|
| + focus_cycler_for_testing_ : Shell::GetInstance()->focus_cycler();
|
| + return focus_cycler->widget_activating() == GetWidget();
|
| +}
|
| +
|
| void StatusAreaView::OnPaint(gfx::Canvas* canvas) {
|
| canvas->DrawBitmapInt(status_mock_, 0, 0);
|
| }
|
|
|