summaryrefslogtreecommitdiffstats
path: root/ash/launcher/launcher.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 01:47:23 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 01:47:23 +0000
commit1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7 (patch)
tree7f8d2de39c9774a1f45afda0345b3aee83f38025 /ash/launcher/launcher.cc
parent51772fa550db198e7741414aeded8848191b6308 (diff)
downloadchromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.zip
chromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.tar.gz
chromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.tar.bz2
Use the correct launcher assets for shelf alignment.
Cleanup: remove redundant shelf code. - replaces switch to get values for alignment with template - eliminate alignment member variables and use shelf_layout_manager where possible. other minor clean ups: remove unnecessary namespace, use member variable. BUG=151417 TEST=none Review URL: https://chromiumcodereview.appspot.com/11434099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher.cc')
-rw-r--r--ash/launcher/launcher.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc
index f38b567..69de8e1 100644
--- a/ash/launcher/launcher.cc
+++ b/ash/launcher/launcher.cc
@@ -167,12 +167,13 @@ void Launcher::DelegateView::Layout() {
void Launcher::DelegateView::OnPaintBackground(gfx::Canvas* canvas) {
if (launcher_->alignment_ == SHELF_ALIGNMENT_BOTTOM) {
SkPaint paint;
- static const gfx::ImageSkia* launcher_background = NULL;
- if (!launcher_background) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- launcher_background =
- rb.GetImageNamed(IDR_AURA_LAUNCHER_BACKGROUND_BOTTOM).ToImageSkia();
- }
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ const gfx::ImageSkia* launcher_background = rb.GetImageSkiaNamed(
+ internal::ShelfLayoutManager::ForLauncher(
+ launcher_->widget()->GetNativeView())->
+ SelectValueForShelfAlignment(IDR_AURA_LAUNCHER_BACKGROUND_BOTTOM,
+ IDR_AURA_LAUNCHER_BACKGROUND_LEFT,
+ IDR_AURA_LAUNCHER_BACKGROUND_RIGHT));
paint.setAlpha(alpha_);
canvas->DrawImageInt(
*launcher_background,
@@ -230,6 +231,7 @@ Launcher::Launcher(aura::Window* window_container,
widget_->GetNativeView()->SetName("LauncherView");
widget_->GetNativeView()->SetProperty(internal::kStayInSameRootWindowKey,
true);
+
// SetBounds() has to be called after kStayInSameRootWindowKey is set.
gfx::Size pref =
static_cast<views::View*>(launcher_view_)->GetPreferredSize();