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_bubble.h" | 5 #include "ash/system/tray/system_tray_bubble.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 bubble_type_ = bubble_type; | 373 bubble_type_ = bubble_type; |
374 CreateItemViews(Shell::GetInstance()->tray_delegate()->GetUserLoginStatus()); | 374 CreateItemViews(Shell::GetInstance()->tray_delegate()->GetUserLoginStatus()); |
375 bubble_widget_->GetContentsView()->Layout(); | 375 bubble_widget_->GetContentsView()->Layout(); |
376 } | 376 } |
377 | 377 |
378 void SystemTrayBubble::InitView(const InitParams& init_params) { | 378 void SystemTrayBubble::InitView(const InitParams& init_params) { |
379 DCHECK(bubble_view_ == NULL); | 379 DCHECK(bubble_view_ == NULL); |
380 anchor_type_ = init_params.anchor_type; | 380 anchor_type_ = init_params.anchor_type; |
381 bubble_view_ = new SystemTrayBubbleView( | 381 bubble_view_ = new SystemTrayBubbleView( |
382 init_params.anchor, this, init_params.can_activate); | 382 init_params.anchor, this, init_params.can_activate); |
| 383 if (bubble_type_ == BUBBLE_TYPE_NOTIFICATION) |
| 384 bubble_view_->set_close_on_deactivate(false); |
383 | 385 |
384 CreateItemViews(init_params.login_status); | 386 CreateItemViews(init_params.login_status); |
385 | 387 |
386 DCHECK(bubble_widget_ == NULL); | 388 DCHECK(bubble_widget_ == NULL); |
387 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); | 389 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); |
388 | 390 |
389 // Must occur after call to CreateBubble() | 391 // Must occur after call to CreateBubble() |
390 bubble_view_->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 392 bubble_view_->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
391 bubble_widget_->non_client_view()->frame_view()->set_background(NULL); | 393 bubble_widget_->non_client_view()->frame_view()->set_background(NULL); |
392 SystemTrayBubbleBorder::ArrowType arrow_type; | 394 SystemTrayBubbleBorder::ArrowType arrow_type; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 } | 503 } |
502 | 504 |
503 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { | 505 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { |
504 CHECK_EQ(bubble_widget_, widget); | 506 CHECK_EQ(bubble_widget_, widget); |
505 bubble_widget_ = NULL; | 507 bubble_widget_ = NULL; |
506 tray_->RemoveBubble(this); | 508 tray_->RemoveBubble(this); |
507 } | 509 } |
508 | 510 |
509 } // namespace internal | 511 } // namespace internal |
510 } // namespace ash | 512 } // namespace ash |
OLD | NEW |