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/tray_bubble_view.h" | 5 #include "ash/system/tray/tray_bubble_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/wm/shelf_layout_manager.h" | 10 #include "ash/wm/shelf_layout_manager.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 gfx::Size TrayBubbleView::GetPreferredSize() { | 384 gfx::Size TrayBubbleView::GetPreferredSize() { |
385 gfx::Size size = views::BubbleDelegateView::GetPreferredSize(); | 385 gfx::Size size = views::BubbleDelegateView::GetPreferredSize(); |
386 int height = size.height(); | 386 int height = size.height(); |
387 if (params_.max_height != 0 && height > params_.max_height) | 387 if (params_.max_height != 0 && height > params_.max_height) |
388 height = params_.max_height; | 388 height = params_.max_height; |
389 return gfx::Size(params_.bubble_width, height); | 389 return gfx::Size(params_.bubble_width, height); |
390 } | 390 } |
391 | 391 |
392 void TrayBubbleView::OnMouseEntered(const views::MouseEvent& event) { | 392 void TrayBubbleView::OnMouseEntered(const ui::MouseEvent& event) { |
393 if (host_) | 393 if (host_) |
394 host_->OnMouseEnteredView(); | 394 host_->OnMouseEnteredView(); |
395 } | 395 } |
396 | 396 |
397 void TrayBubbleView::OnMouseExited(const views::MouseEvent& event) { | 397 void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) { |
398 if (host_) | 398 if (host_) |
399 host_->OnMouseExitedView(); | 399 host_->OnMouseExitedView(); |
400 } | 400 } |
401 | 401 |
402 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) { | 402 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) { |
403 if (params_.can_activate) { | 403 if (params_.can_activate) { |
404 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 404 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
405 state->name = l10n_util::GetStringUTF16( | 405 state->name = l10n_util::GetStringUTF16( |
406 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); | 406 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); |
407 } | 407 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 return; | 496 return; |
497 } | 497 } |
498 // Handle clicking outside the bubble and tray. We don't block the event, so | 498 // Handle clicking outside the bubble and tray. We don't block the event, so |
499 // it will also be handled by whatever widget was clicked on. | 499 // it will also be handled by whatever widget was clicked on. |
500 OnClickedOutsideView(); | 500 OnClickedOutsideView(); |
501 } | 501 } |
502 | 502 |
503 | 503 |
504 } // namespace internal | 504 } // namespace internal |
505 } // namespace ash | 505 } // namespace ash |
OLD | NEW |