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

Unified Diff: ui/aura_shell/launcher/launcher_view.cc

Issue 8873036: Create a visible shelf and constrain window movement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 9 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
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 727c9fce84574c19d757ffec8d8ff803da4fe518..a2a329b518b2924d78967b8ad4988c0ee94d8b1f 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;
@@ -167,6 +170,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) {
sky 2011/12/14 06:23:05 PVERRODE
DaveMoore 2011/12/14 17:03:19 Done.
+ 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
@@ -197,6 +219,7 @@ class LauncherView::FadeOutAnimationDelegate :
DISALLOW_COPY_AND_ASSIGN(FadeOutAnimationDelegate);
};
sky 2011/12/14 06:23:05 remove this line
DaveMoore 2011/12/14 17:03:19 Done.
+
// AnimationDelegate used to trigger fading an element in. When an item is
// inserted this delegate is attached to the animation that expands the size of
// the item. When done it kicks off another animation to fade the item in.
@@ -246,6 +269,9 @@ LauncherView::~LauncherView() {
void LauncherView::Init() {
model_->AddObserver(this);
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+
+ set_background(
+ views::Background::CreateBackgroundPainter(true, new ShelfPainter()));
new_browser_button_ = new FadeButton(this);
new_browser_button_->SetImage(
views::CustomButton::BS_NORMAL,

Powered by Google App Engine
This is Rietveld 408576698