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

Unified Diff: ash/launcher/launcher.cc

Issue 11434099: Use the correct launcher assets for shelf alignment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/launcher/launcher_alignment_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher.cc
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc
index f38b5675e6e571d0fe64de33fbee610c3dc85072..69de8e1cfae7ad5e2e0edc090e969d28f231068e 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();
« no previous file with comments | « no previous file | ash/launcher/launcher_alignment_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698