OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_item.h" | 12 #include "ash/system/tray/system_tray_item.h" |
13 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
14 #include "ash/wm/shadow_types.h" | 14 #include "ash/wm/shadow_types.h" |
15 #include "ash/wm/window_animations.h" | 15 #include "ash/wm/window_animations.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "grit/ash_strings.h" |
19 #include "third_party/skia/include/core/SkCanvas.h" | 20 #include "third_party/skia/include/core/SkCanvas.h" |
20 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
21 #include "third_party/skia/include/core/SkPaint.h" | 22 #include "third_party/skia/include/core/SkPaint.h" |
22 #include "third_party/skia/include/core/SkPath.h" | 23 #include "third_party/skia/include/core/SkPath.h" |
| 24 #include "ui/base/accessibility/accessible_view_state.h" |
| 25 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/gfx/canvas.h" | 26 #include "ui/gfx/canvas.h" |
24 #include "ui/gfx/skia_util.h" | 27 #include "ui/gfx/skia_util.h" |
25 #include "ui/views/border.h" | 28 #include "ui/views/border.h" |
26 #include "ui/views/bubble/bubble_delegate.h" | 29 #include "ui/views/bubble/bubble_delegate.h" |
27 #include "ui/views/controls/label.h" | 30 #include "ui/views/controls/label.h" |
28 #include "ui/views/layout/fill_layout.h" | 31 #include "ui/views/layout/fill_layout.h" |
29 #include "ui/views/layout/box_layout.h" | 32 #include "ui/views/layout/box_layout.h" |
30 #include "ui/views/view.h" | 33 #include "ui/views/view.h" |
31 | 34 |
32 namespace ash { | 35 namespace ash { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); | 284 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); |
282 it != items_.end(); | 285 it != items_.end(); |
283 ++it) { | 286 ++it) { |
284 views::View* view = detailed_ ? (*it)->CreateDetailedView(login_status) : | 287 views::View* view = detailed_ ? (*it)->CreateDetailedView(login_status) : |
285 (*it)->CreateDefaultView(login_status); | 288 (*it)->CreateDefaultView(login_status); |
286 if (view) | 289 if (view) |
287 AddChildView(new TrayItemContainer(view)); | 290 AddChildView(new TrayItemContainer(view)); |
288 } | 291 } |
289 } | 292 } |
290 | 293 |
| 294 // Overridden from views::View. |
| 295 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { |
| 296 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
| 297 state->name = l10n_util::GetStringUTF16( |
| 298 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); |
| 299 } |
| 300 |
291 virtual bool CanActivate() const OVERRIDE { | 301 virtual bool CanActivate() const OVERRIDE { |
292 return can_activate_; | 302 return can_activate_; |
293 } | 303 } |
294 | 304 |
295 virtual gfx::Size GetPreferredSize() OVERRIDE { | 305 virtual gfx::Size GetPreferredSize() OVERRIDE { |
296 gfx::Size size = views::BubbleDelegateView::GetPreferredSize(); | 306 gfx::Size size = views::BubbleDelegateView::GetPreferredSize(); |
297 return gfx::Size(kTrayPopupWidth, size.height()); | 307 return gfx::Size(kTrayPopupWidth, size.height()); |
298 } | 308 } |
299 | 309 |
300 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE { | 310 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 SchedulePaint(); | 491 SchedulePaint(); |
482 } | 492 } |
483 | 493 |
484 void SystemTray::OnWidgetClosing(views::Widget* widget) { | 494 void SystemTray::OnWidgetClosing(views::Widget* widget) { |
485 CHECK_EQ(popup_, widget); | 495 CHECK_EQ(popup_, widget); |
486 popup_ = NULL; | 496 popup_ = NULL; |
487 bubble_ = NULL; | 497 bubble_ = NULL; |
488 } | 498 } |
489 | 499 |
490 } // namespace ash | 500 } // namespace ash |
OLD | NEW |