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 "ui/message_center/views/message_center_bubble.h" | 5 #include "ui/message_center/views/message_center_bubble.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/message_center/message_center_style.h" | 9 #include "ui/message_center/message_center_style.h" |
10 #include "ui/message_center/views/message_center_view.h" | 10 #include "ui/message_center/views/message_center_view.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 init_params.max_height = max_height(); | 88 init_params.max_height = max_height(); |
89 init_params.can_activate = true; | 89 init_params.can_activate = true; |
90 return init_params; | 90 return init_params; |
91 } | 91 } |
92 | 92 |
93 void MessageCenterBubble::InitializeContents( | 93 void MessageCenterBubble::InitializeContents( |
94 views::TrayBubbleView* new_bubble_view) { | 94 views::TrayBubbleView* new_bubble_view) { |
95 set_bubble_view(new_bubble_view); | 95 set_bubble_view(new_bubble_view); |
96 bubble_view()->GetWidget()->AddObserver(this); | 96 bubble_view()->GetWidget()->AddObserver(this); |
97 message_center_view_ = new MessageCenterView( | 97 message_center_view_ = new MessageCenterView( |
98 message_center(), tray(), max_height(), initially_settings_visible_, | 98 message_center(), tray(), max_height(), initially_settings_visible_); |
99 false); /* MessageCenterBubble should be used only on ChromeOS. | |
100 Message center is never shown top down in ChromeOS. */ | |
101 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); | 99 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); |
102 // Resize the content of the bubble view to the given bubble size. This is | 100 // Resize the content of the bubble view to the given bubble size. This is |
103 // necessary in case of the bubble border forcing a bigger size then the | 101 // necessary in case of the bubble border forcing a bigger size then the |
104 // |new_bubble_view| actually wants. See crbug.com/169390. | 102 // |new_bubble_view| actually wants. See crbug.com/169390. |
105 bubble_view()->Layout(); | 103 bubble_view()->Layout(); |
106 UpdateBubbleView(); | 104 UpdateBubbleView(); |
107 } | 105 } |
108 | 106 |
109 void MessageCenterBubble::OnBubbleViewDestroyed() { | 107 void MessageCenterBubble::OnBubbleViewDestroyed() { |
110 message_center_view_ = NULL; | 108 message_center_view_ = NULL; |
(...skipping 20 matching lines...) Expand all Loading... |
131 } | 129 } |
132 | 130 |
133 void MessageCenterBubble::OnMouseExitedView() { | 131 void MessageCenterBubble::OnMouseExitedView() { |
134 } | 132 } |
135 | 133 |
136 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 134 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
137 return message_center_view_->NumMessageViewsForTest(); | 135 return message_center_view_->NumMessageViewsForTest(); |
138 } | 136 } |
139 | 137 |
140 } // namespace message_center | 138 } // namespace message_center |
OLD | NEW |