Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: ash/system/web_notification/web_notification_tray.cc

Issue 2901273003: chromeos: Remove TrayBubbleView::Delegate::OnBeforeBubbleWidgetInit (Closed)
Patch Set: nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | ui/message_center/views/message_bubble_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/web_notification_tray.cc
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index d2af3fb1f97db5c674c6345a3543602cfb51f08a..a0d0251f2462108120044e8c03aac93d9b78116c 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -4,7 +4,6 @@
#include "ash/system/web_notification/web_notification_tray.h"
-#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller.h"
@@ -84,12 +83,20 @@ class WebNotificationBubbleWrapper {
TrayBackgroundView* anchor_tray,
message_center::MessageBubbleBase* bubble) {
bubble_.reset(bubble);
- views::TrayBubbleView::AnchorAlignment anchor_alignment =
- tray->GetAnchorAlignment();
- views::TrayBubbleView::InitParams init_params =
- bubble->GetInitParams(anchor_alignment);
- views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create(
- anchor_tray->GetBubbleAnchor(), tray, &init_params);
+ views::TrayBubbleView::InitParams init_params;
+ init_params.delegate = tray;
+ init_params.parent_window = anchor_tray->GetBubbleWindowContainer();
+ init_params.anchor_view = anchor_tray->GetBubbleAnchor();
+ init_params.anchor_alignment = tray->GetAnchorAlignment();
+ const int width = message_center::kNotificationWidth +
+ message_center::kMarginBetweenItems * 2;
+ init_params.min_width = width;
+ init_params.max_width = width;
+ init_params.max_height = bubble->max_height();
+ init_params.can_activate = true;
+ init_params.bg_color = message_center::kBackgroundDarkColor;
+
+ views::TrayBubbleView* bubble_view = new views::TrayBubbleView(init_params);
bubble_view->set_anchor_view_insets(anchor_tray->GetBubbleAnchorInsets());
bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
bubble->InitializeContents(bubble_view);
@@ -453,16 +460,6 @@ base::string16 WebNotificationTray::GetAccessibleNameForBubble() {
return GetAccessibleNameForTray();
}
-void WebNotificationTray::OnBeforeBubbleWidgetInit(
- views::Widget* anchor_widget,
- views::Widget* bubble_widget,
- views::Widget::InitParams* params) const {
- // Place the bubble in the same root window as |anchor_widget|.
- RootWindowController::ForWindow(anchor_widget->GetNativeWindow())
- ->ConfigureWidgetInitParamsForContainer(
- bubble_widget, kShellWindowId_SettingBubbleContainer, params);
-}
-
void WebNotificationTray::HideBubble(const views::TrayBubbleView* bubble_view) {
HideBubbleWithView(bubble_view);
}
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | ui/message_center/views/message_bubble_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698