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/audio/tray_volume.h" | 10 #include "ash/system/audio/tray_volume.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 gfx::Point point(located_event.x(), 0); | 470 gfx::Point point(located_event.x(), 0); |
471 ConvertPointToWidget(this, &point); | 471 ConvertPointToWidget(this, &point); |
472 arrow_offset = point.x(); | 472 arrow_offset = point.x(); |
473 } | 473 } |
474 } | 474 } |
475 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); | 475 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); |
476 } | 476 } |
477 return true; | 477 return true; |
478 } | 478 } |
479 | 479 |
480 void SystemTray::OnMouseEntered(const views::MouseEvent& event) { | 480 void SystemTray::OnMouseEntered(const ui::MouseEvent& event) { |
481 TrayBackgroundView::OnMouseEntered(event); | 481 TrayBackgroundView::OnMouseEntered(event); |
482 should_show_launcher_ = true; | 482 should_show_launcher_ = true; |
483 } | 483 } |
484 | 484 |
485 void SystemTray::OnMouseExited(const views::MouseEvent& event) { | 485 void SystemTray::OnMouseExited(const ui::MouseEvent& event) { |
486 TrayBackgroundView::OnMouseExited(event); | 486 TrayBackgroundView::OnMouseExited(event); |
487 // When the popup closes we'll update |should_show_launcher_|. | 487 // When the popup closes we'll update |should_show_launcher_|. |
488 if (!bubble_.get()) | 488 if (!bubble_.get()) |
489 should_show_launcher_ = false; | 489 should_show_launcher_ = false; |
490 } | 490 } |
491 | 491 |
492 void SystemTray::AboutToRequestFocusFromTabTraversal(bool reverse) { | 492 void SystemTray::AboutToRequestFocusFromTabTraversal(bool reverse) { |
493 views::View* v = GetNextFocusableView(); | 493 views::View* v = GetNextFocusableView(); |
494 if (v) | 494 if (v) |
495 v->AboutToRequestFocusFromTabTraversal(reverse); | 495 v->AboutToRequestFocusFromTabTraversal(reverse); |
496 } | 496 } |
497 | 497 |
498 void SystemTray::GetAccessibleState(ui::AccessibleViewState* state) { | 498 void SystemTray::GetAccessibleState(ui::AccessibleViewState* state) { |
499 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 499 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
500 state->name = l10n_util::GetStringUTF16( | 500 state->name = l10n_util::GetStringUTF16( |
501 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); | 501 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); |
502 } | 502 } |
503 | 503 |
504 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) { | 504 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) { |
505 // The tray itself expands to the right and bottom edge of the screen to make | 505 // The tray itself expands to the right and bottom edge of the screen to make |
506 // sure clicking on the edges brings up the popup. However, the focus border | 506 // sure clicking on the edges brings up the popup. However, the focus border |
507 // should be only around the container. | 507 // should be only around the container. |
508 if (GetWidget() && GetWidget()->IsActive()) | 508 if (GetWidget() && GetWidget()->IsActive()) |
509 DrawBorder(canvas, GetContentsBounds()); | 509 DrawBorder(canvas, GetContentsBounds()); |
510 } | 510 } |
511 | 511 |
512 } // namespace ash | 512 } // namespace ash |
OLD | NEW |