| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 if (is_visible) | 333 if (is_visible) |
| 334 bubble_widget->Show(); | 334 bubble_widget->Show(); |
| 335 else | 335 else |
| 336 bubble_widget->Hide(); | 336 bubble_widget->Hide(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 bool SystemTrayBubble::IsVisible() { | 339 bool SystemTrayBubble::IsVisible() { |
| 340 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); | 340 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 bool SystemTrayBubble::ShouldShowLauncher() const { | 343 bool SystemTrayBubble::ShouldShowShelf() const { |
| 344 for (std::vector<ash::SystemTrayItem*>::const_iterator it = items_.begin(); | 344 for (std::vector<ash::SystemTrayItem*>::const_iterator it = items_.begin(); |
| 345 it != items_.end(); | 345 it != items_.end(); |
| 346 ++it) { | 346 ++it) { |
| 347 if ((*it)->ShouldShowLauncher()) | 347 if ((*it)->ShouldShowShelf()) |
| 348 return true; | 348 return true; |
| 349 } | 349 } |
| 350 return false; | 350 return false; |
| 351 } | 351 } |
| 352 | 352 |
| 353 void SystemTrayBubble::CreateItemViews(user::LoginStatus login_status) { | 353 void SystemTrayBubble::CreateItemViews(user::LoginStatus login_status) { |
| 354 std::vector<views::View*> item_views; | 354 std::vector<views::View*> item_views; |
| 355 views::View* focus_view = NULL; | 355 views::View* focus_view = NULL; |
| 356 for (size_t i = 0; i < items_.size(); ++i) { | 356 for (size_t i = 0; i < items_.size(); ++i) { |
| 357 views::View* view = NULL; | 357 views::View* view = NULL; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 379 bubble_view_->AddChildView(new TrayPopupItemContainer( | 379 bubble_view_->AddChildView(new TrayPopupItemContainer( |
| 380 item_views[i], is_default_bubble, | 380 item_views[i], is_default_bubble, |
| 381 is_default_bubble && (i < item_views.size() - 2))); | 381 is_default_bubble && (i < item_views.size() - 2))); |
| 382 } | 382 } |
| 383 if (focus_view) | 383 if (focus_view) |
| 384 focus_view->RequestFocus(); | 384 focus_view->RequestFocus(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace internal | 387 } // namespace internal |
| 388 } // namespace ash | 388 } // namespace ash |
| OLD | NEW |