| 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/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/shelf/wm_shelf_util.h" | 11 #include "ash/common/shelf/wm_shelf_util.h" |
| 12 #include "ash/common/system/status_area_widget.h" | 12 #include "ash/common/system/status_area_widget.h" |
| 13 #include "ash/common/system/tray/system_tray.h" | 13 #include "ash/common/system/tray/system_tray.h" |
| 14 #include "ash/common/system/tray/system_tray_delegate.h" | 14 #include "ash/common/system/tray/system_tray_delegate.h" |
| 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 16 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
| 17 #include "ash/common/system/tray/tray_utils.h" | 17 #include "ash/common/system/tray/tray_utils.h" |
| 18 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h" | 18 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h" |
| 19 #include "ash/common/wm_lookup.h" | |
| 20 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 21 #include "ash/common/wm_window.h" | 20 #include "ash/common/wm_window.h" |
| 22 #include "ash/public/cpp/shell_window_ids.h" | 21 #include "ash/public/cpp/shell_window_ids.h" |
| 23 #include "ash/resources/vector_icons/vector_icons.h" | 22 #include "ash/resources/vector_icons/vector_icons.h" |
| 24 #include "ash/root_window_controller.h" | 23 #include "ash/root_window_controller.h" |
| 25 #include "ash/strings/grit/ash_strings.h" | 24 #include "ash/strings/grit/ash_strings.h" |
| 26 #include "base/auto_reset.h" | 25 #include "base/auto_reset.h" |
| 27 #include "base/i18n/number_formatting.h" | 26 #include "base/i18n/number_formatting.h" |
| 28 #include "base/i18n/rtl.h" | 27 #include "base/i18n/rtl.h" |
| 29 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 493 |
| 495 base::string16 WebNotificationTray::GetAccessibleNameForBubble() { | 494 base::string16 WebNotificationTray::GetAccessibleNameForBubble() { |
| 496 return GetAccessibleNameForTray(); | 495 return GetAccessibleNameForTray(); |
| 497 } | 496 } |
| 498 | 497 |
| 499 void WebNotificationTray::OnBeforeBubbleWidgetInit( | 498 void WebNotificationTray::OnBeforeBubbleWidgetInit( |
| 500 views::Widget* anchor_widget, | 499 views::Widget* anchor_widget, |
| 501 views::Widget* bubble_widget, | 500 views::Widget* bubble_widget, |
| 502 views::Widget::InitParams* params) const { | 501 views::Widget::InitParams* params) const { |
| 503 // Place the bubble in the same root window as |anchor_widget|. | 502 // Place the bubble in the same root window as |anchor_widget|. |
| 504 WmLookup::Get() | 503 WmWindow::Get(anchor_widget->GetNativeWindow()) |
| 505 ->GetWindowForWidget(anchor_widget) | |
| 506 ->GetRootWindowController() | 504 ->GetRootWindowController() |
| 507 ->ConfigureWidgetInitParamsForContainer( | 505 ->ConfigureWidgetInitParamsForContainer( |
| 508 bubble_widget, kShellWindowId_SettingBubbleContainer, params); | 506 bubble_widget, kShellWindowId_SettingBubbleContainer, params); |
| 509 } | 507 } |
| 510 | 508 |
| 511 void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) { | 509 void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) { |
| 512 HideBubbleWithView(bubble_view); | 510 HideBubbleWithView(bubble_view); |
| 513 } | 511 } |
| 514 | 512 |
| 515 bool WebNotificationTray::ShowNotifierSettings() { | 513 bool WebNotificationTray::ShowNotifierSettings() { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 | 653 |
| 656 message_center::MessageCenterBubble* | 654 message_center::MessageCenterBubble* |
| 657 WebNotificationTray::GetMessageCenterBubbleForTest() { | 655 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 658 if (!message_center_bubble()) | 656 if (!message_center_bubble()) |
| 659 return nullptr; | 657 return nullptr; |
| 660 return static_cast<message_center::MessageCenterBubble*>( | 658 return static_cast<message_center::MessageCenterBubble*>( |
| 661 message_center_bubble()->bubble()); | 659 message_center_bubble()->bubble()); |
| 662 } | 660 } |
| 663 | 661 |
| 664 } // namespace ash | 662 } // namespace ash |
| OLD | NEW |