| 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/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 272 } |
| 273 | 273 |
| 274 void SystemTrayBubble::InitView(views::View* anchor, | 274 void SystemTrayBubble::InitView(views::View* anchor, |
| 275 TrayBubbleView::InitParams init_params, | 275 TrayBubbleView::InitParams init_params, |
| 276 user::LoginStatus login_status) { | 276 user::LoginStatus login_status) { |
| 277 DCHECK(bubble_view_ == NULL); | 277 DCHECK(bubble_view_ == NULL); |
| 278 | 278 |
| 279 if (bubble_type_ == BUBBLE_TYPE_DETAILED && | 279 if (bubble_type_ == BUBBLE_TYPE_DETAILED && |
| 280 init_params.max_height < kDetailedBubbleMaxHeight) { | 280 init_params.max_height < kDetailedBubbleMaxHeight) { |
| 281 init_params.max_height = kDetailedBubbleMaxHeight; | 281 init_params.max_height = kDetailedBubbleMaxHeight; |
| 282 } else if (bubble_type_ == BUBBLE_TYPE_NOTIFICATION) { |
| 283 init_params.close_on_deactivate = false; |
| 282 } | 284 } |
| 283 | |
| 284 bubble_view_ = TrayBubbleView::Create(anchor, this, init_params); | 285 bubble_view_ = TrayBubbleView::Create(anchor, this, init_params); |
| 285 | 286 |
| 286 if (bubble_type_ == BUBBLE_TYPE_NOTIFICATION) | |
| 287 bubble_view_->set_close_on_deactivate(false); | |
| 288 | 287 |
| 289 CreateItemViews(login_status); | 288 CreateItemViews(login_status); |
| 290 | 289 |
| 291 DCHECK(bubble_widget_ == NULL); | 290 DCHECK(bubble_widget_ == NULL); |
| 292 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); | 291 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); |
| 293 bubble_widget_->AddObserver(this); | 292 bubble_widget_->AddObserver(this); |
| 294 | 293 |
| 295 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_); | 294 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_); |
| 296 } | 295 } |
| 297 | 296 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 391 } |
| 393 | 392 |
| 394 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { | 393 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { |
| 395 CHECK_EQ(bubble_widget_, widget); | 394 CHECK_EQ(bubble_widget_, widget); |
| 396 bubble_widget_ = NULL; | 395 bubble_widget_ = NULL; |
| 397 tray_->RemoveBubble(this); | 396 tray_->RemoveBubble(this); |
| 398 } | 397 } |
| 399 | 398 |
| 400 } // namespace internal | 399 } // namespace internal |
| 401 } // namespace ash | 400 } // namespace ash |
| OLD | NEW |