| 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/launcher/launcher.h" | 5 #include "ash/launcher/launcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 // views::View overrides: | 104 // views::View overrides: |
| 105 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE { | 105 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE { |
| 106 SkPaint paint; | 106 SkPaint paint; |
| 107 static const gfx::ImageSkia* launcher_background = NULL; | 107 static const gfx::ImageSkia* launcher_background = NULL; |
| 108 if (!launcher_background) { | 108 if (!launcher_background) { |
| 109 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 109 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 110 launcher_background = | 110 launcher_background = |
| 111 rb.GetImageNamed(IDR_AURA_LAUNCHER_DIMMING).ToImageSkia(); | 111 rb.GetImageNamed(IDR_AURA_LAUNCHER_DIMMING_BOTTOM).ToImageSkia(); |
| 112 } | 112 } |
| 113 paint.setAlpha(kDimAlpha); | 113 paint.setAlpha(kDimAlpha); |
| 114 canvas->DrawImageInt( | 114 canvas->DrawImageInt( |
| 115 *launcher_background, | 115 *launcher_background, |
| 116 0, 0, launcher_background->width(), launcher_background->height(), | 116 0, 0, launcher_background->width(), launcher_background->height(), |
| 117 0, 0, width(), height(), | 117 0, 0, width(), height(), |
| 118 false, | 118 false, |
| 119 paint); | 119 paint); |
| 120 } | 120 } |
| 121 | 121 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 void Launcher::DelegateView::OnPaintBackground(gfx::Canvas* canvas) { | 167 void Launcher::DelegateView::OnPaintBackground(gfx::Canvas* canvas) { |
| 168 if (launcher_->alignment_ == SHELF_ALIGNMENT_BOTTOM) { | 168 if (launcher_->alignment_ == SHELF_ALIGNMENT_BOTTOM) { |
| 169 SkPaint paint; | 169 SkPaint paint; |
| 170 static const gfx::ImageSkia* launcher_background = NULL; | 170 static const gfx::ImageSkia* launcher_background = NULL; |
| 171 if (!launcher_background) { | 171 if (!launcher_background) { |
| 172 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 172 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 173 launcher_background = | 173 launcher_background = |
| 174 rb.GetImageNamed(IDR_AURA_LAUNCHER_BACKGROUND).ToImageSkia(); | 174 rb.GetImageNamed(IDR_AURA_LAUNCHER_BACKGROUND_BOTTOM).ToImageSkia(); |
| 175 } | 175 } |
| 176 paint.setAlpha(alpha_); | 176 paint.setAlpha(alpha_); |
| 177 canvas->DrawImageInt( | 177 canvas->DrawImageInt( |
| 178 *launcher_background, | 178 *launcher_background, |
| 179 0, 0, launcher_background->width(), launcher_background->height(), | 179 0, 0, launcher_background->width(), launcher_background->height(), |
| 180 0, 0, width(), height(), | 180 0, 0, width(), height(), |
| 181 false, | 181 false, |
| 182 paint); | 182 paint); |
| 183 canvas->FillRect( | 183 canvas->FillRect( |
| 184 gfx::Rect(0, height() - kNumBlackPixels, width(), kNumBlackPixels), | 184 gfx::Rect(0, height() - kNumBlackPixels, width(), kNumBlackPixels), |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 widget_->SetBounds(bounds); | 373 widget_->SetBounds(bounds); |
| 374 if (dimmer_.get()) | 374 if (dimmer_.get()) |
| 375 dimmer_->SetBounds(bounds); | 375 dimmer_->SetBounds(bounds); |
| 376 } | 376 } |
| 377 | 377 |
| 378 internal::LauncherView* Launcher::GetLauncherViewForTest() { | 378 internal::LauncherView* Launcher::GetLauncherViewForTest() { |
| 379 return launcher_view_; | 379 return launcher_view_; |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace ash | 382 } // namespace ash |
| OLD | NEW |