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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 ~TrayBackground() override {} | 106 ~TrayBackground() override {} |
107 | 107 |
108 SkColor color() { return color_; } | 108 SkColor color() { return color_; } |
109 void set_color(SkColor color) { color_ = color; } | 109 void set_color(SkColor color) { color_ = color; } |
110 void set_alpha(int alpha) { color_ = SkColorSetARGB(alpha, 0, 0, 0); } | 110 void set_alpha(int alpha) { color_ = SkColorSetARGB(alpha, 0, 0, 0); } |
111 | 111 |
112 private: | 112 private: |
113 ShelfWidget* GetShelfWidget() const { | 113 ShelfWidget* GetShelfWidget() const { |
114 return RootWindowController::ForWindow(tray_background_view_-> | 114 return tray_background_view_->GetShelfLayoutManager()->shelf_widget(); |
115 status_area_widget()->GetNativeWindow())->shelf(); | |
116 } | 115 } |
117 | 116 |
118 // Overridden from views::Background. | 117 // Overridden from views::Background. |
119 void Paint(gfx::Canvas* canvas, views::View* view) const override { | 118 void Paint(gfx::Canvas* canvas, views::View* view) const override { |
120 const int kGridSizeForPainter = 9; | 119 const int kGridSizeForPainter = 9; |
121 const int kImages[kNumOrientations][kNumStates][kGridSizeForPainter] = { | 120 const int kImages[kNumOrientations][kNumStates][kGridSizeForPainter] = { |
122 { // Horizontal | 121 { // Horizontal |
123 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ), | 122 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ), |
124 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ_ONBLACK), | 123 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ_ONBLACK), |
125 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ_PRESSED), | 124 IMAGE_GRID_HORIZONTAL(IDR_AURA_TRAY_BG_HORIZ_PRESSED), |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 background_->set_alpha(kTrayBackgroundAlpha); | 590 background_->set_alpha(kTrayBackgroundAlpha); |
592 SchedulePaint(); | 591 SchedulePaint(); |
593 } | 592 } |
594 | 593 |
595 void TrayBackgroundView::UpdateBubbleViewArrow( | 594 void TrayBackgroundView::UpdateBubbleViewArrow( |
596 views::TrayBubbleView* bubble_view) { | 595 views::TrayBubbleView* bubble_view) { |
597 // Nothing to do here. | 596 // Nothing to do here. |
598 } | 597 } |
599 | 598 |
600 } // namespace ash | 599 } // namespace ash |
OLD | NEW |