| 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/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/system/status_area_widget.h" | 7 #include "ash/system/status_area_widget.h" |
| 8 #include "ash/system/tray/tray_bubble_view.h" | 8 #include "ash/system/tray/tray_bubble_view.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems); | 376 layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems); |
| 377 } | 377 } |
| 378 | 378 |
| 379 // views::View overrides. | 379 // views::View overrides. |
| 380 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { | 380 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { |
| 381 tray_->OnClicked(notification_.id); | 381 tray_->OnClicked(notification_.id); |
| 382 return true; | 382 return true; |
| 383 } | 383 } |
| 384 | 384 |
| 385 virtual ui::GestureStatus OnGestureEvent( |
| 386 const views::GestureEvent& event) OVERRIDE { |
| 387 if (event.type() != ui::ET_GESTURE_TAP) |
| 388 return ui::GESTURE_STATUS_UNKNOWN; |
| 389 tray_->OnClicked(notification_.id); |
| 390 return ui::GESTURE_STATUS_CONSUMED; |
| 391 } |
| 392 |
| 385 // Overridden from ButtonListener. | 393 // Overridden from ButtonListener. |
| 386 virtual void ButtonPressed(views::Button* sender, | 394 virtual void ButtonPressed(views::Button* sender, |
| 387 const views::Event& event) OVERRIDE { | 395 const views::Event& event) OVERRIDE { |
| 388 if (sender == close_button_) | 396 if (sender == close_button_) |
| 389 tray_->RemoveNotification(notification_.id); | 397 tray_->RemoveNotification(notification_.id); |
| 390 } | 398 } |
| 391 | 399 |
| 392 // Overridden from MenuButtonListener. | 400 // Overridden from MenuButtonListener. |
| 393 virtual void OnMenuButtonClicked( | 401 virtual void OnMenuButtonClicked( |
| 394 View* source, const gfx::Point& point) OVERRIDE { | 402 View* source, const gfx::Point& point) OVERRIDE { |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 UpdateIcon(); | 841 UpdateIcon(); |
| 834 if (!bubble()) | 842 if (!bubble()) |
| 835 return; | 843 return; |
| 836 if (GetNotificationCount() == 0) | 844 if (GetNotificationCount() == 0) |
| 837 status_area_widget_->HideWebNotificationBubble(); | 845 status_area_widget_->HideWebNotificationBubble(); |
| 838 else | 846 else |
| 839 bubble_->ScheduleUpdate(); | 847 bubble_->ScheduleUpdate(); |
| 840 } | 848 } |
| 841 | 849 |
| 842 } // namespace ash | 850 } // namespace ash |
| OLD | NEW |