| 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 "ui/message_center/message_center_style.h" | 7 #include "ui/message_center/message_center_style.h" |
| 8 #include "ui/message_center/message_center_util.h" | 8 #include "ui/message_center/message_center_util.h" |
| 9 #include "ui/message_center/views/message_center_view.h" | 9 #include "ui/message_center/views/message_center_view.h" |
| 10 #include "ui/views/layout/fill_layout.h" | 10 #include "ui/views/layout/fill_layout.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 init_params.max_width += kMarginBetweenItems * 2; | 82 init_params.max_width += kMarginBetweenItems * 2; |
| 83 init_params.max_height = max_height(); | 83 init_params.max_height = max_height(); |
| 84 init_params.can_activate = true; | 84 init_params.can_activate = true; |
| 85 return init_params; | 85 return init_params; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void MessageCenterBubble::InitializeContents( | 88 void MessageCenterBubble::InitializeContents( |
| 89 views::TrayBubbleView* new_bubble_view) { | 89 views::TrayBubbleView* new_bubble_view) { |
| 90 set_bubble_view(new_bubble_view); | 90 set_bubble_view(new_bubble_view); |
| 91 message_center_view_ = new MessageCenterView( | 91 message_center_view_ = new MessageCenterView( |
| 92 message_center(), tray(), max_height(), initially_settings_visible_); | 92 message_center(), |
| 93 tray(), |
| 94 max_height(), |
| 95 initially_settings_visible_, |
| 96 false /* MessageCenterBubble should be used only on ChromeOS. |
| 97 Buttons are always on bottom for ChromeOS. */); |
| 93 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); | 98 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); |
| 94 // Resize the content of the bubble view to the given bubble size. This is | 99 // Resize the content of the bubble view to the given bubble size. This is |
| 95 // necessary in case of the bubble border forcing a bigger size then the | 100 // necessary in case of the bubble border forcing a bigger size then the |
| 96 // |new_bubble_view| actually wants. See crbug.com/169390. | 101 // |new_bubble_view| actually wants. See crbug.com/169390. |
| 97 bubble_view()->Layout(); | 102 bubble_view()->Layout(); |
| 98 UpdateBubbleView(); | 103 UpdateBubbleView(); |
| 99 } | 104 } |
| 100 | 105 |
| 101 void MessageCenterBubble::OnBubbleViewDestroyed() { | 106 void MessageCenterBubble::OnBubbleViewDestroyed() { |
| 102 message_center_view_ = NULL; | 107 message_center_view_ = NULL; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 116 } | 121 } |
| 117 | 122 |
| 118 void MessageCenterBubble::OnMouseExitedView() { | 123 void MessageCenterBubble::OnMouseExitedView() { |
| 119 } | 124 } |
| 120 | 125 |
| 121 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 126 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
| 122 return message_center_view_->NumMessageViewsForTest(); | 127 return message_center_view_->NumMessageViewsForTest(); |
| 123 } | 128 } |
| 124 | 129 |
| 125 } // namespace message_center | 130 } // namespace message_center |
| OLD | NEW |