Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: ash/system/tray/tray_background_view.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ash.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 kPaddingFromBottomOfScreenVerticalAlignment; 566 kPaddingFromBottomOfScreenVerticalAlignment;
567 if (anchor_alignment == TrayBubbleView::ANCHOR_ALIGNMENT_LEFT) 567 if (anchor_alignment == TrayBubbleView::ANCHOR_ALIGNMENT_LEFT)
568 rect.Inset(vertical_alignment, 0, 0, horizontal_alignment); 568 rect.Inset(vertical_alignment, 0, 0, horizontal_alignment);
569 else if (anchor_alignment == TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT) 569 else if (anchor_alignment == TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT)
570 rect.Inset(0, 0, vertical_alignment, horizontal_alignment); 570 rect.Inset(0, 0, vertical_alignment, horizontal_alignment);
571 } 571 }
572 } 572 }
573 573
574 // TODO(jennyz): May need to add left/right alignment in the following code. 574 // TODO(jennyz): May need to add left/right alignment in the following code.
575 if (rect.IsEmpty()) { 575 if (rect.IsEmpty()) {
576 aura::RootWindow* target_root = anchor_widget ? 576 aura::Window* target_root = anchor_widget ?
577 anchor_widget->GetNativeView()->GetRootWindow() : 577 anchor_widget->GetNativeView()->GetRootWindow() :
578 Shell::GetPrimaryRootWindow(); 578 Shell::GetPrimaryRootWindow();
579 rect = target_root->bounds(); 579 rect = target_root->bounds();
580 rect = gfx::Rect( 580 rect = gfx::Rect(
581 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : 581 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment :
582 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, 582 rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment,
583 rect.height() - kPaddingFromBottomOfScreenBottomAlignment, 583 rect.height() - kPaddingFromBottomOfScreenBottomAlignment,
584 0, 0); 584 0, 0);
585 rect = ScreenAsh::ConvertRectToScreen(target_root, rect); 585 rect = ScreenAsh::ConvertRectToScreen(target_root, rect);
586 } 586 }
(...skipping 28 matching lines...) Expand all
615 else 615 else
616 background_->set_alpha(kTrayBackgroundAlpha); 616 background_->set_alpha(kTrayBackgroundAlpha);
617 SchedulePaint(); 617 SchedulePaint();
618 } 618 }
619 619
620 void TrayBackgroundView::UpdateBubbleViewArrow( 620 void TrayBackgroundView::UpdateBubbleViewArrow(
621 views::TrayBubbleView* bubble_view) { 621 views::TrayBubbleView* bubble_view) {
622 if (switches::UseAlternateShelfLayout()) 622 if (switches::UseAlternateShelfLayout())
623 return; 623 return;
624 624
625 aura::RootWindow* root_window = 625 aura::Window* root_window =
626 bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); 626 bubble_view->GetWidget()->GetNativeView()->GetRootWindow();
627 ash::internal::ShelfLayoutManager* shelf = 627 ash::internal::ShelfLayoutManager* shelf =
628 ShelfLayoutManager::ForLauncher(root_window); 628 ShelfLayoutManager::ForLauncher(root_window);
629 bubble_view->SetArrowPaintType( 629 bubble_view->SetArrowPaintType(
630 (shelf && shelf->IsVisible()) ? 630 (shelf && shelf->IsVisible()) ?
631 views::BubbleBorder::PAINT_NORMAL : 631 views::BubbleBorder::PAINT_NORMAL :
632 views::BubbleBorder::PAINT_TRANSPARENT); 632 views::BubbleBorder::PAINT_TRANSPARENT);
633 } 633 }
634 634
635 } // namespace internal 635 } // namespace internal
636 } // namespace ash 636 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698