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

Side by Side Diff: ash/app_list/app_list_item_view.h

Issue 9559005: aura: Implement app list M19 mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use a better way to get ceiling Created 8 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/app_list/app_list_item_group_view.cc ('k') | ash/app_list/app_list_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_ 5 #ifndef ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_
6 #define ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_ 6 #define ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ash/app_list/app_list_item_model_observer.h" 9 #include "ash/app_list/app_list_item_model_observer.h"
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ui/views/view.h" 11 #include "ui/views/controls/button/custom_button.h"
12 12
13 class SkBitmap; 13 class SkBitmap;
14 14
15 namespace views { 15 namespace views {
16 class ImageView; 16 class ImageView;
17 class Label; 17 class Label;
18 } 18 }
19 19
20 namespace ash { 20 namespace ash {
21 21
22 class AppListItemModel; 22 class AppListItemModel;
23 class AppListItemViewListener;
24 23
25 class ASH_EXPORT AppListItemView : public views::View, 24 class ASH_EXPORT AppListItemView : public views::CustomButton,
26 public AppListItemModelObserver { 25 public AppListItemModelObserver {
27 public: 26 public:
28 AppListItemView(AppListItemModel* model, 27 AppListItemView(AppListItemModel* model,
29 AppListItemViewListener* listener); 28 views::ButtonListener* listener);
30 virtual ~AppListItemView(); 29 virtual ~AppListItemView();
31 30
32 AppListItemModel* model() const { 31 AppListItemModel* model() const {
33 return model_; 32 return model_;
34 } 33 }
35 34
36 // Tile size 35 // Icon padding
37 static const int kTileSize = 180; 36 static const int kPadding = 5;
38 37
39 // Preferred icon size. 38 // Internal class name.
40 static const int kIconSize = 128; 39 static const char kViewClassName[];
41 40
42 protected: 41 protected:
43 // Notifies listener when activated.
44 void NotifyActivated(int event_flags);
45
46 // AppListItemModelObserver overrides: 42 // AppListItemModelObserver overrides:
47 virtual void ItemIconChanged() OVERRIDE; 43 virtual void ItemIconChanged() OVERRIDE;
48 virtual void ItemTitleChanged() OVERRIDE; 44 virtual void ItemTitleChanged() OVERRIDE;
49 45
50 // views::View overrides: 46 // views::View overrides:
47 virtual std::string GetClassName() const OVERRIDE;
51 virtual gfx::Size GetPreferredSize() OVERRIDE; 48 virtual gfx::Size GetPreferredSize() OVERRIDE;
52 virtual void Layout() OVERRIDE; 49 virtual void Layout() OVERRIDE;
53 virtual void OnFocus() OVERRIDE; 50 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
54 virtual void OnBlur() OVERRIDE;
55 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
56 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
57 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
58 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
59 51
60 private: 52 private:
61 AppListItemModel* model_; 53 AppListItemModel* model_;
62 AppListItemViewListener* listener_;
63 54
64 views::ImageView* icon_; 55 views::ImageView* icon_;
65 views::Label* title_; 56 views::Label* title_;
66 57
67 DISALLOW_COPY_AND_ASSIGN(AppListItemView); 58 DISALLOW_COPY_AND_ASSIGN(AppListItemView);
68 }; 59 };
69 60
70 } // namespace ash 61 } // namespace ash
71 62
72 #endif // ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_ 63 #endif // ASH_APP_LIST_APP_LIST_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « ash/app_list/app_list_item_group_view.cc ('k') | ash/app_list/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698