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_background_view.h" | 5 #include "ash/system/tray/tray_background_view.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
11 #include "ash/shelf/shelf_widget.h" | 11 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/shell_window_ids.h" | 13 #include "ash/shell_window_ids.h" |
14 #include "ash/system/status_area_widget.h" | 14 #include "ash/system/status_area_widget.h" |
15 #include "ash/system/status_area_widget_delegate.h" | 15 #include "ash/system/status_area_widget_delegate.h" |
16 #include "ash/system/tray/system_tray.h" | 16 #include "ash/system/tray/system_tray.h" |
17 #include "ash/system/tray/tray_constants.h" | 17 #include "ash/system/tray/tray_constants.h" |
18 #include "ash/system/tray/tray_event_filter.h" | 18 #include "ash/system/tray/tray_event_filter.h" |
19 #include "ash/wm/window_animations.h" | 19 #include "ash/wm/window_animations.h" |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 if (rect.IsEmpty()) { | 573 if (rect.IsEmpty()) { |
574 aura::Window* target_root = anchor_widget ? | 574 aura::Window* target_root = anchor_widget ? |
575 anchor_widget->GetNativeView()->GetRootWindow() : | 575 anchor_widget->GetNativeView()->GetRootWindow() : |
576 Shell::GetPrimaryRootWindow(); | 576 Shell::GetPrimaryRootWindow(); |
577 rect = target_root->bounds(); | 577 rect = target_root->bounds(); |
578 rect = gfx::Rect( | 578 rect = gfx::Rect( |
579 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : | 579 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : |
580 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, | 580 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, |
581 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, | 581 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, |
582 0, 0); | 582 0, 0); |
583 rect = ScreenAsh::ConvertRectToScreen(target_root, rect); | 583 rect = ScreenUtil::ConvertRectToScreen(target_root, rect); |
584 } | 584 } |
585 return rect; | 585 return rect; |
586 } | 586 } |
587 | 587 |
588 TrayBubbleView::AnchorAlignment TrayBackgroundView::GetAnchorAlignment() const { | 588 TrayBubbleView::AnchorAlignment TrayBackgroundView::GetAnchorAlignment() const { |
589 switch (shelf_alignment_) { | 589 switch (shelf_alignment_) { |
590 case SHELF_ALIGNMENT_BOTTOM: | 590 case SHELF_ALIGNMENT_BOTTOM: |
591 return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM; | 591 return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM; |
592 case SHELF_ALIGNMENT_LEFT: | 592 case SHELF_ALIGNMENT_LEFT: |
593 return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT; | 593 return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 ash::internal::ShelfLayoutManager* shelf = | 625 ash::internal::ShelfLayoutManager* shelf = |
626 ShelfLayoutManager::ForShelf(root_window); | 626 ShelfLayoutManager::ForShelf(root_window); |
627 bubble_view->SetArrowPaintType( | 627 bubble_view->SetArrowPaintType( |
628 (shelf && shelf->IsVisible()) ? | 628 (shelf && shelf->IsVisible()) ? |
629 views::BubbleBorder::PAINT_NORMAL : | 629 views::BubbleBorder::PAINT_NORMAL : |
630 views::BubbleBorder::PAINT_TRANSPARENT); | 630 views::BubbleBorder::PAINT_TRANSPARENT); |
631 } | 631 } |
632 | 632 |
633 } // namespace internal | 633 } // namespace internal |
634 } // namespace ash | 634 } // namespace ash |
OLD | NEW |