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 "ash/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell/panel_window.h" | 9 #include "ash/shell/panel_window.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 // Destroy the notification bubble here so that it doesn't get rebuilt | 392 // Destroy the notification bubble here so that it doesn't get rebuilt |
393 // while we add items to the main bubble_ (e.g. in HideNotificationView). | 393 // while we add items to the main bubble_ (e.g. in HideNotificationView). |
394 notification_bubble_.reset(); | 394 notification_bubble_.reset(); |
395 | 395 |
396 if (system_bubble_.get() && creation_type == BUBBLE_USE_EXISTING) { | 396 if (system_bubble_.get() && creation_type == BUBBLE_USE_EXISTING) { |
397 system_bubble_->bubble()->UpdateView(items, bubble_type); | 397 system_bubble_->bubble()->UpdateView(items, bubble_type); |
398 } else { | 398 } else { |
399 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, | 399 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, |
400 GetAnchorAlignment(), | 400 GetAnchorAlignment(), |
401 kTrayPopupWidth); | 401 kTrayPopupMinWidth, |
| 402 kTrayPopupMaxWidth); |
402 init_params.can_activate = can_activate; | 403 init_params.can_activate = can_activate; |
403 if (detailed) { | 404 if (detailed) { |
404 // This is the case where a volume control or brightness control bubble | 405 // This is the case where a volume control or brightness control bubble |
405 // is created. | 406 // is created. |
406 init_params.max_height = default_bubble_height_; | 407 init_params.max_height = default_bubble_height_; |
407 init_params.arrow_color = kBackgroundColor; | 408 init_params.arrow_color = kBackgroundColor; |
408 } else { | 409 } else { |
409 init_params.arrow_color = kHeaderBackgroundColorDark; | 410 init_params.arrow_color = kHeaderBackgroundColorDark; |
410 } | 411 } |
411 init_params.arrow_offset = arrow_offset; | 412 init_params.arrow_offset = arrow_offset; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 TrayBubbleView::AnchorType anchor_type; | 463 TrayBubbleView::AnchorType anchor_type; |
463 if (system_bubble_.get()) { | 464 if (system_bubble_.get()) { |
464 anchor = system_bubble_->bubble_view(); | 465 anchor = system_bubble_->bubble_view(); |
465 anchor_type = TrayBubbleView::ANCHOR_TYPE_BUBBLE; | 466 anchor_type = TrayBubbleView::ANCHOR_TYPE_BUBBLE; |
466 } else { | 467 } else { |
467 anchor = tray_container(); | 468 anchor = tray_container(); |
468 anchor_type = TrayBubbleView::ANCHOR_TYPE_TRAY; | 469 anchor_type = TrayBubbleView::ANCHOR_TYPE_TRAY; |
469 } | 470 } |
470 TrayBubbleView::InitParams init_params(anchor_type, | 471 TrayBubbleView::InitParams init_params(anchor_type, |
471 GetAnchorAlignment(), | 472 GetAnchorAlignment(), |
472 kTrayPopupWidth); | 473 kTrayPopupMinWidth, |
| 474 kTrayPopupMaxWidth); |
473 init_params.arrow_color = kBackgroundColor; | 475 init_params.arrow_color = kBackgroundColor; |
474 init_params.arrow_offset = GetTrayXOffset(notification_items_[0]); | 476 init_params.arrow_offset = GetTrayXOffset(notification_items_[0]); |
475 notification_bubble_.reset( | 477 notification_bubble_.reset( |
476 new internal::SystemBubbleWrapper(notification_bubble)); | 478 new internal::SystemBubbleWrapper(notification_bubble)); |
477 notification_bubble_->InitView(this, anchor, &init_params); | 479 notification_bubble_->InitView(this, anchor, &init_params); |
478 | 480 |
479 if (notification_bubble->bubble_view()->child_count() == 0) { | 481 if (notification_bubble->bubble_view()->child_count() == 0) { |
480 // It is possible that none of the items generated actual notifications. | 482 // It is possible that none of the items generated actual notifications. |
481 DestroyNotificationBubble(); | 483 DestroyNotificationBubble(); |
482 return; | 484 return; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 ConvertPointToWidget(this, &point); | 585 ConvertPointToWidget(this, &point); |
584 arrow_offset = point.x(); | 586 arrow_offset = point.x(); |
585 } | 587 } |
586 } | 588 } |
587 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); | 589 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); |
588 } | 590 } |
589 return true; | 591 return true; |
590 } | 592 } |
591 | 593 |
592 } // namespace ash | 594 } // namespace ash |
OLD | NEW |