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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 system_bubble_->bubble()->UpdateView(items, bubble_type); | 405 system_bubble_->bubble()->UpdateView(items, bubble_type); |
406 } else { | 406 } else { |
407 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, | 407 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, |
408 GetAnchorAlignment(), | 408 GetAnchorAlignment(), |
409 kTrayPopupWidth); | 409 kTrayPopupWidth); |
410 init_params.can_activate = can_activate; | 410 init_params.can_activate = can_activate; |
411 if (detailed) { | 411 if (detailed) { |
412 // This is the case where a volume control or brightness control bubble | 412 // This is the case where a volume control or brightness control bubble |
413 // is created. | 413 // is created. |
414 init_params.max_height = default_bubble_height_; | 414 init_params.max_height = default_bubble_height_; |
415 init_params.top_color = kBackgroundColor; | |
416 init_params.arrow_color = kBackgroundColor; | 415 init_params.arrow_color = kBackgroundColor; |
417 } else { | 416 } else { |
418 init_params.top_color = kBackgroundColor; | |
419 init_params.arrow_color = kHeaderBackgroundColorDark; | 417 init_params.arrow_color = kHeaderBackgroundColorDark; |
420 } | 418 } |
421 init_params.arrow_offset = arrow_offset; | 419 init_params.arrow_offset = arrow_offset; |
422 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); | 420 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); |
423 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble)); | 421 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble)); |
424 system_bubble_->InitView(this, tray_container(), &init_params); | 422 system_bubble_->InitView(this, tray_container(), &init_params); |
425 } | 423 } |
426 // Save height of default view for creating detailed views directly. | 424 // Save height of default view for creating detailed views directly. |
427 if (!detailed) | 425 if (!detailed) |
428 default_bubble_height_ = system_bubble_->bubble_view()->height(); | 426 default_bubble_height_ = system_bubble_->bubble_view()->height(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (system_bubble_.get()) { | 471 if (system_bubble_.get()) { |
474 anchor = system_bubble_->bubble_view(); | 472 anchor = system_bubble_->bubble_view(); |
475 anchor_type = TrayBubbleView::ANCHOR_TYPE_BUBBLE; | 473 anchor_type = TrayBubbleView::ANCHOR_TYPE_BUBBLE; |
476 } else { | 474 } else { |
477 anchor = tray_container(); | 475 anchor = tray_container(); |
478 anchor_type = TrayBubbleView::ANCHOR_TYPE_TRAY; | 476 anchor_type = TrayBubbleView::ANCHOR_TYPE_TRAY; |
479 } | 477 } |
480 TrayBubbleView::InitParams init_params(anchor_type, | 478 TrayBubbleView::InitParams init_params(anchor_type, |
481 GetAnchorAlignment(), | 479 GetAnchorAlignment(), |
482 kTrayPopupWidth); | 480 kTrayPopupWidth); |
483 init_params.top_color = kBackgroundColor; | |
484 init_params.arrow_color = kBackgroundColor; | 481 init_params.arrow_color = kBackgroundColor; |
485 init_params.arrow_offset = GetTrayXOffset(notification_items_[0]); | 482 init_params.arrow_offset = GetTrayXOffset(notification_items_[0]); |
486 notification_bubble_.reset( | 483 notification_bubble_.reset( |
487 new internal::SystemBubbleWrapper(notification_bubble)); | 484 new internal::SystemBubbleWrapper(notification_bubble)); |
488 notification_bubble_->InitView(this, anchor, &init_params); | 485 notification_bubble_->InitView(this, anchor, &init_params); |
489 | 486 |
490 if (notification_bubble->bubble_view()->child_count() == 0) { | 487 if (notification_bubble->bubble_view()->child_count() == 0) { |
491 // It is possible that none of the items generated actual notifications. | 488 // It is possible that none of the items generated actual notifications. |
492 DestroyNotificationBubble(); | 489 DestroyNotificationBubble(); |
493 return; | 490 return; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 ConvertPointToWidget(this, &point); | 596 ConvertPointToWidget(this, &point); |
600 arrow_offset = point.x(); | 597 arrow_offset = point.x(); |
601 } | 598 } |
602 } | 599 } |
603 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); | 600 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); |
604 } | 601 } |
605 return true; | 602 return true; |
606 } | 603 } |
607 | 604 |
608 } // namespace ash | 605 } // namespace ash |
OLD | NEW |