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

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

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
Index: ash/common/system/web_notification/web_notification_tray.cc
diff --git a/ash/common/system/web_notification/web_notification_tray.cc b/ash/common/system/web_notification/web_notification_tray.cc
index 034e1d4e06b54e78dd793f5ec2ca4fbba6a34af8..804426213ac2e74bdcf21aff1a8e75cb47d0093e 100644
--- a/ash/common/system/web_notification/web_notification_tray.cc
+++ b/ash/common/system/web_notification/web_notification_tray.cc
@@ -87,7 +87,8 @@ const SkColor kWebNotificationColorNoUnread =
SkColorSetARGB(128, 255, 255, 255);
const SkColor kWebNotificationColorWithUnread = SK_ColorWHITE;
const int kNoUnreadIconSize = 18;
-}
+
+} // namespace
// Class to initialize and manage the WebNotificationBubble and
// TrayBubbleWrapper instances for a bubble.
@@ -101,19 +102,10 @@ class WebNotificationBubbleWrapper {
tray->GetAnchorAlignment();
views::TrayBubbleView::InitParams init_params =
bubble->GetInitParams(anchor_alignment);
- views::View* anchor = tray->tray_container();
- if (anchor_alignment == views::TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) {
- gfx::Point bounds(anchor->width() / 2, 0);
- views::View::ConvertPointToWidget(anchor, &bounds);
- init_params.arrow_offset = bounds.x();
- }
- DCHECK(anchor);
- // TrayBubbleView uses |anchor| and |tray| to determine the parent
- // container. See WebNotificationTray::OnBeforeBubbleWidgetInit().
- views::TrayBubbleView* bubble_view =
- views::TrayBubbleView::Create(anchor, tray, &init_params);
+ views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create(
+ tray->GetBubbleAnchor(), tray, &init_params);
+ bubble_view->set_anchor_view_insets(tray->GetBubbleAnchorInsets());
bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
- bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
bubble->InitializeContents(bubble_view);
}
@@ -359,7 +351,7 @@ bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
should_block_shelf_auto_hide_ = true;
message_center::MessageCenterBubble* message_center_bubble =
new message_center::MessageCenterBubble(message_center(),
- message_center_tray_.get(), true);
+ message_center_tray_.get());
int max_height;
if (IsHorizontalAlignment(shelf_alignment())) {
@@ -502,13 +494,6 @@ base::string16 WebNotificationTray::GetAccessibleNameForBubble() {
return GetAccessibleNameForTray();
}
-gfx::Rect WebNotificationTray::GetAnchorRect(
- views::Widget* anchor_widget,
- views::TrayBubbleView::AnchorType anchor_type,
- views::TrayBubbleView::AnchorAlignment anchor_alignment) const {
- return GetBubbleAnchorRect(anchor_widget, anchor_type, anchor_alignment);
-}
-
void WebNotificationTray::OnBeforeBubbleWidgetInit(
views::Widget* anchor_widget,
views::Widget* bubble_widget,
« no previous file with comments | « ash/common/system/web_notification/web_notification_tray.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698