Index: ui/aura_shell/app_list/tile_view.h |
diff --git a/ui/aura_shell/app_list/tile_view.h b/ui/aura_shell/app_list/tile_view.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a4bca14bf32814d3d73ddc3d5d4828e6dfcad49f |
--- /dev/null |
+++ b/ui/aura_shell/app_list/tile_view.h |
@@ -0,0 +1,65 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_AURA_SHELL_APP_LIST_TILE_VIEW_H_ |
+#define UI_AURA_SHELL_APP_LIST_TILE_VIEW_H_ |
+#pragma once |
+ |
+#include "ui/aura_shell/aura_shell_export.h" |
+#include "ui/aura_shell/app_list/app_list_item_model_observer.h" |
+#include "ui/views/view.h" |
+ |
+class SkBitmap; |
+ |
+namespace views { |
+class ImageView; |
+class Label; |
+} |
+ |
+namespace aura_shell { |
+ |
+class AppListItemModel; |
+ |
+// A tile view to display AppListItemModel. |
+class AURA_SHELL_EXPORT TileView : public views::View, |
+ public AppListItemModelObserver { |
+ public: |
+ explicit TileView(AppListItemModel* model); |
+ virtual ~TileView(); |
+ |
+ // Tile size |
+ static const int kTileSize = 180; |
+ |
+ // Preferred icon size. |
+ static const int kIconSize = 128; |
+ |
+ protected: |
+ // Activates the tile. |
+ virtual void Activate(int event_flags); |
+ |
+ // AppListItemModelObserver overrides: |
+ virtual void ItemIconChanged() OVERRIDE; |
+ virtual void ItemTitleChanged() OVERRIDE; |
+ |
+ // views::View overrides: |
+ virtual gfx::Size GetPreferredSize() OVERRIDE; |
+ virtual void Layout() OVERRIDE; |
+ virtual void OnFocus() OVERRIDE; |
+ virtual void OnBlur() OVERRIDE; |
+ virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
+ virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
+ virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
+ virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; |
+ |
+ private: |
+ AppListItemModel* model_; |
+ views::ImageView* icon_; |
+ views::Label* label_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TileView); |
+}; |
+ |
+} // namespace aura_shell |
+ |
+#endif // UI_AURA_SHELL_APP_LIST_TILE_VIEW_H_ |