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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 TrayBubbleView::InitParams::kArrowDefaultOffset); | 231 TrayBubbleView::InitParams::kArrowDefaultOffset); |
232 } | 232 } |
233 | 233 |
234 void SystemTray::ShowDetailedView(SystemTrayItem* item, | 234 void SystemTray::ShowDetailedView(SystemTrayItem* item, |
235 int close_delay, | 235 int close_delay, |
236 bool activate, | 236 bool activate, |
237 BubbleCreationType creation_type) { | 237 BubbleCreationType creation_type) { |
238 std::vector<SystemTrayItem*> items; | 238 std::vector<SystemTrayItem*> items; |
239 items.push_back(item); | 239 items.push_back(item); |
240 ShowItems(items, true, activate, creation_type, GetTrayXOffset(item)); | 240 ShowItems(items, true, activate, creation_type, GetTrayXOffset(item)); |
241 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); | 241 if (system_bubble_.get()) |
| 242 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); |
242 } | 243 } |
243 | 244 |
244 void SystemTray::SetDetailedViewCloseDelay(int close_delay) { | 245 void SystemTray::SetDetailedViewCloseDelay(int close_delay) { |
245 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED)) | 246 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED)) |
246 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); | 247 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); |
247 } | 248 } |
248 | 249 |
249 void SystemTray::HideDetailedView(SystemTrayItem* item) { | 250 void SystemTray::HideDetailedView(SystemTrayItem* item) { |
250 if (item != detailed_item_) | 251 if (item != detailed_item_) |
251 return; | 252 return; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 ConvertPointToWidget(this, &point); | 583 ConvertPointToWidget(this, &point); |
583 arrow_offset = point.x(); | 584 arrow_offset = point.x(); |
584 } | 585 } |
585 } | 586 } |
586 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); | 587 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); |
587 } | 588 } |
588 return true; | 589 return true; |
589 } | 590 } |
590 | 591 |
591 } // namespace ash | 592 } // namespace ash |
OLD | NEW |