| Index: ui/aura_shell/launcher/launcher_view.cc
|
| diff --git a/ui/aura_shell/launcher/launcher_view.cc b/ui/aura_shell/launcher/launcher_view.cc
|
| index 7847f7712ccf0dfdf661f56875139db9d4d929f3..7be436c9ec89a6050c304d3629c4265276745673 100644
|
| --- a/ui/aura_shell/launcher/launcher_view.cc
|
| +++ b/ui/aura_shell/launcher/launcher_view.cc
|
| @@ -12,18 +12,21 @@
|
| #include "ui/aura_shell/launcher/tabbed_launcher_button.h"
|
| #include "ui/aura_shell/launcher/view_model.h"
|
| #include "ui/aura_shell/launcher/view_model_utils.h"
|
| +#include "ui/aura_shell/shelf_layout_manager.h"
|
| #include "ui/aura_shell/shell.h"
|
| #include "ui/aura_shell/shell_delegate.h"
|
| #include "ui/base/animation/animation.h"
|
| #include "ui/base/animation/throb_animation.h"
|
| #include "ui/base/models/simple_menu_model.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/gfx/canvas.h"
|
| #include "ui/gfx/compositor/layer.h"
|
| #include "ui/gfx/image/image.h"
|
| #include "ui/views/animation/bounds_animator.h"
|
| #include "ui/views/controls/button/image_button.h"
|
| #include "ui/views/controls/menu/menu_model_adapter.h"
|
| #include "ui/views/controls/menu/menu_runner.h"
|
| +#include "ui/views/painter.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| using ui::Animation;
|
| @@ -125,6 +128,25 @@ class FadeInAnimationDelegate :
|
| DISALLOW_COPY_AND_ASSIGN(FadeInAnimationDelegate);
|
| };
|
|
|
| +// Used to draw the background of the shelf.
|
| +class ShelfPainter : public views::Painter {
|
| + public:
|
| + ShelfPainter() {
|
| + ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| + image_ = *rb.GetImageNamed(IDR_AURA_LAUNCHER_BACKGROUND).ToSkBitmap();
|
| + }
|
| +
|
| + virtual void Paint(int w, int h, gfx::Canvas* canvas) OVERRIDE {
|
| + canvas->TileImageInt(image_, 0, 0, w, h);
|
| + }
|
| +
|
| + private:
|
| + SkBitmap image_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ShelfPainter);
|
| +};
|
| +
|
| +
|
| } // namespace
|
|
|
| // AnimationDelegate used when inserting a new item. This steadily decreased the
|
| @@ -202,8 +224,12 @@ LauncherView::~LauncherView() {
|
| }
|
|
|
| void LauncherView::Init() {
|
| - model_->AddObserver(this);
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| + model_->AddObserver(this);
|
| +
|
| + set_background(
|
| + views::Background::CreateBackgroundPainter(true, new ShelfPainter()));
|
| +
|
| new_browser_button_ = new views::ImageButton(this);
|
| int new_browser_button_image_id =
|
| Shell::GetInstance()->delegate()->GetResourceIDForNewBrowserWindow();
|
|
|