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/common/system/status_area_widget.h" | 5 #include "ash/common/system/status_area_widget.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/system/overview/overview_button_tray.h" | 9 #include "ash/common/system/overview/overview_button_tray.h" |
| 10 #include "ash/common/system/status_area_widget_delegate.h" | 10 #include "ash/common/system/status_area_widget_delegate.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); | 275 status_area_widget_delegate_->AddTray(virtual_keyboard_tray_); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void StatusAreaWidget::AddImeMenuTray() { | 278 void StatusAreaWidget::AddImeMenuTray() { |
| 279 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); | 279 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); |
| 280 status_area_widget_delegate_->AddTray(ime_menu_tray_); | 280 status_area_widget_delegate_->AddTray(ime_menu_tray_); |
| 281 } | 281 } |
| 282 | 282 |
| 283 bool StatusAreaWidget::IsNextVisibleTrayToLogout( | 283 bool StatusAreaWidget::IsNextVisibleTrayToLogout( |
| 284 TrayBackgroundView* tray) const { | 284 TrayBackgroundView* tray) const { |
| 285 if (!logout_button_tray_) | |
|
Daniele Castagna
2016/12/13 17:24:58
Is whoever needs this going to call IsNextVisibleT
| |
| 286 return false; | |
| 287 | |
| 285 int logout_button_index = | 288 int logout_button_index = |
| 286 status_area_widget_delegate_->GetIndexOf(logout_button_tray_); | 289 status_area_widget_delegate_->GetIndexOf(logout_button_tray_); |
| 287 // Logout button should always exist. | |
| 288 DCHECK_NE(-1, logout_button_index); | |
| 289 if (!logout_button_tray_->visible()) | 290 if (!logout_button_tray_->visible()) |
| 290 return false; | 291 return false; |
| 291 | 292 |
| 292 for (int c = logout_button_index + 1; | 293 for (int c = logout_button_index + 1; |
| 293 c < status_area_widget_delegate_->child_count(); c++) { | 294 c < status_area_widget_delegate_->child_count(); c++) { |
| 294 if (status_area_widget_delegate_->child_at(c)->visible()) | 295 if (status_area_widget_delegate_->child_at(c)->visible()) |
| 295 return tray == status_area_widget_delegate_->child_at(c); | 296 return tray == status_area_widget_delegate_->child_at(c); |
| 296 } | 297 } |
| 297 return false; | 298 return false; |
| 298 } | 299 } |
| 299 #endif | 300 #endif |
| 300 | 301 |
| 301 void StatusAreaWidget::AddOverviewButtonTray() { | 302 void StatusAreaWidget::AddOverviewButtonTray() { |
| 302 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); | 303 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); |
| 303 status_area_widget_delegate_->AddTray(overview_button_tray_); | 304 status_area_widget_delegate_->AddTray(overview_button_tray_); |
| 304 } | 305 } |
| 305 | 306 |
| 306 } // namespace ash | 307 } // namespace ash |
| OLD | NEW |