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.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/audio/tray_volume.h" | 10 #include "ash/system/audio/tray_volume.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 // Inform host items (models) that their views are being destroyed. | 406 // Inform host items (models) that their views are being destroyed. |
407 if (host_) | 407 if (host_) |
408 host_->DestroyItemViews(); | 408 host_->DestroyItemViews(); |
409 } | 409 } |
410 | 410 |
411 void SystemTrayBubbleView::Init() { | 411 void SystemTrayBubbleView::Init() { |
412 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 1, 1, 1)); | 412 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 1, 1, 1)); |
413 set_background(new SystemTrayBubbleBackground(this)); | 413 set_background(new SystemTrayBubbleBackground(this)); |
414 } | 414 } |
415 | 415 |
416 gfx::Rect SystemTrayBubbleView::GetAnchorRect() OVERRIDE { | 416 gfx::Rect SystemTrayBubbleView::GetAnchorRect() { |
417 if (host_) { | 417 if (host_) { |
418 views::Widget* widget = host_->GetTrayWidget(); | 418 views::Widget* widget = host_->GetTrayWidget(); |
419 if (widget->IsVisible()) { | 419 if (widget->IsVisible()) { |
420 gfx::Rect rect = widget->GetWindowScreenBounds(); | 420 gfx::Rect rect = widget->GetWindowScreenBounds(); |
421 rect.Inset( | 421 rect.Inset( |
422 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreen : 0, 0, | 422 base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreen : 0, 0, |
423 base::i18n::IsRTL() ? 0 : kPaddingFromRightEdgeOfScreen, | 423 base::i18n::IsRTL() ? 0 : kPaddingFromRightEdgeOfScreen, |
424 kPaddingFromBottomOfScreen); | 424 kPaddingFromBottomOfScreen); |
425 return rect; | 425 return rect; |
426 } | 426 } |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 canvas->DrawFocusRect(container_->bounds()); | 873 canvas->DrawFocusRect(container_->bounds()); |
874 } | 874 } |
875 | 875 |
876 void SystemTray::UpdateBackground(int alpha) { | 876 void SystemTray::UpdateBackground(int alpha) { |
877 background_->set_alpha(hide_background_animator_.alpha() + | 877 background_->set_alpha(hide_background_animator_.alpha() + |
878 hover_background_animator_.alpha()); | 878 hover_background_animator_.alpha()); |
879 SchedulePaint(); | 879 SchedulePaint(); |
880 } | 880 } |
881 | 881 |
882 } // namespace ash | 882 } // namespace ash |
OLD | NEW |