| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 if (anchor_type_ == ANCHOR_TYPE_TRAY) { | 348 if (anchor_type_ == ANCHOR_TYPE_TRAY) { |
| 349 if (tray_->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { | 349 if (tray_->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { |
| 350 rect.Inset( | 350 rect.Inset( |
| 351 base::i18n::IsRTL() ? | 351 base::i18n::IsRTL() ? |
| 352 kPaddingFromRightEdgeOfScreenBottomAlignment : 0, | 352 kPaddingFromRightEdgeOfScreenBottomAlignment : 0, |
| 353 0, | 353 0, |
| 354 base::i18n::IsRTL() ? | 354 base::i18n::IsRTL() ? |
| 355 0 : kPaddingFromRightEdgeOfScreenBottomAlignment, | 355 0 : kPaddingFromRightEdgeOfScreenBottomAlignment, |
| 356 kPaddingFromBottomOfScreenBottomAlignment); | 356 kPaddingFromBottomOfScreenBottomAlignment); |
| 357 } else if (tray_->shelf_alignment() == SHELF_ALIGNMENT_LEFT) { | 357 } else if (tray_->shelf_alignment() == SHELF_ALIGNMENT_LEFT) { |
| 358 rect.Inset(0, 0, kPaddingFromEdgeOfLauncherVerticalAlignment, | 358 rect.Inset(0, 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, |
| 359 kPaddingFromBottomOfScreenVerticalAlignment); | 359 kPaddingFromBottomOfScreenVerticalAlignment); |
| 360 } else { | 360 } else { |
| 361 rect.Inset(kPaddingFromEdgeOfLauncherVerticalAlignment + 4, | 361 rect.Inset(kPaddingFromInnerEdgeOfLauncherVerticalAlignment, |
| 362 0, 0, kPaddingFromBottomOfScreenVerticalAlignment); | 362 0, 0, kPaddingFromBottomOfScreenVerticalAlignment); |
| 363 } | 363 } |
| 364 } else if (anchor_type_ == ANCHOR_TYPE_BUBBLE) { | 364 } else if (anchor_type_ == ANCHOR_TYPE_BUBBLE) { |
| 365 // For notification bubble to be anchored with uber tray bubble, | 365 // For notification bubble to be anchored with uber tray bubble, |
| 366 // the anchor can include arrow on left or right, which should | 366 // the anchor can include arrow on left or right, which should |
| 367 // be deducted out from the anchor rect. | 367 // be deducted out from the anchor rect. |
| 368 views::View* anchor_view = bubble_view()->anchor_view(); | 368 views::View* anchor_view = bubble_view()->anchor_view(); |
| 369 rect = anchor_view->GetScreenBounds(); | 369 rect = anchor_view->GetScreenBounds(); |
| 370 gfx::Insets insets = anchor_view->GetInsets(); | 370 gfx::Insets insets = anchor_view->GetInsets(); |
| 371 rect.Inset(insets); | 371 rect.Inset(insets); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 466 } |
| 467 | 467 |
| 468 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { | 468 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { |
| 469 CHECK_EQ(bubble_widget_, widget); | 469 CHECK_EQ(bubble_widget_, widget); |
| 470 bubble_widget_ = NULL; | 470 bubble_widget_ = NULL; |
| 471 tray_->RemoveBubble(this); | 471 tray_->RemoveBubble(this); |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace internal | 474 } // namespace internal |
| 475 } // namespace ash | 475 } // namespace ash |
| OLD | NEW |