Chromium Code Reviews| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_); | 313 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void SystemTrayBubble::BubbleViewDestroyed() { | 316 void SystemTrayBubble::BubbleViewDestroyed() { |
| 317 DestroyItemViews(); | 317 DestroyItemViews(); |
| 318 bubble_view_ = NULL; | 318 bubble_view_ = NULL; |
| 319 } | 319 } |
| 320 | 320 |
| 321 void SystemTrayBubble::OnMouseEnteredView() { | 321 void SystemTrayBubble::OnMouseEnteredView() { |
| 322 StopAutoCloseTimer(); | 322 StopAutoCloseTimer(); |
| 323 tray_->UpdateShouldShowLauncher(); | |
| 323 } | 324 } |
| 324 | 325 |
| 325 void SystemTrayBubble::OnMouseExitedView() { | 326 void SystemTrayBubble::OnMouseExitedView() { |
| 326 RestartAutoCloseTimer(); | 327 RestartAutoCloseTimer(); |
| 328 tray_->UpdateShouldShowLauncher(); | |
|
sadrul
2012/08/15 16:47:01
Will this hide the launcher immediately?
stevenjb
2012/08/15 21:51:04
This will trigger a call to Shell::GetInstance()->
| |
| 327 } | 329 } |
| 328 | 330 |
| 329 void SystemTrayBubble::OnClickedOutsideView() { | 331 void SystemTrayBubble::OnClickedOutsideView() { |
| 330 if (bubble_type_ != BUBBLE_TYPE_NOTIFICATION) | 332 if (bubble_type_ != BUBBLE_TYPE_NOTIFICATION) |
| 331 bubble_widget_->Close(); | 333 bubble_widget_->Close(); |
| 332 } | 334 } |
| 333 | 335 |
| 336 string16 SystemTrayBubble::GetAccessibleName() { | |
| 337 return tray_->GetAccessibleName(); | |
| 338 } | |
| 339 | |
| 334 void SystemTrayBubble::DestroyItemViews() { | 340 void SystemTrayBubble::DestroyItemViews() { |
| 335 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); | 341 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); |
| 336 it != items_.end(); | 342 it != items_.end(); |
| 337 ++it) { | 343 ++it) { |
| 338 switch (bubble_type_) { | 344 switch (bubble_type_) { |
| 339 case BUBBLE_TYPE_DEFAULT: | 345 case BUBBLE_TYPE_DEFAULT: |
| 340 (*it)->DestroyDefaultView(); | 346 (*it)->DestroyDefaultView(); |
| 341 break; | 347 break; |
| 342 case BUBBLE_TYPE_DETAILED: | 348 case BUBBLE_TYPE_DETAILED: |
| 343 (*it)->DestroyDetailedView(); | 349 (*it)->DestroyDetailedView(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 } | 416 } |
| 411 | 417 |
| 412 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { | 418 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { |
| 413 CHECK_EQ(bubble_widget_, widget); | 419 CHECK_EQ(bubble_widget_, widget); |
| 414 bubble_widget_ = NULL; | 420 bubble_widget_ = NULL; |
| 415 tray_->RemoveBubble(this); | 421 tray_->RemoveBubble(this); |
| 416 } | 422 } |
| 417 | 423 |
| 418 } // namespace internal | 424 } // namespace internal |
| 419 } // namespace ash | 425 } // namespace ash |
| OLD | NEW |