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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 UpdateAfterShelfAlignmentChange(alignment); | 448 UpdateAfterShelfAlignmentChange(alignment); |
449 // Destroy any existing bubble so that it is rebuilt correctly. | 449 // Destroy any existing bubble so that it is rebuilt correctly. |
450 bubble_.reset(); | 450 bubble_.reset(); |
451 // Rebuild any notification bubble. | 451 // Rebuild any notification bubble. |
452 if (notification_bubble_.get()) { | 452 if (notification_bubble_.get()) { |
453 notification_bubble_.reset(); | 453 notification_bubble_.reset(); |
454 UpdateNotificationBubble(); | 454 UpdateNotificationBubble(); |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 bool SystemTray::PerformAction(const views::Event& event) { | 458 bool SystemTray::PerformAction(const ui::Event& event) { |
459 // If we're already showing the default view, hide it; otherwise, show it | 459 // If we're already showing the default view, hide it; otherwise, show it |
460 // (and hide any popup that's currently shown). | 460 // (and hide any popup that's currently shown). |
461 if (bubble_.get() && | 461 if (bubble_.get() && |
462 bubble_->bubble_type() == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) { | 462 bubble_->bubble_type() == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) { |
463 bubble_->Close(); | 463 bubble_->Close(); |
464 } else { | 464 } else { |
465 int arrow_offset = TrayBubbleView::InitParams::kArrowDefaultOffset; | 465 int arrow_offset = TrayBubbleView::InitParams::kArrowDefaultOffset; |
466 if (event.IsMouseEvent() || event.type() == ui::ET_GESTURE_TAP) { | 466 if (event.IsMouseEvent() || event.type() == ui::ET_GESTURE_TAP) { |
467 const views::LocatedEvent& located_event = | 467 const views::LocatedEvent& located_event = |
468 static_cast<const views::LocatedEvent&>(event); | 468 static_cast<const views::LocatedEvent&>(event); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |