| 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/tray/system_tray_bubble.h" | 5 #include "ash/common/system/tray/system_tray_bubble.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 TrayBubbleView::InitParams* init_params) { | 188 TrayBubbleView::InitParams* init_params) { |
| 189 DCHECK(anchor); | 189 DCHECK(anchor); |
| 190 DCHECK(!bubble_view_); | 190 DCHECK(!bubble_view_); |
| 191 | 191 |
| 192 if (bubble_type_ == BUBBLE_TYPE_DETAILED && | 192 if (bubble_type_ == BUBBLE_TYPE_DETAILED && |
| 193 init_params->max_height < GetDetailedBubbleMaxHeight()) { | 193 init_params->max_height < GetDetailedBubbleMaxHeight()) { |
| 194 init_params->max_height = GetDetailedBubbleMaxHeight(); | 194 init_params->max_height = GetDetailedBubbleMaxHeight(); |
| 195 } else if (bubble_type_ == BUBBLE_TYPE_NOTIFICATION) { | 195 } else if (bubble_type_ == BUBBLE_TYPE_NOTIFICATION) { |
| 196 init_params->close_on_deactivate = false; | 196 init_params->close_on_deactivate = false; |
| 197 } | 197 } |
| 198 // The TrayBubbleView will use |anchor| and |tray_| to determine the parent | 198 |
| 199 // container for the bubble. | |
| 200 bubble_view_ = TrayBubbleView::Create(anchor, tray_, init_params); | 199 bubble_view_ = TrayBubbleView::Create(anchor, tray_, init_params); |
| 201 bubble_view_->set_adjust_if_offscreen(false); | 200 bubble_view_->set_adjust_if_offscreen(false); |
| 202 CreateItemViews(login_status); | 201 CreateItemViews(login_status); |
| 203 | 202 |
| 204 if (bubble_view_->CanActivate()) { | 203 if (bubble_view_->CanActivate()) { |
| 205 bubble_view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 204 bubble_view_->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 206 } | 205 } |
| 207 } | 206 } |
| 208 | 207 |
| 209 void SystemTrayBubble::FocusDefaultIfNeeded() { | 208 void SystemTrayBubble::FocusDefaultIfNeeded() { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 355 } |
| 357 } | 356 } |
| 358 | 357 |
| 359 if (focus_view) { | 358 if (focus_view) { |
| 360 tray_->ActivateBubble(); | 359 tray_->ActivateBubble(); |
| 361 focus_view->RequestFocus(); | 360 focus_view->RequestFocus(); |
| 362 } | 361 } |
| 363 } | 362 } |
| 364 | 363 |
| 365 } // namespace ash | 364 } // namespace ash |
| OLD | NEW |