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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 454173002: Fixed BubbleBorder sizing problems & added unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed construction order of the TrayBubbleView/TrayBubbleWrapper in WebNotificationBubbleWrapper co… Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/bubble/bubble_border.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 views::TrayBubbleView::InitParams init_params = 84 views::TrayBubbleView::InitParams init_params =
85 bubble->GetInitParams(anchor_alignment); 85 bubble->GetInitParams(anchor_alignment);
86 views::View* anchor = tray->tray_container(); 86 views::View* anchor = tray->tray_container();
87 if (anchor_alignment == views::TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) { 87 if (anchor_alignment == views::TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) {
88 gfx::Point bounds(anchor->width() / 2, 0); 88 gfx::Point bounds(anchor->width() / 2, 0);
89 views::View::ConvertPointToWidget(anchor, &bounds); 89 views::View::ConvertPointToWidget(anchor, &bounds);
90 init_params.arrow_offset = bounds.x(); 90 init_params.arrow_offset = bounds.x();
91 } 91 }
92 views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create( 92 views::TrayBubbleView* bubble_view = views::TrayBubbleView::Create(
93 tray->GetBubbleWindowContainer(), anchor, tray, &init_params); 93 tray->GetBubbleWindowContainer(), anchor, tray, &init_params);
94 bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
94 bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); 95 bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
bruthig 2014/08/26 18:54:28 My addition of calling UpdateBubble() in TrayBubbl
95 bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_view));
96 bubble->InitializeContents(bubble_view); 96 bubble->InitializeContents(bubble_view);
97 } 97 }
98 98
99 message_center::MessageBubbleBase* bubble() const { return bubble_.get(); } 99 message_center::MessageBubbleBase* bubble() const { return bubble_.get(); }
100 100
101 // Convenience accessors. 101 // Convenience accessors.
102 views::TrayBubbleView* bubble_view() const { return bubble_->bubble_view(); } 102 views::TrayBubbleView* bubble_view() const { return bubble_->bubble_view(); }
103 103
104 private: 104 private:
105 scoped_ptr<message_center::MessageBubbleBase> bubble_; 105 scoped_ptr<message_center::MessageBubbleBase> bubble_;
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 493
494 message_center::MessageCenterBubble* 494 message_center::MessageCenterBubble*
495 WebNotificationTray::GetMessageCenterBubbleForTest() { 495 WebNotificationTray::GetMessageCenterBubbleForTest() {
496 if (!message_center_bubble()) 496 if (!message_center_bubble())
497 return NULL; 497 return NULL;
498 return static_cast<message_center::MessageCenterBubble*>( 498 return static_cast<message_center::MessageCenterBubble*>(
499 message_center_bubble()->bubble()); 499 message_center_bubble()->bubble());
500 } 500 }
501 501
502 } // namespace ash 502 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/views/bubble/bubble_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698